Skip to content

Instantly share code, notes, and snippets.

@aufi
Created December 4, 2011 20:28
Show Gist options
  • Select an option

  • Save aufi/1431186 to your computer and use it in GitHub Desktop.

Select an option

Save aufi/1431186 to your computer and use it in GitHub Desktop.
coffee pokus coderetreat2011
class Game
constructor: ->
@points = []
list_points: ->
sousedi += " "+p[i].x+","+p[i].y for p in @points
alert(sousedi)
class Point
constructor: (x, y, game) ->
@x = x
@y = y
@game = game
game.points.push(this);
count: ->
alert(@x)
g = new Game();
p = new Point(2,3, g)
#p.count();
g.list_points()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment