Created
May 18, 2018 13:06
-
-
Save Tommy228/414b52dbe3edbec58be192a2979807ef to your computer and use it in GitHub Desktop.
Example maze file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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