chiark / gitweb /
wip with total checker etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Sep 2023 15:22:35 +0000 (16:22 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 Sep 2023 15:22:35 +0000 (16:22 +0100)
Makefile
fabricia.md
total-checker [new file with mode: 0755]

index 00cf5fc36846dfba9add5793a86bc35a982b2cbd..32b3f1abf43df3267f05c35dc37e14f822a15718 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,10 @@ SHELL=/bin/bash
 CHARACTERS=kennocht fabricia
 
 all:   $(addsuffix .pdf, $(CHARACTERS)) \
+       $(addprefix check-, $(CHARACTERS)) \
 
 %.pdf:         %.md Makefile
        pandoc -Vmargin-{top,left,right,bottom}=20mm -t latex -o .tmp.$@ $< && $i
+
+check-%:       %.md Makefile total-checker
+               ./total-checker <$<
index 02e2554ac9d58724e3374956121c69c4e582aba3..86218070749becd0fc1eb97f5ec1099cc729c305 100644 (file)
@@ -22,9 +22,10 @@ Age at story start: 17.
  * **Light Touch** (minor, general)
  * **Venus's Blessing**
  * **Improved Characteristics** x1
+ * **Wilderness Sense**
 
  * **Puissant Woodworking** (minor, general)
- * **Puissant Ironworking** (minor, general)
+// * **Puissant Ironworking** (minor, general)
  * **Puissant Leatherworking** (minor, general)
 
 # Flaws
@@ -65,29 +66,33 @@ Int         -1      -1
 Per            -1      -1
 
 Com            -3      -6
-```
 
-Total 10 (+7 plus +3 from Improved Characteristics)
+total          10      +7 plus +3 from Improved Characteristics)
+```
 
 # Abilities
 
 ## Early childhood
 
-Grew up in the neighbouring covenant.  Lots of running about and
+Grew up in a mountain outpost of an old (Winter) mountain covenant,
+the Covenant of the Icy North.
+The wizards were very ood and I had to do a lot of fending for myself.
+Lots of running about and
 climbing the old towers and exploring the mountains and forests
 outside the covenant including swimming in the nearby rivers.
 
 ```
-                                                                               XP
+                                                                                               XP
+
+German (Swiss/Austyrian) (spoken)              5               free
 
-German (Swiss) (spoken)                        5               free
+Survival (mountains)                                   2               15
+Athletics (climbing)                                   2               15
+Swim (small fast rivers)                               1               5
+Awareness (searching)                                  1               5
+Stealth (natural areas)                                        1               5
 
-Survival (mountains)                   2               15
-Athletics (climbing)                   1               5
-Charm                                                  1               5
-(XXXX name of place) lore              1               5
-Brawl (dodging)                                        1               5
-Swim (small fast rivers)               1               5
+total                                                                                  45
 ```
 
 ### Later childhood
@@ -95,20 +100,31 @@ Swim (small fast rivers)           1               5
 5-17 = 12 years = 180 XP
 
 ```
-                                                                               XP
+                                                                                               XP
 
-Craft - woodworking                            3               30
-Craft - ironworking                            3               30
-Craft - leatherworking                 3               30
-Craft - sewing                                 2               15
+Craft - improvisation                                  3               30
+Craft - woodworking                                            3               30
+XXX ^ is this sensible/allowed; what happens if I improvise with wood?
+
+Wilderness sense (resources)                   3               30
+Hunt (tracking)                                                        2               15
+Single weapon (knife/dagger)                   2               15
 
-Wilderness sense (resources)   3               30
-Hunt (cover tracks)                            2               15
-Single weapon (knife/dagger)   2               15
+Charm (speciality: wizards)                            1               5
+Faerie Lore (forests)                                  1               5
 
-Charm (speciality: wizards)            1 => 2  10
-Faerie Lore (forests)                  1               5
+total                                                                                  180
 ```
 
+Brawl (dodging)                                                        1               5
+
+
+? legerdemain
+? stealth
+? thrown weapon
+Craft - ironworking                            3               30
+Craft - sewing                                 2               15
+
+
 XXXX is there a Farie forest nearby ?  If so then that.
 XXXX am I allowed Wilderness Sense ?
diff --git a/total-checker b/total-checker
new file mode 100755 (executable)
index 0000000..9ddea75
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+open L, "expand -t4 |" or die $!;
+@l = <L>;
+$?=0; $!=0; close L or die "$? $!";
+
+my $block_start = 0;
+
+foreach my $i (0..$#l) {
+  $_ = $l[$i];
+  if (m{^\`\`\`}) {
+    if (defined $block_start) {
+      $block_start = undef;
+    } else {
+      $block_start = $i + 1;
+    }
+  }
+  if (defined($block_start) && m{^(total +)(\d+)\s}) {
+    my ($lhs, $exp) = ($1, $2);
+    my $got = 0;
+    foreach my $i ($block_start .. ($i-1)) {
+      $_ = $j[$_];
+      $earlier = len($lhs) - 1;
+      next unless length > $earlier+1;
+      die "$j: $_ ?" unless m{^.{$earlier} (\S+)\s};
+      my $here = $1;
+      next unless $here =~ m{^[-+]?\d+$};
+      $got += $here;
+    }
+    my $delta = $exp - $here;
+    if ($delta) {
+      print STDERR "line $i: expected $exp but got $got, delta $delta";
+    }
+  }
+}