anchor.diff:  let rec updateUi game =
       let boardElement = document.getElementById("sg-board") :?> HTMLDivElement
       let scoreElement = document.getElementById ("sg-score") :?> HTMLDivElement
  +
  +    let play game (x,y) =
  +        match game with
  +        | Some g -> 
  +            Some (api.Play g { Col = x; Row = y })
  +        | _  -> None
  +        |> updateUi
   
       let addListeners maxColIndex maxRowIndex  =
           [0..maxColIndex] |> List.iter (fun x ->
               [0..maxRowIndex] |> List.iter (fun y -> 
                   let cellId = sprintf "cell-%d-%d" x y
                   let el = document.getElementById(cellId) :?> HTMLButtonElement
  -                el.addEventListener_click((fun _ -> 
  -                    let game = play game (x,y)
  -                    updateUi game; null))))
  +                el.addEventListener_click((fun _ -> play game (x,y); null))))
       
       match game with
       | Some (InProgress gs) -> 
  
positive.code:         | _                    -> game
  
      let private isValid conf =
          if conf.MaxNumberOfColors < 3 || conf.MaxNumberOfColors > 8 then
              false
          elif conf.NumberOfColumns < 3 || conf.NumberOfColumns > 15 then
              false
          elif conf.NumberOfRows < 3 || conf.NumberOfRows > 15 then
              false
          else
              true
  
      let private newGame gen config = 
          let createBoard gen config =
              List.init config.NumberOfColumns (fun _ -> List.init config.NumberOfRows (fun _ -> gen config.MaxNumberOfColors))
              |> fun board -> { Board = board; Score = 0 }
              |> evaluateGameState |> Some
          if config |> isValid then
              createBoard gen config
          else None
  
      let api = {
  
negative.code:     |> int
  
  let defaultConfig =  
      let rndColorGtor i = 
          let rnd = new System.Random()
          fun () -> rnd.Next(i) + 1 |> Color |> Stone 
  
      (document.getElementById("sg-board") :?> HTMLDivElement).className
      |> fun className -> className.Split('-') 
      |> Array.map strToInt
      |> fun arr -> { NumberOfColumns =  arr.[0]; NumberOfRows = arr.[1]; StoneGenerator = rndColorGtor arr.[2] }
  
  let buttonNewGame = document.getElementById("new-game") :?> HTMLButtonElement
  let selectGame = document.getElementById("sg-select-game") :?> HTMLSelectElement
  
  let newGameOnClick() =
      let game = api.NewGame defaultConfig
      selectGame.selectedIndex <- 0.0 
      updateUi game
  
  buttonNewGame.addEventListener_click((fun _ -> newGameOnClick(); null), false)
      
  let selectGameOnChange () =
      let presetGtor gameNum =
          let mutable index = 0;
          let game = PresetGames.games.[gameNum]
          (fun () -> index <- index + 1; game.[index-1] |> Color |> Stone)
  
      let gameNum = selectGame.value |> strToInt;
      if gameNum >= 0 then
          let game = api.NewGame { NumberOfColumns = 15; NumberOfRows = 15; StoneGenerator = presetGtor gameNum }
          updateUi game
  
  selectGame.addEventListener_change((fun _ -> selectGameOnChange(); null), false)
  
  api.NewGame defaultConfig |> updateUi 