summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index ffda1b4..e46a1e5 100644
--- a/rules.js
+++ b/rules.js
@@ -631,6 +631,14 @@ function count_matching_spaces(f) {
return n
}
+function count_matching_pieces(f) {
+ let n = 0
+ for (let p = all_first_piece; p <= all_last_piece; ++p)
+ if (f(p, piece_space(p)))
+ ++n
+ return n
+}
+
function count_faction_pieces(s, faction) {
switch (faction) {
case GOVT: