Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Longwater1234 committed Nov 30, 2024
1 parent 1e0fcab commit 715881a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions room/enemy_detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// hasExtraTargets returns TRUE if hunter's single Piece at `currCell` has EXTRA nearby targets to capture.
// This should be called only AFTER `handleCapture` by player `hunter` was successful
// This should be called only AFTER `handleCapture` by player `hunter` is TRUE
func hasExtraTargets(hunter *player.Player, currCell int32, gameMap map[int32]*game.Piece) bool {
piecePtr, exists := gameMap[currCell]
if !exists || !hunter.HasThisPiece(piecePtr.Id) {
Expand Down Expand Up @@ -39,7 +39,7 @@ func collectFrontLHS(p *player.Player, cellIdx int32, gameMap map[int32]*game.Pi
var deltaBehindEnemy int32 = 4

var hasEnemyAhead = false
var enemyOpenBehind = false // is there an EMPTY cell behind enemy?
var enemyOpenBehind = false // have EMPTY cell behind enemy?

if game.IsEvenCellRow(cellIdx) {
// do swap
Expand Down
2 changes: 1 addition & 1 deletion room/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func generateGameMap(p1 *player.Player, p2 *player.Player) map[int32]*game.Piece
var iterRed = 0 //red pieces iterator
var iterBlack = 0 //black pieces iterator

// create pieces, and position them on checkerboard (in reverse)
// create pieces, and position them on checkerboard (from top -> down)
for row := 0; row < numRows; row++ {
for col := 0; col < numCols; col++ {
if (row+col)%2 != 0 {
Expand Down

0 comments on commit 715881a

Please sign in to comment.