Refactor isSafePosition function to remove unused HOME_ENTRY_POSITIONS
This commit is contained in:
parent
7a55f6c376
commit
ed0b6cf589
@ -7,12 +7,11 @@ const PlayerSchema = require('./player');
|
||||
|
||||
// Safe/colored box positions in Ludo (where pawns cannot be killed)
|
||||
const SAFE_POSITIONS = [16, 29, 42, 55];
|
||||
const HOME_ENTRY_POSITIONS = [66, 27, 40, 53];
|
||||
// const HOME_ENTRY_POSITIONS = [66, 27, 40, 53];
|
||||
const STAR_POSITIONS = [63, 24, 37, 50];
|
||||
|
||||
const isSafePosition = (position) => {
|
||||
return SAFE_POSITIONS.includes(position)
|
||||
|| HOME_ENTRY_POSITIONS.includes(position)
|
||||
return SAFE_POSITIONS.includes(position)
|
||||
|| STAR_POSITIONS.includes(position)
|
||||
|| position > 66; // Also safe in home stretch
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user