     toMove = moveQueue.pop()
 
     while toMove
-      toMove.feature.animate(toMove.attrs, 1000, 'linear', countdown)
+      toMove.feature.animate(
+        toMove.attrs
+        1000
+        'linear'
+        countdown)
       toMove = moveQueue.pop()
 
     countdown()
 
   grammer =
     create:
-      match: /(\w*) is an? (\w*) at (\w*) (\w*)/
+      match: /(\w+)\s+is\s+an?\s+(\w+)\s+at\s+([123]?\d?\d)\s+([123]?\d?\d)/
       handle: (match, cb) ->
-        create(cb,
-          match[1],
-          match[2],
-          parseInt(match[3], 10) + offset.left,
+        create(cb
+          match[1]
+          match[2]
+          parseInt(match[3], 10) + offset.left
           parseInt(match[4], 10) + offset.top)
     die:
-      match: /(\w*) dies/
+      match: /(\w+)\s+dies/
       handle: (match, cb) ->
         feature = features[match[1]]
         feature.remove() if feature
         cb()
     move:
-      match: /(\w*) moves to (\w*) (\w*)/
+      match: /(\w+)\s+moves\s+to\s+([123]?\d?\d)\s+([123]?\d?\d)/
       handle: (match, cb)->
-        move(cb,
-          match[1],
-          parseInt(match[2], 10) + offset.left,
+        move(
+          cb
+          match[1]
+          parseInt(match[2], 10) + offset.left
           parseInt(match[3], 10) + offset.top)
     pause:
-      match: /pause (\w*)/
+      match: /pause\s+(\d+)/
       handle: (match, cb)->
-        setTimeout(cb,
-        parseInt(match[1], 10) * 10)
+        setTimeout(cb
+          parseInt(match[1], 10) * 10)
     say:
-      match: /say (.*)/
+      match: /say\s+(.+)/
       handle: (match, cb)->
         speaker.text match[1]
         cb()
     says:
-      match: /(\w*) says (.*)/
+      match: /(\w+)\s+says\s+(.*)/
       handle: (match, cb)->
         speaker.text "#{match[1]} says, \"#{match[2]}\""
         cb()
     go:
       match: /^(\s*)$/
       handle: (match, cb)->
-        go(cb)
+        go cb
 
   parse = (text, cb)->
+    features = {}
+    moveQueue = []
+    board.html ""
+
     steps = []
-    parseLine = (i, line)->
-      $.each grammer, (key, check)->
-        match = check.match.exec(line)
+    for line in text.split '\n'
+      for own key, check of grammer
+        match = check.match.exec line
         if match
-          steps[steps.length] = { check: check, match: match }
+          steps[steps.length] =
+            check: check
+            match: match
 
     idx = 0
     next = ->

    false

  game.show()
)

###
storyturtle.js
License MIT
http://simplectic.com/story_turtle
###
$ ->
  game = $("#game")
    .hide()

  editor = $("<textarea>",
    rows: 15
    cols: 30).
    hide().
    val(game.text()).
    appendTo(game.text(""))

  board = $("<div>")
    .width(300)
    .height(300)
    .appendTo(game)

  speaker = $("<div>")
    .width(350)
    .appendTo(game)

  play = $("<a>", href:'#').
    text("Play!")
    .css(float: "left")

  edit = $("<a>", href: '#')
    .text("Edit")
    .css(float: "right")

  controls = $("<div>")
    .width(300)
    .append(play, edit)
    .appendTo(game)

  features = {}
  moveQueue = []
  offset =
    left:0
    top:0

  create = (cb, name, type, x, y)->
    feature = features[name]
