From 6f6791e30ee96620956716a41831825e68b1054d Mon Sep 17 00:00:00 2001 From: Tibor Bizjak Date: Tue, 10 Sep 2019 18:48:06 +0200 Subject: [PATCH] Created initial chess template --- template.html | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 template.html diff --git a/template.html b/template.html new file mode 100644 index 0000000..265c820 --- /dev/null +++ b/template.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + % ranks = "87654321" + % ranks = ranks if game.turn=="white" else ranks[::-1] + % files = "abcdefgh" + % is_black = lambda x: (ord(x[0])-ord('a')) % 2 != int(x[1]) % 2 + % for i, rank in enumerate(ranks): + + + % for file in files: + % sq = file + rank + % color = 'bgcolor=silver' if is_black(sq) else "" + % widths = i==0, file=='h', i==7, file=='a' + % widths = "pt ".join(map(str, map(int, widths))) + "pt" + + % end + + % end + + + % for file in files: + + % end + + +
{{rank}}{{game.board[sq]}}
{{file}}
+
+% if not game.endofgame(): + + +% else: + +% end +
+ +