startTurnBasedGame.js
startTurnBasedGame(5, 3, 4);
function startTurnBasedGame(num_players, num_rounds, turn_time, init_player=1, init_round=1) {
let [elapsed_time, player_round, round, actual_player] = [0, 0, init_round, init_player-1];
const getPlayer = () => actual_player === num_players ? num_players : actual_player % num_players;
const printTimeInfo = remaining_time => console.log(
`Next turn in: ${remaining_time}s`, `Player: ${getPlayer()}`, `Round: ${round}/${num_rounds}`
);
This file has been truncated. show original