Platoon card game single-player implementation in JavaScript