From 49bad3c011dfe5e26178923d24418538b363a499 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Sat, 13 Jan 2024 17:45:58 -0600 Subject: [PATCH] add note --- src/swarm-engine/Swarm/Game/Location.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/swarm-engine/Swarm/Game/Location.hs b/src/swarm-engine/Swarm/Game/Location.hs index 961944b83..d9456788b 100644 --- a/src/swarm-engine/Swarm/Game/Location.hs +++ b/src/swarm-engine/Swarm/Game/Location.hs @@ -214,6 +214,8 @@ euclidean p1 p2 = norm (fromIntegral <$> (p2 .-. p1)) -- [P (V2 0 0), P (V2 0 1), P (V2 0 (-1)), P (V2 1 0), P (V2 1 1), P (V2 1 (-1))] -- >>> map (\i -> length (getLocsInArea origin i)) [0..8] -- [1,5,13,25,41,61,85,113,145] +-- +-- See also @Swarm.Game.Step.Const.genDiamondSides@. getLocsInArea :: Location -> Int32 -> [Location] getLocsInArea loc r = [loc .+^ V2 dx dy | x <- [0 .. r], y <- [0 .. r - x], dx <- nub [x, -x], dy <- nub [y, -y]]