void moveCCW(int n) { for (int i = 0; i < n; i++) { current = current.prev; } }
void moveCW(int n) { for (int i = 0; i < n; i++) { current = current.next; } }
public Day09(string rawInput) { var asciiVals = rawInput.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); nPlayers = Int32.Parse(asciiVals[0]); lastMarble = Int32.Parse(asciiVals[6]); current = new CircNode(); }
void removeCurrent() { var cw = current.next; var ccw = current.prev; ccw.next = cw; cw.prev = ccw; current = cw; }
void insertToRight(int m) { var node = new CircNode(); var cw = current.next; var ccw = current; cw.prev = node; ccw.next = node; node.next = cw; node.prev = ccw; node.val = m; current = node; }
public CircNode() { prev = next = this; val = 0; }