Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created October 6, 2019 03:19
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/876b37892a7e62d0e47dc385c11d9e54 to your computer and use it in GitHub Desktop.
Save IntegerMan/876b37892a7e62d0e47dc385c11d9e54 to your computer and use it in GitHub Desktop.
module MattEland.FSharpGeneticAlgorithm.Logic.Simulator
open MattEland.FSharpGeneticAlgorithm.Logic.WorldPos
open MattEland.FSharpGeneticAlgorithm.Logic.World
open MattEland.FSharpGeneticAlgorithm.Logic.Actors
type GameState = { World : World; Player : Actor }
let isValidPos pos (world: World): bool =
pos.X >= 1 && pos.Y >= 1 && pos.X <= world.MaxX && pos.Y <= world.MaxY
let hasObstacle pos (world: World) : bool =
world.Actors
|> Seq.exists(fun actor -> pos = actor.Pos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment