diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-04-12 15:21:53 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-04-12 15:23:12 +0200 |
commit | a98d92ca3cf044eda7b2314d5c464f95db6ec0ab (patch) | |
tree | a49b359578856a10deae77cf563ae32dceeae1d2 | |
parent | dbad03467fce3103ae0e05b345434a61860a9db8 (diff) | |
download | vijayanagara-a98d92ca3cf044eda7b2314d5c464f95db6ec0ab.tar.gz |
Placed/Moved prefix in log. Repeat symbols instead of counts.
-rw-r--r-- | play.js | 11 | ||||
-rw-r--r-- | rules.js | 6 |
2 files changed, 14 insertions, 3 deletions
@@ -1416,6 +1416,14 @@ function sub_icon(match) { return ICONS[match] ?? match } +function sub_repeat(match, n, sym) { + var s = sym + n = parseInt(n) + while (--n > 0) + s += "\u2009" + sym + return s +} + function on_prompt(text) { return text.replaceAll("a Amir", "an Amir") } @@ -1436,6 +1444,8 @@ function on_log(text) { text = text.replace(/</g, "<") text = text.replace(/>/g, ">") + text = text.replace(/([1-5]) (DDS|DBK|DVE|CDS|CMI|EDS|EBK|EVE)/g, sub_repeat) + text = text.replace(/\bDDS\b/g, sub_icon) text = text.replace(/\bDBK\b/g, sub_icon) text = text.replace(/\bDVE\b/g, sub_icon) @@ -1450,6 +1460,7 @@ function on_log(text) { text = text.replace(/\bFMI\b/g, sub_icon) text = text.replace(/\bIBK\b/g, sub_icon) text = text.replace(/\bIVE\b/g, sub_icon) + text = text.replace(/\bCAV\b/g, sub_icon) text = text.replace(/\bRES\b/g, sub_icon) @@ -3985,13 +3985,13 @@ function placed_summary(type="") { function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) - log_summary("% " + piece_symbol(p) + " from S" + from) + log_summary("Moved % " + piece_symbol(p) + " from S" + from) else - log_summary("% " + piece_symbol(p)) + log_summary("Placed % " + piece_symbol(p)) } function log_summary_move_from(p) { - log_summary("% " + piece_symbol(p) + " from S" + piece_space(p)) + log_summary("Moved % " + piece_symbol(p) + " from S" + piece_space(p)) } function log_summary_remove(p) { |