-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add src temporary, structure notes, and standard moves
- Loading branch information
1 parent
369e3a6
commit fd79741
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Design and Structure | ||
|
||
Rough draft to get the overall ideas out. | ||
|
||
Board | ||
- makeGrid | ||
- fillGrid | ||
- fillCards | ||
- movePiece | ||
- validMove | ||
- isEmpty | ||
- possibleMoves | ||
- currentCards | ||
|
||
Piece | ||
- color | ||
- currentPosition | ||
- moveToStone(master) | ||
- moveToStream(master) | ||
|
||
Player | ||
- color | ||
- makeMove | ||
|
||
Game | ||
- swapTurn | ||
- swapMoveCards | ||
- play (until winStone || winStream) | ||
- quitEarly | ||
- dealCardsAgain (board?) | ||
|
||
Possible? | ||
- selectedCard | ||
- selectedPawn | ||
- studentPawn | ||
- masterPawn | ||
- shrineTile | ||
|
||
View | ||
- tileColor | ||
- shrineTile | ||
- cardFlip | ||
- cardMove | ||
- pawnMove | ||
- captureMaster | ||
- captureStudent |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class Board { | ||
constructor() { | ||
this.grid = Board.makeGrid(); | ||
} | ||
|
||
isEmpty(pos) { | ||
|
||
} | ||
|
||
// movePiece() ? | ||
|
||
|
||
|
||
makeGrid() { | ||
let grid = []; | ||
for (let i = 0; i < 5; i++) { | ||
grid.push([]); | ||
for (let j = 0; j < 5; j++) { | ||
grid[i].push(null); | ||
} | ||
} | ||
return grid; | ||
} | ||
|
||
makeMoveCards() { | ||
|
||
} | ||
} | ||
|
||
module.exports = Board; | ||
|
||
|
||
|
||
|
||
// makeGrid as static method? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#static_methods_and_properties |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Grid 5x5 | ||
|
||
// Card Deck | ||
// let pos = [row, col]; | ||
|
||
let tiger = [[-1, 0], [2, 0]]; // tiger | ||
let dragon = [[-1, 1], [-1, -1], [1, 2], [1, -2]]; // dragon | ||
let frog = [[1, -1], [0, -2], [-1, 1]]; // frog | ||
let rabbit = [[-1, -1], [1, 1], [0, 2]]; // rabbit | ||
let crab = [[0, -2], [1, 0], [0, 2]]; // crab | ||
let elephant = [[0, -1], [1, -1], [0, 1], [1, 1]]; // elephant | ||
let goose = [[0, -1], [1, -1], [0, 1], [-1, 1]]; // goose | ||
let rooster = [[0, -1], [-1, -1], [0, 1], [1, 1]]; // rooster | ||
let monkey = [[1, -1], [-1, -1], [-1, 1], [1, 1]]; // monkey | ||
let mantis = [[1, -1], [1, 1], [-1, 0]]; // mantis | ||
let horse = [[0, -1], [-1, 0], [1, 0]]; // horse | ||
let ox = [[0, 1], [-1, 0], [1, 0]]; // ox | ||
let crane = [[1, 0], [-1, -1], [-1, 1]]; // crane | ||
let boar = [[1, 0], [0, -1], [0, 1]]; // boar | ||
let eel = [[1, -1], [-1, -1], [0, 1]]; // eel | ||
let cobra = [[0, -1], [1, 1], [-1, 1]]; // cobra | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
document.addEventListener("DOMContentLoaded", () => { | ||
|
||
|
||
|
||
}) | ||
|
Empty 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// maybe necessary? |