chiark / gitweb /
penultima: loopify colours
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 8 Jun 2021 12:34:09 +0000 (13:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 8 Jun 2021 12:52:38 +0000 (13:52 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
specs/penultima.game.toml

index 0ad388ba9ce57af319e96b023cdd9a8864702154..1af325ce991dcf8cc42190a2c097a41fc7ba274a 100644 (file)
 {% endmacro fairy_pieces -%}
 
 {% macro one_colour(x, y, colour) %}
+{% set colour_items = "K Q R R B B N" |split(pat=" ") %}
+{% for item in colour_items %}
 [[pieces]]
-pos = [{{ x }}, {{ y }}]
-type = "LibList"
+pos = [{{ x + 10 * loop.index0 }}, {{ y }}]
+type = "Lib"
 lib = "wikimedia"
-prefix = "chess-{{colour}}-"
-items = ["K","Q","R","R","B","B","N","N"]
-posd = [10, 0]
+item = "chess-{{colour}}-{{item}}"
+{% endfor %}
 {% endmacro one_colour %}