-
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.
added giraffe power and implemented secret and secretsecret powers
- Loading branch information
1 parent
a9ab9f1
commit 8a459a7
Showing
6 changed files
with
2,593 additions
and
2,324 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,95 @@ | ||
import piece, basePieces, moves, board | ||
|
||
const diagnalMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfFree(board, p.tile, shooterFactory(1,1)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(-1,1)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(1,-1)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(-1,-1)) | ||
|
||
const diagnalTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1,1)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1,1)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1,-1)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1,-1)) | ||
|
||
const leftRightMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfFree(board, p.tile, tileLeft) | ||
discard result.addIfFree(board, p.tile, tileRight) | ||
|
||
const leftRightTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, tileLeft) | ||
discard result.addIfTake(board, p, p.tile, tileRight) | ||
|
||
const whiteForwardMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfFree(board, p.tile, tileAbove) | ||
|
||
const blackForwardMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfFree(board, p.tile, tileBelow) | ||
|
||
const whiteForwardTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, tileAbove) | ||
|
||
const blackForwardTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, tileBelow) | ||
|
||
const whiteForwardTwiceTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
let next = result.addIfTake(board, p, p.tile, tileAbove) | ||
if next: | ||
discard result.addIfTake(board, p, p.tile.tileAbove(), tileAbove) | ||
|
||
const blackForwardTwiceTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
let next = result.addIfTake(board, p, p.tile, tileBelow) | ||
if next: | ||
discard result.addIfTake(board, p, p.tile.tileBelow(), tileBelow) | ||
|
||
const whiteForwardTwiceMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
let next = result.addIfFree(board, p.tile, tileAbove) | ||
if next: | ||
discard result.addIfFree(board, p.tile.tileAbove(), tileAbove) | ||
|
||
const blackForwardTwiceMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
let next = result.addIfFree(board, p.tile, tileBelow) | ||
if next: | ||
discard result.addIfFree(board, p.tile.tileBelow(), tileBelow) | ||
|
||
|
||
|
||
const cannibalRookTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
result.add(lineTakes(board, p, tileAbove, cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, tileBelow, cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, tileLeft, cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, tileRight, cannibalismFlag = true)) | ||
|
||
const cannibalBishopTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
result.add(lineTakes(board, p, shooterFactory(1, 1), cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, shooterFactory(-1, 1), cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, shooterFactory(1, -1), cannibalismFlag = true)) | ||
result.add(lineTakes(board, p, shooterFactory(-1, -1), cannibalismFlag = true)) | ||
|
||
const cannibalKingTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
for i in -1..1: | ||
for j in -1..1: | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(i,j), cannibalismFlag = true) | ||
|
||
const cannibalKnightTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1, 2), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1, 2), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(2, 1), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(2, -1), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1, -2), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1, -2), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-2, 1), cannibalismFlag = true) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-2, -1), cannibalismFlag = true) | ||
|
||
|
||
const giraffeTakes*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1,4)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1,4)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(1,-4)) | ||
discard result.addIfTake(board, p, p.tile, shooterFactory(-1,-4)) | ||
|
||
const giraffeMoves*: MoveProc = func (board: ChessBoard, p: Piece): Moves = | ||
discard result.addIfFree(board, p.tile, shooterFactory(1,4)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(-1,4)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(1,-4)) | ||
discard result.addIfFree(board, p.tile, shooterFactory(-1,-4)) |
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
Oops, something went wrong.