Skip to content

Commit

Permalink
Needless move: fix hole jump
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipChalupa committed Feb 6, 2025
1 parent add97e2 commit c955ec8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/runEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ function* run(
}
} else if (instruction.type === 'jump') {
if (canStandAt(playerState.x + 1, playerState.y)) {
playerState.x++
if (!elementsAt(playerState.x + 1, playerState.y).includes('hole')) {
markAsNeedlessMove()
}
playerState.x++
yield step('jump')
} else {
markAsNeedlessMove()
Expand Down

0 comments on commit c955ec8

Please sign in to comment.