File: static.coffee

package info (click to toggle)
coffeescript 2.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,608 kB
  • sloc: javascript: 1,273; makefile: 19; xml: 9; sh: 6
file content (9 lines) | stat: -rw-r--r-- 318 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
class Teenager
  @say: (speech) ->
    words = speech.split ' '
    fillers = ['uh', 'um', 'like', 'actually', 'so', 'maybe']
    output = []
    for word, index in words
      output.push word
      output.push fillers[Math.floor(Math.random() * fillers.length)] unless index is words.length - 1
    output.join ', '