Refactor isSafePosition function to remove unused HOME_ENTRY_POSITIONS

This commit is contained in:
Bangara Raju Kottedi 2026-01-30 13:21:37 +05:30
parent 7a55f6c376
commit ed0b6cf589

View File

@ -7,12 +7,11 @@ const PlayerSchema = require('./player');
// Safe/colored box positions in Ludo (where pawns cannot be killed) // Safe/colored box positions in Ludo (where pawns cannot be killed)
const SAFE_POSITIONS = [16, 29, 42, 55]; 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 STAR_POSITIONS = [63, 24, 37, 50];
const isSafePosition = (position) => { const isSafePosition = (position) => {
return SAFE_POSITIONS.includes(position) return SAFE_POSITIONS.includes(position)
|| HOME_ENTRY_POSITIONS.includes(position)
|| STAR_POSITIONS.includes(position) || STAR_POSITIONS.includes(position)
|| position > 66; // Also safe in home stretch || position > 66; // Also safe in home stretch
}; };