mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-11-16 19:48:26 +01:00
first characters of a CoffeeScript version
This commit is contained in:
parent
0b55fbcfaf
commit
4dad893e86
1 changed files with 30 additions and 0 deletions
30
star.coffee
Normal file
30
star.coffee
Normal 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
|
Loading…
Reference in a new issue