Advertisement
Guest User

Untitled

a guest
Jan 6th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let btnClick(x:int,y:int,btn:Button) = cellswitch(x,y)
  2.                                        if iscellalive(x,y) then btn.BackColor <- Color.White else btn.BackColor <- Color.White
  3. //alternativ 2
  4. let btnClick(x:int,y:int,btn:Button) = if iscellalive(x,y)
  5.                     then btnmap.[x,y].BackColor <- Color.White
  6.                     else btnmap.[x,y].BackColor <- Color.White
  7.                                        
  8.  
  9.  
  10.  
  11. //2darray containing all the buttons, this i fun e -> är denna knappen, kan jag skicka in den här på något vis?
  12. let rec btnmap = Array2D.init 15 15(fun x y -> button(x,y,15).Click.Add(fun e-> btnClick(x,y,this)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement