Skip to content

Commit b8117af

Browse files
committed
✨ basic UltimateBoard
1 parent e8a420b commit b8117af

File tree

1 file changed

+4
-0
lines changed
  • src/main/scala/com/truelaurel/math/geometry

1 file changed

+4
-0
lines changed

src/main/scala/com/truelaurel/math/geometry/Pos.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ case class Pos(x: Int, y: Int) {
1111

1212
def +(pos: Pos): Pos = Pos(x + pos.x, y + pos.y)
1313

14+
def /(r: Int): Pos = Pos(x / r, y / r)
15+
16+
def %(r: Int): Pos = Pos(x % r, y % r)
17+
1418
def neighborIn(direction: Direction): Pos = direction match {
1519
case N => Pos(x, y - 1)
1620
case S => Pos(x, y + 1)

0 commit comments

Comments
 (0)