struct

AoC2022::Day9::Point

Inherits Struct < Value < Object

Constants

TRAIL_VECTORS = { {-2, -2} => {-1, -1}, {-2, -1} => {-1, -1}, {-2, 0} => {-1, 0}, {-2, 1} => {-1, 1}, {-2, 2} => {-1, 1}, {-1, -2} => {-1, -1}, {-1, -1} => {0, 0}, {-1, 0} => {0, 0}, {-1, 1} => {0, 0}, {-1, 2} => {-1, 1}, {0, -2} => {0, -1}, {0, -1} => {0, 0}, {0, 0} => {0, 0}, {0, 1} => {0, 0}, {0, 2} => {0, 1}, {1, -2} => {1, -1}, {1, -1} => {0, 0}, {1, 0} => {0, 0}, {1, 1} => {0, 0}, {1, 2} => {1, 1}, {2, -2} => {1, -1}, {2, -1} => {1, -1}, {2, 0} => {1, 0}, {2, 1} => {1, 1}, {2, 2} => {1, 1}}

Constructors

new(x : Int32, y : Int32)
Source

Instance methods

move(dir : Char) : Point
Source
trail(other : Point) : Point
Source
x=(x : Int32)
Source
y=(y : Int32)
Source