Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created September 30, 2019 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/e3fe6dc94ae4d4025c5b25bc1fcf42cc to your computer and use it in GitHub Desktop.
Save IntegerMan/e3fe6dc94ae4d4025c5b25bc1fcf42cc to your computer and use it in GitHub Desktop.
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