Skip to content

Instantly share code, notes, and snippets.

@Tommy228
Created May 18, 2018 13:06
Show Gist options
  • Save Tommy228/414b52dbe3edbec58be192a2979807ef to your computer and use it in GitHub Desktop.
Save Tommy228/414b52dbe3edbec58be192a2979807ef to your computer and use it in GitHub Desktop.
Example maze file
interface Cell {
N?: boolean;
S?: boolean;
E?: boolean;
W?: boolean;
}
class Maze {
public grid: Cell[][];
public w: number;
public h: number;
public constructor(w: number, h: number) {
this.w = w;
this.h = h;
}
private initializeGrid(): void {
const cellExample: Cell = {
N: true,
S: true
};
for (let i = 0; i < this.w; i++) {
for (let j = 0; j < this.h; j++) {
this.grid[i][j] = cellExample;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment