summaryrefslogtreecommitdiffhomepage
path: root/scripts/gen-scoin
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen-scoin')
-rwxr-xr-xscripts/gen-scoin48
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/gen-scoin b/scripts/gen-scoin
new file mode 100755
index 0000000..e7e7982
--- /dev/null
+++ b/scripts/gen-scoin
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+gawk -v CC=$1 '
+@include "scripts/getcls.awk"
+
+BEGIN {
+ CC = toupper(CC)
+}
+
+$1 == CC && /.. start/ {
+ sub(/^.. start/, "");
+ sub(/^ /, "")
+ printf "tr .new-design {th colspan=\"8\" {-%s}}\n", $0
+ next
+}
+
+$1 == CC {
+ y = $10
+ if ($11 != "") {
+ y_ = $11
+ for (i = 12; i <= NF; i++)
+ y_ = y_ " " $i
+ }
+ printf "trX {"
+ for (i = 2; i <= 9; i++) {
+ # Greece 2002 needs special handling
+ if (CC == "GR" && $10 == 2002 && $11 == "MM") {
+ if (i <= 5)
+ y_ = "F"
+ else if (i <= 7)
+ y_ = "E"
+ else
+ y_ = "S"
+ }
+
+ if ($11 != "")
+ printf "td .%s {-%s @sup{-%s}}", getcls($i), y, y_
+ else
+ printf "td .%s {-%s}", getcls($i), y
+ }
+ print "}"
+}
+
+END {
+ print "__MARKER__"
+}
+' data/coins \
+| scripts/last-of-design.sed