Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 251x 251x 251x 251x 251x 251x 251x | export type Coordinate = { x: number; y: number };
export type Direction = "up" | "down" | "left" | "right";
class JsSnake {
public tail: Coordinate[];
public length: number;
public head: Coordinate;
public headDirection: Direction;
public dead: Boolean;
public idx: number;
// properties not needed for this class but present in the server response
public name: string;
constructor(head: Coordinate) {
this.tail = [];
this.length = 2;
this.head = head;
this.headDirection = "up";
this.dead = false;
this.idx = 0;
this.name = "Anonymous";
}
}
export default JsSnake |