summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-02 14:24:47 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-12-02 14:24:47 +0100
commitf9e4fc45f7cfce1652f05ff79a129b68b103f4b1 (patch)
treef0a98044e23de68cc7b1c534b60c0eac46d9d4e4
parent5659be721ef700394363344e8f12c9ae191ce0e4 (diff)
downloadvotes-for-women-f9e4fc45f7cfce1652f05ff79a129b68b103f4b1.tar.gz
fix final voting pluralization error
-rw-r--r--rules.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 4ad5cdf..6454ad8 100644
--- a/rules.js
+++ b/rules.js
@@ -1206,14 +1206,14 @@ function goto_final_voting() {
game.state = "final_voting_select_state"
}
+function us_states_to_win() {
+ return (game.active === SUF) ? GREEN_CHECK_VICTORY - count_green_checks() : RED_X_VICTORY - count_red_xs()
+}
+
states.final_voting_select_state = {
inactive: "do Final Voting.",
prompt() {
- view.prompt = "Final Voting: Select a state."
- if (game.active === SUF)
- view.prompt += ` You need ${GREEN_CHECK_VICTORY - count_green_checks()} more States for victory.`
- else
- view.prompt += ` You need ${RED_X_VICTORY - count_red_xs()} more States for victory.`
+ view.prompt = `Final Voting: Select a State. You need ${pluralize(us_states_to_win(), 'more State')} for victory.`
let us_states = ANYWHERE.slice()
set_filter(us_states, s => !(is_green_check(s) || is_red_x(s)))