Skip to content

Commit

Permalink
Performance improvement code added for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Aug 25, 2014
1 parent c16859a commit 01ba69a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dojo/Canopy2048/Interactions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ module Interactions =
| None -> false
| Some(_) -> true

let gameEnded =
let driver = lazy(Seq.head browsers)
let css = ".game-message.game-won, .game-message.game-over"
let selector = OpenQA.Selenium.By.CssSelector(css)
fun () ->
driver.Value.FindElements(selector).Count > 0

let state () =
elements ".tile"
|> List.map(fun tile ->
Expand Down
1 change: 1 addition & 0 deletions Dojo/Canopy2048/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ module program =
| Right -> press right
| Down -> press down
if lost() || won()
//if gameEnded()
then ignore()
else play (shuffle moves)

Expand Down

0 comments on commit 01ba69a

Please sign in to comment.