title: Coffeescript resetCards is not a function
body: <p>I have been running coffeescript along with expressjs on nodejs, I am making a little script to give you 9 random playing cards (with no duplicates), I made a function resetCards to reset the cards after every display, but when I run the script it gives me:</p>
  
  <pre><code>TypeError: resetCards is not a function
      at Object.&lt;anonymous&gt; (/home/zunon/projects/xKoot/router.js:10:1)
      at Module._compile (module.js:398:26)
      at Object.Module._extensions..js (module.js:405:10)
      at Module.load (module.js:344:32)
      at Function.Module._load (module.js:301:12)
      at Module.require (module.js:354:17)
      at require (internal/module.js:12:17)
      at Object.&lt;anonymous&gt; (/home/zunon/projects/xKoot/xkoot.js:6:10)
      at Module._compile (module.js:398:26)
      at Object.Module._extensions..js (module.js:405:10)
  </code></pre>
  
  <p>Here is the file router.coffee:</p>
  
  <pre><code>express = require 'express'
  router = express.Router()
  
  cards = []
  
  resetCards()
  
  router.route '/randomcard'
      .get (req, res) -&gt;
          cardNames = []
          for i in [1..9] by 1
              cardNames[i] = createCardName()
          console.log cardNames
          res.render 'randomcard', {cardNames}
          return
  
  createCardName = -&gt;
      position = Math.floor Math.random() * cards.length
      cards.splice position, 1
      cards[position]
  
  resetCards = -&gt;
      for i in [1..13] by 1
          cards[i - 1] = "club#{i}"
          cards[i + 12] = "dmnd#{i}"
          cards[i + 25] = "hart#{i}"
          cards[i + 38] = "spad#{i}"
          if i &lt; 3
              cards[i + 51] = "joke#{i}"  
  
  module.exports = router
  </code></pre>