SHOW:
|
|
- or go back to the newest paste.
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 | - | if iscellalive(x,y) then btnmap.[x,y].BackColor <- Color.White else btnmap.[x,y].BackColor <- Color.White |
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))) |