Created
September 30, 2019 00:28
-
-
Save IntegerMan/e3fe6dc94ae4d4025c5b25bc1fcf42cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open MattEland.FSharpGeneticAlgorithm.Logic.World | |
open MattEland.FSharpGeneticAlgorithm.ConsoleTestApp.Display | |
let generateWorld randomizer = | |
new World(8, 8, randomizer) | |
[<EntryPoint>] | |
let main argv = | |
printfn "F# Console Application Tutorial by Matt Eland" | |
let randomizer = new Random() | |
let mutable simulating: bool = true | |
let mutable world = generateWorld(randomizer) | |
while simulating do | |
displayWorld world | |
let key = getUserInput() | |
Console.Clear() | |
match key.Key with | |
| ConsoleKey.X -> simulating <- false | |
| ConsoleKey.R -> world <- generateWorld(randomizer) | |
| _ -> printfn "Invalid input '%c'" key.KeyChar | |
0 // return an integer exit code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment