Skip to content

Instantly share code, notes, and snippets.

Created Sep 30, 2019
What would you like to do?
open System
open MattEland.FSharpGeneticAlgorithm.Logic.World
open MattEland.FSharpGeneticAlgorithm.ConsoleTestApp.Display
let generateWorld randomizer =
new World(8, 8, randomizer)
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()
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