first characters of a CoffeeScript version

This commit is contained in:
Gwenhael Le Moine 2011-07-18 17:38:12 +02:00
parent 0b55fbcfaf
commit 4dad893e86

30
star.coffee Normal file
View file

@ -0,0 +1,30 @@
sys = require 'sys'
class StarBoard
cell =
WALL: '#'
BALL: '@'
CUBE: 'H'
VOID: ' '
GIFT: 'x'
direction =
UP: 38
DOWN: 40
LEFT: 37
RIGHT: 39
collected_gifts = 0
distance_travelled = 0
moving_actor = cell.BALL
height = 9
width = 16
board = "#################@## x#H## x #### ##x ## ## x #### x x x ## x x## x ## ##x x#################"
display = ->
sys.puts "Hello World!"
sb = new StarBoard
sb.display