Mercurial > repos > icfp2014
diff code/grid.lm @ 77:41f16c010717
Merge
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Jul 2014 03:10:34 -0700 |
parents | 0eff4790249f |
children |
line wrap: on
line diff
--- a/code/grid.lm Mon Jul 28 02:57:56 2014 -0700 +++ b/code/grid.lm Mon Jul 28 03:10:34 2014 -0700 @@ -51,6 +51,14 @@ ((x >= 0) + (y >= 0) + (x < maxX) + (y < maxY)) > 0 } + grid:get:withDefault <- :grid pos default { + if: (grid: grid inBounds?: pos) { + grid: grid get: pos + } else: { + default + } + } + calcPos <- :move from { x <- from value y <- from tail