Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (15 sloc) 834 Bytes
# rules for game start
choose e 'black ~> token e, color e "#444", x-rank e 1, y-rank e 1, size e 22
choose e 'white ~> token e, color e "#ddd", x-rank e 2, y-rank e 1, size e 22
create-game => choose a 'black, choose b 'white
click id _ e, ..choose e c => player id c
player p1 'black, player p2 'white => begin-game, turn 'black
begin-game => width 9, height 9
# rules for Go GUI
location l m n ~> token l, x-rank l n, y-rank l (m + 1), color l "transparent", size l 9
stone s l c, location l m n ~> token s, x-rank s n, y-rank s (m + 1), size s 12
stone s _ 'black ~> color s "#444"
stone s _ 'white ~> color s "#ddd"
.click p 'left l, location l m n, player p color, turn color => place-stone color m n
.make-stone _ color, ..turn color, op color other => turn other
token l1, token l2, adjacent l1 l2 ~> line-to l1 l2