Created
October 6, 2019 03:16
-
-
Save IntegerMan/2f29e6935a9a97c3c0f49c21758f8ea9 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
module MattEland.FSharpGeneticAlgorithm.Logic.WorldPos | |
type WorldPos = {X: int32; Y:int32} | |
let newPos x y = {X = x; Y = y} | |
let isAdjacentTo (posA: WorldPos) (posB: WorldPos): bool = | |
let xDiff = abs (posA.X - posB.X) | |
let yDiff = abs (posA.Y - posB.Y) | |
let result = xDiff <= 1 && yDiff <= 1 | |
result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment