anchor.diff:  
   let api = SameGameDomain.api
   
  -let play game (x,y) =
  -    match game with
  -    | Some g -> 
  -        Some (api.Play g { Col = x; Row = y })
  -    | _  -> None
  -
  -// val renderBoard : board:Board -> string
  +// val renderBoardToHtmlString : board:Board -> string
   let renderBoardToHtmlString (board:Board) =
       let renderCell x y col = sprintf "<td class='sg-td'><a href='javaScript:void(0);' id='cell-%d-%d'><div class='sg-cell sg-color%d'></div></a></td>" x y col
   
  
positive.code:         scoreElement.innerText <- sprintf "No more moves. Your final score is %i point(s)." gs.Score
      | _ -> boardElement.innerText <- "Sorry, an error occurred while rendering the board."
  
  let rnd = new System.Random()
  let colorGtor i = rnd.Next(i) + 1 |> Color |> Stone 
  
  // no fable support for System.Int32.Parse
  let strToInt (str:string) =
      [for c in str -> c] 
  
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 