mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-11-16 19:48:26 +01:00
31 lines
576 B
CoffeeScript
31 lines
576 B
CoffeeScript
|
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
|