summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-america
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-30 16:21:23 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-10-30 16:21:23 +0100
commitdfae8ae26dfbc859fd4c49d32cfa380ea260f2bc (patch)
tree5296c44e08b0ef4f50a752c0b514f9641152078b /scripts/gen-america
parent613c9c22f839452aae7cf64ae641b668451ec412 (diff)
Update lots of shit
Diffstat (limited to 'scripts/gen-america')
-rwxr-xr-xscripts/gen-america42
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/gen-america b/scripts/gen-america
new file mode 100755
index 0000000..bc7bd95
--- /dev/null
+++ b/scripts/gen-america
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+gawk '
+@include "scripts/getcls.awk"
+
+function getsup(i, s)
+{
+ switch (i) {
+ case 1:
+ s = "D"
+ break
+ case 2:
+ s = "P"
+ break
+ case 3:
+ s = "S"
+ break
+ case 4:
+ s = "W"
+ break
+ }
+
+ return "@sup{-" s "}"
+}
+
+BEGIN {
+ FS = "\t"
+}
+
+{
+ printf "trX { td .missing colspan=\"2\" {-%s}", $3
+ split($2, a, / /)
+ for (i = 1; i <= length(a); i++)
+ printf "td .%s colspan=\"1\" {-%s %s}", getcls(a[i]), $1, getsup(i)
+ print "}"
+}
+
+END {
+ print "__MARKER__"
+}
+' data/world/$1.us \
+| scripts/last-of-design.sed