From: Benjamin Auder Date: Sun, 3 Jan 2021 14:50:27 +0000 (+0100) Subject: Early draft of Paco-Sako + some fixes X-Git-Url: https://git.auder.net/?p=vchess.git;a=commitdiff_plain;h=173f11dc3119c842a58daa9d1e0afc67eeb0e4e8 Early draft of Paco-Sako + some fixes --- diff --git a/LICENSE b/LICENSE index 289bbb7d..921041d0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2018-2020 Benjamin Auder +Copyright 2018-2021 Benjamin Auder Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. diff --git a/client/public/images/pieces/Janggi/ba.svg b/client/public/images/pieces/Janggi/ba.svg new file mode 100644 index 00000000..3f76d5ab --- /dev/null +++ b/client/public/images/pieces/Janggi/ba.svg @@ -0,0 +1,323 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/bc.svg b/client/public/images/pieces/Janggi/bc.svg new file mode 100644 index 00000000..f6ef21df --- /dev/null +++ b/client/public/images/pieces/Janggi/bc.svg @@ -0,0 +1,385 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/be.svg b/client/public/images/pieces/Janggi/be.svg new file mode 100644 index 00000000..3b8262e3 --- /dev/null +++ b/client/public/images/pieces/Janggi/be.svg @@ -0,0 +1,298 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/bk.svg b/client/public/images/pieces/Janggi/bk.svg new file mode 100644 index 00000000..38cfda5a --- /dev/null +++ b/client/public/images/pieces/Janggi/bk.svg @@ -0,0 +1,347 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/bn.svg b/client/public/images/pieces/Janggi/bn.svg new file mode 100644 index 00000000..aac11aff --- /dev/null +++ b/client/public/images/pieces/Janggi/bn.svg @@ -0,0 +1,300 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/bp.svg b/client/public/images/pieces/Janggi/bp.svg new file mode 100644 index 00000000..a0dbd70b --- /dev/null +++ b/client/public/images/pieces/Janggi/bp.svg @@ -0,0 +1,293 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/br.svg b/client/public/images/pieces/Janggi/br.svg new file mode 100644 index 00000000..d85d30de --- /dev/null +++ b/client/public/images/pieces/Janggi/br.svg @@ -0,0 +1,378 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wa.svg b/client/public/images/pieces/Janggi/wa.svg new file mode 100644 index 00000000..cf28183e --- /dev/null +++ b/client/public/images/pieces/Janggi/wa.svg @@ -0,0 +1,323 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wc.svg b/client/public/images/pieces/Janggi/wc.svg new file mode 100644 index 00000000..4ea92045 --- /dev/null +++ b/client/public/images/pieces/Janggi/wc.svg @@ -0,0 +1,385 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/we.svg b/client/public/images/pieces/Janggi/we.svg new file mode 100644 index 00000000..6310a331 --- /dev/null +++ b/client/public/images/pieces/Janggi/we.svg @@ -0,0 +1,298 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wk.svg b/client/public/images/pieces/Janggi/wk.svg new file mode 100644 index 00000000..3ff67525 --- /dev/null +++ b/client/public/images/pieces/Janggi/wk.svg @@ -0,0 +1,347 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wn.svg b/client/public/images/pieces/Janggi/wn.svg new file mode 100644 index 00000000..210a0bff --- /dev/null +++ b/client/public/images/pieces/Janggi/wn.svg @@ -0,0 +1,300 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wp.svg b/client/public/images/pieces/Janggi/wp.svg new file mode 100644 index 00000000..9eaf41d9 --- /dev/null +++ b/client/public/images/pieces/Janggi/wp.svg @@ -0,0 +1,293 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Janggi/wr.svg b/client/public/images/pieces/Janggi/wr.svg new file mode 100644 index 00000000..bb7d5a97 --- /dev/null +++ b/client/public/images/pieces/Janggi/wr.svg @@ -0,0 +1,378 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Jiangqi/ba.svg b/client/public/images/pieces/Jiangqi/ba.svg deleted file mode 120000 index b727f3e8..00000000 --- a/client/public/images/pieces/Jiangqi/ba.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/ba.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/bc.svg b/client/public/images/pieces/Jiangqi/bc.svg deleted file mode 120000 index c7797929..00000000 --- a/client/public/images/pieces/Jiangqi/bc.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/bc.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/be.svg b/client/public/images/pieces/Jiangqi/be.svg deleted file mode 120000 index 65da9376..00000000 --- a/client/public/images/pieces/Jiangqi/be.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/be.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/bk.svg b/client/public/images/pieces/Jiangqi/bk.svg deleted file mode 120000 index d88bff5a..00000000 --- a/client/public/images/pieces/Jiangqi/bk.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/bk.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/bn.svg b/client/public/images/pieces/Jiangqi/bn.svg deleted file mode 120000 index 31d112e0..00000000 --- a/client/public/images/pieces/Jiangqi/bn.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/bn.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/bp.svg b/client/public/images/pieces/Jiangqi/bp.svg deleted file mode 120000 index 6cb84a94..00000000 --- a/client/public/images/pieces/Jiangqi/bp.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/bp.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/br.svg b/client/public/images/pieces/Jiangqi/br.svg deleted file mode 120000 index d7ce7a3c..00000000 --- a/client/public/images/pieces/Jiangqi/br.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/br.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wa.svg b/client/public/images/pieces/Jiangqi/wa.svg deleted file mode 120000 index fcf50d06..00000000 --- a/client/public/images/pieces/Jiangqi/wa.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wa.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wc.svg b/client/public/images/pieces/Jiangqi/wc.svg deleted file mode 120000 index d1634561..00000000 --- a/client/public/images/pieces/Jiangqi/wc.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wc.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/we.svg b/client/public/images/pieces/Jiangqi/we.svg deleted file mode 120000 index ecaa730a..00000000 --- a/client/public/images/pieces/Jiangqi/we.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/we.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wk.svg b/client/public/images/pieces/Jiangqi/wk.svg deleted file mode 120000 index ef1cfacb..00000000 --- a/client/public/images/pieces/Jiangqi/wk.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wk.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wn.svg b/client/public/images/pieces/Jiangqi/wn.svg deleted file mode 120000 index 9cef643a..00000000 --- a/client/public/images/pieces/Jiangqi/wn.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wn.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wp.svg b/client/public/images/pieces/Jiangqi/wp.svg deleted file mode 120000 index c9d9dfcb..00000000 --- a/client/public/images/pieces/Jiangqi/wp.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wp.svg \ No newline at end of file diff --git a/client/public/images/pieces/Jiangqi/wr.svg b/client/public/images/pieces/Jiangqi/wr.svg deleted file mode 120000 index db0b4e16..00000000 --- a/client/public/images/pieces/Jiangqi/wr.svg +++ /dev/null @@ -1 +0,0 @@ -../Xiangqi/wr.svg \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bb.png b/client/public/images/pieces/Pacosako/bb.png new file mode 120000 index 00000000..6dfdf95a --- /dev/null +++ b/client/public/images/pieces/Pacosako/bb.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/bb.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bc.png b/client/public/images/pieces/Pacosako/bc.png new file mode 100644 index 00000000..34736e72 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bc.png @@ -0,0 +1 @@ +#$# git-fat c923a195b03eae0366704e353688c55e7b173bfc 2706 diff --git a/client/public/images/pieces/Pacosako/bd.png b/client/public/images/pieces/Pacosako/bd.png new file mode 100644 index 00000000..29dcf350 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bd.png @@ -0,0 +1 @@ +#$# git-fat 72c532657b236e21574789a38b1b9a63a318839d 3821 diff --git a/client/public/images/pieces/Pacosako/be.png b/client/public/images/pieces/Pacosako/be.png new file mode 100644 index 00000000..4d63aef3 --- /dev/null +++ b/client/public/images/pieces/Pacosako/be.png @@ -0,0 +1 @@ +#$# git-fat aeeb5993fa87747c1a0a922d253504344be3f683 3988 diff --git a/client/public/images/pieces/Pacosako/bf.png b/client/public/images/pieces/Pacosako/bf.png new file mode 100644 index 00000000..08b6c07a --- /dev/null +++ b/client/public/images/pieces/Pacosako/bf.png @@ -0,0 +1 @@ +#$# git-fat 502509595db9fa2e00dcc7c6845705caf3f3a27c 5346 diff --git a/client/public/images/pieces/Pacosako/bg.png b/client/public/images/pieces/Pacosako/bg.png new file mode 100644 index 00000000..91e0064b --- /dev/null +++ b/client/public/images/pieces/Pacosako/bg.png @@ -0,0 +1 @@ +#$# git-fat b200cec67c9b9b7d425874d13abafdaf4b67c16f 4419 diff --git a/client/public/images/pieces/Pacosako/bi.png b/client/public/images/pieces/Pacosako/bi.png new file mode 100644 index 00000000..4378c338 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bi.png @@ -0,0 +1 @@ +#$# git-fat b00ea11fd8dd3edd9d48341029d136d158249dc1 3780 diff --git a/client/public/images/pieces/Pacosako/bj.png b/client/public/images/pieces/Pacosako/bj.png new file mode 100644 index 00000000..a5049697 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bj.png @@ -0,0 +1 @@ +#$# git-fat 78be9912866d7b30f07ef561920301c47868ec00 4041 diff --git a/client/public/images/pieces/Pacosako/bk.png b/client/public/images/pieces/Pacosako/bk.png new file mode 120000 index 00000000..5779820a --- /dev/null +++ b/client/public/images/pieces/Pacosako/bk.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/bk.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bl.png b/client/public/images/pieces/Pacosako/bl.png new file mode 100644 index 00000000..8b884cc7 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bl.png @@ -0,0 +1 @@ +#$# git-fat 01d6e9e99c69717b3640f6e305b288bf382c35a2 5272 diff --git a/client/public/images/pieces/Pacosako/bm.png b/client/public/images/pieces/Pacosako/bm.png new file mode 100644 index 00000000..1ef39621 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bm.png @@ -0,0 +1 @@ +#$# git-fat 5b4f1c0f178dbb1e32e57b3d5cd317b5d2e9700a 4370 diff --git a/client/public/images/pieces/Pacosako/bn.png b/client/public/images/pieces/Pacosako/bn.png new file mode 120000 index 00000000..45d65470 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bn.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/bn.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bp.png b/client/public/images/pieces/Pacosako/bp.png new file mode 120000 index 00000000..9fa31726 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bp.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/bp.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bq.png b/client/public/images/pieces/Pacosako/bq.png new file mode 120000 index 00000000..ca064fd4 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bq.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/bq.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/br.png b/client/public/images/pieces/Pacosako/br.png new file mode 120000 index 00000000..cad7b691 --- /dev/null +++ b/client/public/images/pieces/Pacosako/br.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/br.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/bs.png b/client/public/images/pieces/Pacosako/bs.png new file mode 100644 index 00000000..74ee3878 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bs.png @@ -0,0 +1 @@ +#$# git-fat 1241f4fccd0e97f7a13c598a64f9a04b703d887c 4928 diff --git a/client/public/images/pieces/Pacosako/bt.png b/client/public/images/pieces/Pacosako/bt.png new file mode 100644 index 00000000..5bd34c61 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bt.png @@ -0,0 +1 @@ +#$# git-fat 776889a3271feec32ae8d592b61c9e76411474f3 6163 diff --git a/client/public/images/pieces/Pacosako/bu.png b/client/public/images/pieces/Pacosako/bu.png new file mode 100644 index 00000000..ebc3b74f --- /dev/null +++ b/client/public/images/pieces/Pacosako/bu.png @@ -0,0 +1 @@ +#$# git-fat 201155639a4aed6884cb0a3afef6fb05ab3878a4 5282 diff --git a/client/public/images/pieces/Pacosako/bw.png b/client/public/images/pieces/Pacosako/bw.png new file mode 100644 index 00000000..b97ead79 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bw.png @@ -0,0 +1 @@ +#$# git-fat c094793364191f90de072c3c5f6d1940a2faf983 5947 diff --git a/client/public/images/pieces/Pacosako/bx.png b/client/public/images/pieces/Pacosako/bx.png new file mode 100644 index 00000000..adc245bb --- /dev/null +++ b/client/public/images/pieces/Pacosako/bx.png @@ -0,0 +1 @@ +#$# git-fat eaaf16b85d88183f46455217fd23e0f3b4ee670a 5082 diff --git a/client/public/images/pieces/Pacosako/bz.png b/client/public/images/pieces/Pacosako/bz.png new file mode 100644 index 00000000..28aadd88 --- /dev/null +++ b/client/public/images/pieces/Pacosako/bz.png @@ -0,0 +1 @@ +#$# git-fat e2a7e4afc31c18369198b0d6133a57f702dc6a47 6347 diff --git a/client/public/images/pieces/Pacosako/script.sh b/client/public/images/pieces/Pacosako/script.sh new file mode 100644 index 00000000..9eeae02f --- /dev/null +++ b/client/public/images/pieces/Pacosako/script.sh @@ -0,0 +1,15 @@ +color=w +for piece in p r n b q k; do + convert "$color""$piece".png -crop 100x128+0+0 "$color""$piece"_.png +done +color=b +for piece in p r n b q k; do + convert "$color""$piece".png -crop 100x128+28+0 "$color""$piece"_.png +done +for p1 in p r n b q k; do + for p2 in p r n b q k; do + convert +append w"$p1"_.png b"$p2"_.png out_"$p1""$p2".png + convert out_"$p1""$p2".png -resize 128x128\! res_"$p1""$p2".png + done +done +# Finally: manual renaming + cleaning (TODO) diff --git a/client/public/images/pieces/Pacosako/wa.png b/client/public/images/pieces/Pacosako/wa.png new file mode 100644 index 00000000..d44021cd --- /dev/null +++ b/client/public/images/pieces/Pacosako/wa.png @@ -0,0 +1 @@ +#$# git-fat 2423a8d5213d6a4d7a08024e254badf49138aa99 2978 diff --git a/client/public/images/pieces/Pacosako/wb.png b/client/public/images/pieces/Pacosako/wb.png new file mode 120000 index 00000000..36a1712c --- /dev/null +++ b/client/public/images/pieces/Pacosako/wb.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wb.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/wc.png b/client/public/images/pieces/Pacosako/wc.png new file mode 100644 index 00000000..cbf938ab --- /dev/null +++ b/client/public/images/pieces/Pacosako/wc.png @@ -0,0 +1 @@ +#$# git-fat ee755a61be3d7abcc28413a37a3089ac7b3db5a1 3100 diff --git a/client/public/images/pieces/Pacosako/wd.png b/client/public/images/pieces/Pacosako/wd.png new file mode 100644 index 00000000..dfe0a5f9 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wd.png @@ -0,0 +1 @@ +#$# git-fat e890701ec4dd383538910b06d905929ed5ed5a1b 4021 diff --git a/client/public/images/pieces/Pacosako/we.png b/client/public/images/pieces/Pacosako/we.png new file mode 100644 index 00000000..3df66e54 --- /dev/null +++ b/client/public/images/pieces/Pacosako/we.png @@ -0,0 +1 @@ +#$# git-fat a2877ac3b0998751ebbee82ec80282354933739a 3843 diff --git a/client/public/images/pieces/Pacosako/wf.png b/client/public/images/pieces/Pacosako/wf.png new file mode 100644 index 00000000..b9930cac --- /dev/null +++ b/client/public/images/pieces/Pacosako/wf.png @@ -0,0 +1 @@ +#$# git-fat c6e18be2909c53b77a824ddd6621a6bf4abd3cf8 5102 diff --git a/client/public/images/pieces/Pacosako/wg.png b/client/public/images/pieces/Pacosako/wg.png new file mode 100644 index 00000000..83086f18 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wg.png @@ -0,0 +1 @@ +#$# git-fat 4fe66b51820d1fef4b6135c6a2b9452652474c1b 5525 diff --git a/client/public/images/pieces/Pacosako/wh.png b/client/public/images/pieces/Pacosako/wh.png new file mode 100644 index 00000000..6a7cf3fa --- /dev/null +++ b/client/public/images/pieces/Pacosako/wh.png @@ -0,0 +1 @@ +#$# git-fat 16dfe13622026fde53c952688fec72df696d0421 2505 diff --git a/client/public/images/pieces/Pacosako/wi.png b/client/public/images/pieces/Pacosako/wi.png new file mode 100644 index 00000000..97719534 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wi.png @@ -0,0 +1 @@ +#$# git-fat 85a2f36e164d1c2f8e358aab694958d65405bb80 3672 diff --git a/client/public/images/pieces/Pacosako/wj.png b/client/public/images/pieces/Pacosako/wj.png new file mode 100644 index 00000000..48f2e021 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wj.png @@ -0,0 +1 @@ +#$# git-fat 5eaa7044a752bb84aacacaa99b41c8735cc219cd 3394 diff --git a/client/public/images/pieces/Pacosako/wk.png b/client/public/images/pieces/Pacosako/wk.png new file mode 120000 index 00000000..acf54001 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wk.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wk.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/wl.png b/client/public/images/pieces/Pacosako/wl.png new file mode 100644 index 00000000..1d9db579 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wl.png @@ -0,0 +1 @@ +#$# git-fat 73c7b55f1c966502d35a4f308134bef0b1fd9fa1 4703 diff --git a/client/public/images/pieces/Pacosako/wm.png b/client/public/images/pieces/Pacosako/wm.png new file mode 100644 index 00000000..dc84be86 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wm.png @@ -0,0 +1 @@ +#$# git-fat 15b404753feef33f1f9b55da91910c3bcd5953da 5106 diff --git a/client/public/images/pieces/Pacosako/wn.png b/client/public/images/pieces/Pacosako/wn.png new file mode 120000 index 00000000..4508036e --- /dev/null +++ b/client/public/images/pieces/Pacosako/wn.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wn.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/wo.png b/client/public/images/pieces/Pacosako/wo.png new file mode 100644 index 00000000..d2479af1 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wo.png @@ -0,0 +1 @@ +#$# git-fat 5cd9e241fe740203cd499968d5d3123f1d099815 4642 diff --git a/client/public/images/pieces/Pacosako/wp.png b/client/public/images/pieces/Pacosako/wp.png new file mode 120000 index 00000000..b1c56708 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wp.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wp.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/wq.png b/client/public/images/pieces/Pacosako/wq.png new file mode 120000 index 00000000..536649a9 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wq.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wq.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/wr.png b/client/public/images/pieces/Pacosako/wr.png new file mode 120000 index 00000000..fb36f29e --- /dev/null +++ b/client/public/images/pieces/Pacosako/wr.png @@ -0,0 +1 @@ +../Eightpieces/tmp_png/wr.png \ No newline at end of file diff --git a/client/public/images/pieces/Pacosako/ws.png b/client/public/images/pieces/Pacosako/ws.png new file mode 100644 index 00000000..631520c8 --- /dev/null +++ b/client/public/images/pieces/Pacosako/ws.png @@ -0,0 +1 @@ +#$# git-fat d125fdf6de53ae77f27fa02ff29be604c3e73af3 4483 diff --git a/client/public/images/pieces/Pacosako/wt.png b/client/public/images/pieces/Pacosako/wt.png new file mode 100644 index 00000000..1edf3d14 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wt.png @@ -0,0 +1 @@ +#$# git-fat f4e2e81266970fb388d700e1ba5e34c58fd6a875 5680 diff --git a/client/public/images/pieces/Pacosako/wu.png b/client/public/images/pieces/Pacosako/wu.png new file mode 100644 index 00000000..cf980a38 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wu.png @@ -0,0 +1 @@ +#$# git-fat e11742eb2d5c4e79a0c44f61fb4c8701f3006872 6037 diff --git a/client/public/images/pieces/Pacosako/wv.png b/client/public/images/pieces/Pacosako/wv.png new file mode 100644 index 00000000..6165b802 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wv.png @@ -0,0 +1 @@ +#$# git-fat 6b192baf3110f21fdf9c2aa403138d3d299cb5a6 4478 diff --git a/client/public/images/pieces/Pacosako/ww.png b/client/public/images/pieces/Pacosako/ww.png new file mode 100644 index 00000000..b51e97f5 --- /dev/null +++ b/client/public/images/pieces/Pacosako/ww.png @@ -0,0 +1 @@ +#$# git-fat bb1d8c496f6bddd6a80c1951658ab148877bf634 5889 diff --git a/client/public/images/pieces/Pacosako/wx.png b/client/public/images/pieces/Pacosako/wx.png new file mode 100644 index 00000000..651d49c9 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wx.png @@ -0,0 +1 @@ +#$# git-fat 997ff8534319e10b3728181ac5fce6fdb888650a 6417 diff --git a/client/public/images/pieces/Pacosako/wy.png b/client/public/images/pieces/Pacosako/wy.png new file mode 100644 index 00000000..934a7176 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wy.png @@ -0,0 +1 @@ +#$# git-fat b186625508f31d769f1abbe1b386ed7f8af91e8f 6811 diff --git a/client/public/images/pieces/Pacosako/wz.png b/client/public/images/pieces/Pacosako/wz.png new file mode 100644 index 00000000..bfe616d3 --- /dev/null +++ b/client/public/images/pieces/Pacosako/wz.png @@ -0,0 +1 @@ +#$# git-fat 1a0d3feeba3ad51a78558a861b6466af8cb7c80f 7666 diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 293e933d..e91a43e8 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -112,7 +112,7 @@ export const ChessRules = class ChessRules { return false; } - // Some games are drawn unusually (bottomr right corner is black) + // Some games are drawn unusually (bottom right corner is black) static get DarkBottomRight() { return false; } @@ -197,7 +197,7 @@ export const ChessRules = class ChessRules { if (V.PIECES.includes(row[i].toLowerCase())) sumElts++; else { const num = parseInt(row[i], 10); - if (isNaN(num)) return false; + if (isNaN(num) || num <= 0) return false; sumElts += num; } } @@ -653,14 +653,14 @@ export const ChessRules = class ChessRules { // MOVES GENERATION // All possible moves from selected square - getPotentialMovesFrom([x, y]) { - switch (this.getPiece(x, y)) { - case V.PAWN: return this.getPotentialPawnMoves([x, y]); - case V.ROOK: return this.getPotentialRookMoves([x, y]); - case V.KNIGHT: return this.getPotentialKnightMoves([x, y]); - case V.BISHOP: return this.getPotentialBishopMoves([x, y]); - case V.QUEEN: return this.getPotentialQueenMoves([x, y]); - case V.KING: return this.getPotentialKingMoves([x, y]); + getPotentialMovesFrom(sq) { + switch (this.getPiece(sq[0], sq[1])) { + case V.PAWN: return this.getPotentialPawnMoves(sq); + case V.ROOK: return this.getPotentialRookMoves(sq); + case V.KNIGHT: return this.getPotentialKnightMoves(sq); + case V.BISHOP: return this.getPotentialBishopMoves(sq); + case V.QUEEN: return this.getPotentialQueenMoves(sq); + case V.KING: return this.getPotentialKingMoves(sq); } return []; //never reached } @@ -675,8 +675,8 @@ export const ChessRules = class ChessRules { new PiPo({ x: ex, y: ey, - c: tr ? tr.c : initColor, - p: tr ? tr.p : initPiece + c: !!tr ? tr.c : initColor, + p: !!tr ? tr.p : initPiece }) ], vanish: [ diff --git a/client/src/components/Board.vue b/client/src/components/Board.vue index d45f33b8..b8d0fadd 100644 --- a/client/src/components/Board.vue +++ b/client/src/components/Board.vue @@ -425,7 +425,7 @@ export default { attrs: { src: "/images/pieces/" + - // orientation: extra arg useful for some variants: + // orientation: extra arg useful for some variants this.vr.getPPpath(m, this.orientation) + V.IMAGE_EXTENSION }, diff --git a/client/src/translations/en.js b/client/src/translations/en.js index c01b09ae..be4811e5 100644 --- a/client/src/translations/en.js +++ b/client/src/translations/en.js @@ -189,6 +189,7 @@ export const translations = { "Chinese Chess": "Chinese Chess", "Convert & support (v1)": "Convert & support (v1)", "Convert & support (v2)": "Convert & support (v2)", + "Dance with the King": "Dance with the King", "Dangerous captures": "Dangerous captures", "Dangerous collisions": "Dangerous collisions", "Double moves (v1)": "Double moves (v1)", diff --git a/client/src/translations/es.js b/client/src/translations/es.js index 629c6c00..017f45c0 100644 --- a/client/src/translations/es.js +++ b/client/src/translations/es.js @@ -189,6 +189,7 @@ export const translations = { "Chinese Chess": "Ajedrez chino", "Convert & support (v1)": "Convertir & apoyar (v1)", "Convert & support (v2)": "Convertir & apoyar (v2)", + "Dance with the King": "Baila con el Rey", "Dangerous captures": "Capturas peligrosas", "Dangerous collisions": "Colisiones peligrosas", "Double moves (v1)": "Jugadas doble (v1)", diff --git a/client/src/translations/faq/en.pug b/client/src/translations/faq/en.pug index e1479337..0f914b71 100644 --- a/client/src/translations/faq/en.pug +++ b/client/src/translations/faq/en.pug @@ -133,7 +133,7 @@ If your opponent also quits the game after playing, then the time is just frozen - and you can decide to continue it later. | The rational behind this is that you don't know what the opponent played, - | so your clock shouldn't be running. Ans it also allows to take a break in + | so your clock shouldn't be running. And it also allows to take a break in | long live games, like maybe 1h30 + 30s. .question. diff --git a/client/src/translations/fr.js b/client/src/translations/fr.js index 1d18d17c..6b1f25c6 100644 --- a/client/src/translations/fr.js +++ b/client/src/translations/fr.js @@ -189,6 +189,7 @@ export const translations = { "Chinese Chess": "Échecs chinois", "Convert & support (v1)": "Convertir & soutenir (v1)", "Convert & support (v2)": "Convertir & soutenir (v2)", + "Dance with the King": "Dansez avec le Roi", "Dangerous captures": "Captures dangeureuses", "Dangerous collisions": "Collisions dangeureuses", "Double moves (v1)": "Coups doubles (v1)", diff --git a/client/src/translations/rules/Checkered1/en.pug b/client/src/translations/rules/Checkered1/en.pug index 4103caa3..8ea482cc 100644 --- a/client/src/translations/rules/Checkered1/en.pug +++ b/client/src/translations/rules/Checkered1/en.pug @@ -66,7 +66,7 @@ p. white is unable to "give back the turn". Without the black bishop on a7 it would be mate (without debate), because the king could virtually go to g1 before being captured by the - pawn-chamaleon. + chameleon pawn. figure.diagram-container .diagram diff --git a/client/src/translations/rules/Pacosako/en.pug b/client/src/translations/rules/Pacosako/en.pug new file mode 100644 index 00000000..6fe1bc10 --- /dev/null +++ b/client/src/translations/rules/Pacosako/en.pug @@ -0,0 +1,13 @@ +p.boxed TODO + +p WARNING 1: totally buggish right now. + +p WARNING 2: this variant may in the end not be playable here at all - will depend on the author decision. + +p + a(href="https://www.youtube.com/watch?v=tQ2JLsFvfxI") Video + |  showing gameplay. See also + a(href="http://pacosako.com/") the main website + | , and the associated + a(href="http://pacoplay.com/") playing area + | . diff --git a/client/src/translations/rules/Pacosako/es.pug b/client/src/translations/rules/Pacosako/es.pug new file mode 100644 index 00000000..6fe1bc10 --- /dev/null +++ b/client/src/translations/rules/Pacosako/es.pug @@ -0,0 +1,13 @@ +p.boxed TODO + +p WARNING 1: totally buggish right now. + +p WARNING 2: this variant may in the end not be playable here at all - will depend on the author decision. + +p + a(href="https://www.youtube.com/watch?v=tQ2JLsFvfxI") Video + |  showing gameplay. See also + a(href="http://pacosako.com/") the main website + | , and the associated + a(href="http://pacoplay.com/") playing area + | . diff --git a/client/src/translations/rules/Pacosako/fr.pug b/client/src/translations/rules/Pacosako/fr.pug new file mode 100644 index 00000000..6fe1bc10 --- /dev/null +++ b/client/src/translations/rules/Pacosako/fr.pug @@ -0,0 +1,13 @@ +p.boxed TODO + +p WARNING 1: totally buggish right now. + +p WARNING 2: this variant may in the end not be playable here at all - will depend on the author decision. + +p + a(href="https://www.youtube.com/watch?v=tQ2JLsFvfxI") Video + |  showing gameplay. See also + a(href="http://pacosako.com/") the main website + | , and the associated + a(href="http://pacoplay.com/") playing area + | . diff --git a/client/src/translations/variants/en.pug b/client/src/translations/variants/en.pug index 99fd2c12..9c68b678 100644 --- a/client/src/translations/variants/en.pug +++ b/client/src/translations/variants/en.pug @@ -400,6 +400,7 @@ p. "Gridolina", "Hamilton", "Magnetic", + "Pacosako", "Parachute", "Takenmake", "Titan", diff --git a/client/src/variants/Janggi.js b/client/src/variants/Janggi.js index e22a7869..27342422 100644 --- a/client/src/variants/Janggi.js +++ b/client/src/variants/Janggi.js @@ -52,7 +52,7 @@ export class JanggiRules extends ChessRules { } getPpath(b) { - return "Jiangqi/" + b; + return "Janggi/" + b; } static get size() { diff --git a/client/src/variants/Pacosako.js b/client/src/variants/Pacosako.js new file mode 100644 index 00000000..430cfb0a --- /dev/null +++ b/client/src/variants/Pacosako.js @@ -0,0 +1,336 @@ +import { ChessRules, PiPo, Move } from "@/base_rules"; +import { randInt } from "@/utils/alea"; + +export class PacosakoRules extends ChessRules { + + static get IMAGE_EXTENSION() { + return ".png"; + } + + // Unions (left = white if upperCase, black otherwise) + static get UNIONS() { + return { + a: ['p', 'p'], + c: ['p', 'r'], + d: ['p', 'n'], + e: ['p', 'b'], + f: ['p', 'q'], + g: ['p', 'k'], + h: ['r', 'r'], + i: ['r', 'n'], + j: ['r', 'b'], + l: ['r', 'q'], + m: ['r', 'k'], + o: ['n', 'n'], + s: ['n', 'b'], + t: ['n', 'q'], + u: ['n', 'k'], + v: ['b', 'b'], + w: ['b', 'q'], + x: ['b', 'k'], + y: ['q', 'q'], + z: ['q', 'k'] + }; + } + + static IsGoodPosition(position) { + if (position.length == 0) return false; + const rows = position.split("/"); + if (rows.length != V.size.x) return false; + let kingSymb = ['k', 'g', 'm', 'u', 'x']; + let kings = { 'k': 0, 'K': 0 }; + for (let row of rows) { + let sumElts = 0; + for (let i = 0; i < row.length; i++) { + const lowR = row[i].toLowerCase + if (!!(row[i].toLowerCase().match(/[a-z]/))) { + sumElts++; + if (kingSymb.includes(row[i])) kings['k']++; + else if (kingSymb.some(s => row[i] == s.toUpperCase())) kings['K']++; + } + else { + const num = parseInt(row[i], 10); + if (isNaN(num) || num <= 0) return false; + sumElts += num; + } + } + if (sumElts != V.size.y) return false; + } + // Both kings should be on board. Exactly one per color. + if (Object.values(kings).some(v => v != 1)) return false; + return true; + } + + getPpath(b) { + return "Pacosako/" + b; + } + + getPPath(m) { + if (ChessRules.PIECES.includes(m.appear[0].p)) return super.getPPpath(m); + // For an union, show only relevant piece: + // The color must be deduced from the move: reaching final rank of who? + const color = (m.appear[0].x == 0 ? 'b' : 'w'); + const up = this.getUnionPieces(color, m.appear[0].p); + return color + up[color]; + } + + canTake([x1, y1], [x2, y2]) { + const c1 = this.getColor(x1, y1); + const c2 = this.getColor(x2, y2); + return (c1 != 'u' && c2 != c1); + } + + canIplay(side, [x, y]) { + return this.turn == side && this.getColor(x, y) != V.GetOppCol(side); + } + + scanKings(fen) { + this.kingPos = { w: [-1, -1], b: [-1, -1] }; + const fenRows = V.ParseFen(fen).position.split("/"); + const startRow = { 'w': V.size.x - 1, 'b': 0 }; + const kingSymb = ['k', 'g', 'm', 'u', 'x']; + for (let i = 0; i < fenRows.length; i++) { + let k = 0; + for (let j = 0; j < fenRows[i].length; j++) { + const c = fenRows[i].charAt(j); + if (kingSymb.includes(c)) + this.kingPos["b"] = [i, k]; + else if (kingSymb.some(s => c == s.toUpperCase())) + this.kingPos["w"] = [i, k]; + else { + const num = parseInt(fenRows[i].charAt(j), 10); + if (!isNaN(num)) k += num - 1; + } + k++; + } + } + } + + setOtherVariables(fen) { + super.setOtherVariables(fen); + // Stack of "last move" only for intermediate chaining + this.lastMoveEnd = [null]; + } + + getColor(i, j) { + const p = this.board[i][j].charAt(1); + if (ChessRules.PIECES.includes(p)) return super.getColor(i, j); + return 'u'; //union + } + + getPiece(i, j, color) { + const p = this.board[i][j].charAt(1); + +console.log(p); + + if (ChessRules.PIECES.includes(p)) return p; + const c = this.board[i][j].charAt(0); + // NOTE: this.turn == HACK, but should work... + color = color || this.turn; + return V.UNIONS[p][c == color ? 0 : 1]; + } + + getUnionPieces(color, code) { + const pieces = V.UNIONS[code]; + return { + w: pieces[color == 'w' ? 0 : 1], + b: pieces[color == 'b' ? 0 : 1] + }; + } + + getUnionCode(p1, p2) { + let uIdx = ( + Object.values(V.UNIONS).findIndex(v => v[0] == p1 && v[1] == p2) + ); + const c = (uIdx >= 0 ? 'w' : 'b'); + if (uIdx == -1) { + uIdx = ( + Object.values(V.UNIONS).findIndex(v => v[0] == p2 && v[1] == p1) + ); + } + return { c: c, p: Object.keys(V.UNIONS)[uIdx] }; + } + + getBasicMove([sx, sy], [ex, ey], tr) { + const initColor = this.board[sx][sy].charAt(0); + const initPiece = this.board[sx][sy].charAt(1); + // 4 cases : moving + // - union to free square (other cases are illegal: return null) + // - normal piece to free square, + // to enemy normal piece, or + // to union (releasing our piece) + let mv = new Move({ + vanish: [ + new PiPo({ + x: sx, + y: sy, + c: initColor, + p: initPiece + }) + ], + end: { x: ex, y: ey } + }); + // Treat free square cases first: + if (this.board[ex][ey] == V.EMPTY) { + mv.appear = [ + new PiPo({ + x: ex, + y: ey, + c: initColor, + p: !!tr ? tr.p : initPiece + }) + ]; + return mv; + } + // Now the two cases with union / release: + const destColor = this.board[ex][ey].charAt(0); + const destPiece = this.board[ex][ey].charAt(1); + mv.vanish.push( + new PiPo({ + x: ex, + y: ey, + c: destColor, + p: destPiece + }) + ); + if (ChessRules.PIECES.includes(destPiece)) { + // Normal piece: just create union + const cp = this.getUnionCode(!!tr ? tr.p : initPiece, destPiece); + mv.appear = [ + new PiPo({ + x: ex, + y: ey, + c: cp.c, + p: cp.p + }) + ]; + return mv; + } + // Releasing a piece in an union: keep track of released piece + const up = this.getUnionPieces(destColor, destPiece); + const c = this.turn; + const oppCol = V.GetOppCol(c); + const cp = this.getUnionCode(!!tr ? tr.p : initPiece, up[oppCol]) + mv.appear = [ + new PiPo({ + x: ex, + y: ey, + c: cp.c, + p: cp.p + }) + ]; + mv.released = up[c]; + return mv; + } + + getPotentialMoves([x, y]) { + const L = this.lastMoveEnd.length; + const lm = this.lastMoveEnd[L-1]; + let piece = null; + if (!!lm) { + if (x != lm.x || y != lm.y) return []; + piece = lm.p; + } + if (!!piece) { + var unionOnBoard = this.board[x][y]; + this.board[x][y] = this.turn + piece; + } + let baseMoves = []; + switch (piece || this.getPiece(x, y)) { + case V.PAWN: + baseMoves = this.getPotentialPawnMoves([x, y]); + break; + case V.ROOK: + baseMoves = this.getPotentialRookMoves([x, y]); + break; + case V.KNIGHT: + baseMoves = this.getPotentialKnightMoves([x, y]); + break; + case V.BISHOP: + baseMoves = this.getPotentialBishopMoves([x, y]); + break; + case V.QUEEN: + baseMoves = this.getPotentialQueenMoves([x, y]); + break; + case V.KING: + baseMoves = this.getPotentialKingMoves([x, y]); + break; + } + // When a pawn in an union reaches final rank with a non-standard + // promotion move: apply promotion anyway + let moves = []; + baseMoves.forEach(m => { + // (move to first rank, which is last rank for opponent [pawn]), should show promotion choices. + //if (m. //bring enemy pawn to his first rank ==> union types involved... color... + moves.push(m); //TODO + }); + if (!!piece) this.board[x][y] = unionOnBoard; + return moves; + } + + play(move) { + this.epSquares.push(this.getEpSquare(move)); + // Check if the move is the last of the turn: all cases except releases + move.last = ( + move.vanish.length == 1 || + ChessRules.PIECES.includes(move.vanish[1].p) + ); + if (move.last) { + // No more union releases available + this.turn = V.GetOppCol(this.turn); + this.movesCount++; + this.lastMoveEnd.push(null); + } + else { + const color = this.board[move.end.x][move.end.y].charAt(0); + const oldUnion = this.board[move.end.x][move.end.y].charAt(1); + const released = this.getUnionPieces(color, oldUnion)[this.turn]; + this.lastMoveEnd.push(Object.assign({}, move.end, { p: released })); + } + V.PlayOnBoard(this.board, move); + } + + undo(move) { + this.epSquares.pop(); + V.UndoOnBoard(this.board, move); + this.lastMoveEnd.pop(); + if (move.last) { + this.turn = V.GetOppCol(this.turn); + this.movesCount--; + } + } + + getCurrentScore() { + // Check kings: if one is dancing, the side lost + const [kpW, kpB] = [this.kingPos['w'], this.kingPos['b']]; + if (this.board[kpB[0]][kpB[1]].charAt(1) != 'k') return "1-0"; + if (this.board[kpW[0]][kpW[1]].charAt(1) != 'k') return "0-1"; + return "*"; + } + + getComputerMove() { + let moves = this.getAllValidMoves(); + if (moves.length == 0) return null; + // Just play random moves (for now at least. TODO?) + let mvArray = []; + while (moves.length > 0) { + const mv = moves[randInt(moves.length)]; + mvArray.push(mv); + this.play(mv); + if (!mv.last) + // A piece was just released from an union + moves = this.getPotentialMovesFrom([mv.end.x, mv.end.y]); + else break; + } + for (let i = mvArray.length - 1; i >= 0; i--) this.undo(mvArray[i]); + return (mvArray.length > 1 ? mvArray : mvArray[0]); + } + + // NOTE: evalPosition() is wrong, but unused since bot plays at random + + getNotation(move) { + // TODO: in case of enemy pawn promoted, add "=..." in the end + return super.getNotation(move); + } + +}; diff --git a/server/db/populate.sql b/server/db/populate.sql index ce6fd393..7f4a7a3d 100644 --- a/server/db/populate.sql +++ b/server/db/populate.sql @@ -88,6 +88,7 @@ insert or ignore into Variants (name, description) values ('Ordamirror', 'Mongolian Horde (v2)'), ('Pacifist1', 'Convert & support (v1)'), ('Pacifist2', 'Convert & support (v2)'), + ('Pacosako', 'Dance with the King'), ('Parachute', 'Landing on the board'), ('Pawnmassacre', 'Pieces upside down'), ('Pawns', 'Reach the last rank (v1)'),