summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-21 11:05:18 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-21 11:05:18 +0100
commite0c8b76816c1b6432739a0f332b888cf779c7a68 (patch)
tree3f14e5b0c567dbf40110a1215343336c0e199063
parent8a7dc17b764e9f1fb79cc1243901608d309b4bab (diff)
downloadvotes-for-women-e0c8b76816c1b6432739a0f332b888cf779c7a68.tar.gz
work with single us state
-rw-r--r--rules.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 0b62940..b42ef19 100644
--- a/rules.js
+++ b/rules.js
@@ -1470,6 +1470,13 @@ function vm_operand(a) {
return x
}
+function vm_operand_us_states(x) {
+ let s = vm_operand(x)
+ if (typeof s === "number")
+ return [ s ]
+ return s
+}
+
function vm_exec() {
vm_inst(0)()
}
@@ -1648,7 +1655,7 @@ function vm_add_cubes_per_state_in_any_one_region() {
function vm_remove_cubes_limit() {
game.vm.count = vm_operand(1)
game.vm.cubes = vm_operand(2)
- game.vm.us_states = us_states_with_color_cubes(vm_operand(3), game.vm.cubes)
+ game.vm.us_states = us_states_with_color_cubes(vm_operand_us_states(3), game.vm.cubes)
game.vm.limit = vm_operand(4)
goto_vm_remove_cubes()
}
@@ -1656,7 +1663,7 @@ function vm_remove_cubes_limit() {
// Remove all :yellow_cube and :purple_cube from California. DONE
function vm_remove_all_cubes() {
game.vm.cubes = vm_operand(1)
- game.vm.us_states = us_states_with_color_cubes(vm_operand(2), game.vm.cubes)
+ game.vm.us_states = us_states_with_color_cubes(vm_operand_us_states(2), game.vm.cubes)
game.vm.all = true
goto_vm_remove_cubes()
}