Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.84 KB | None | 0 0
  1.     let rec loop n = async{
  2.         if n <> 0 && !running then
  3.             Game.progressGame gameBoard GUI.CellCount
  4.             drawGameBoard()
  5.             do! Async.Sleep(GUI.Timer)
  6.             return! loop (n-1)
  7.         else
  8.             GUI.btnRun.Text <- "Run"
  9.             running := false
  10.     }
  11.     GUI.btnRun.Click
  12.         |> Observable.add(fun _ ->
  13.                             GUI.btnRun.Text <- if !running then "Run" else "Stop"
  14.                             running := not !running
  15.                             if !running then
  16.                                 let a, out = System.Int32.TryParse(GUI.txtTimes.Text.Trim())
  17.                                 if out > 0 then
  18.                                     Async.StartImmediate(loop out)
  19.                                 else
  20.                                     Async.StartImmediate(loop -1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement