From: Benjamin Auder Date: Thu, 22 Nov 2018 11:05:59 +0000 (+0100) Subject: Draft Alice variant, prepare some images X-Git-Url: https://git.auder.net/doc/html/vendor/img/current/config.php?a=commitdiff_plain;h=0cd8f2bdfe04a0bd880ee48ef2dcce24728536ee;p=vchess.git Draft Alice variant, prepare some images --- diff --git a/TODO b/TODO index 5ad48808..4c567402 100644 --- a/TODO +++ b/TODO @@ -1 +1,3 @@ For animation, moves should contains "moving" and "fading" maybe... +Depth 2 or 3 depending on variant and if we detect smartphone or not? +(static get SEARCH_DEPTH() { return 2; }) diff --git a/public/images/pieces/Alice/bc.svg b/public/images/pieces/Alice/bc.svg new file mode 100644 index 00000000..cf2df27a --- /dev/null +++ b/public/images/pieces/Alice/bc.svg @@ -0,0 +1,92 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/bl.svg b/public/images/pieces/Alice/bl.svg new file mode 100644 index 00000000..4680d888 --- /dev/null +++ b/public/images/pieces/Alice/bl.svg @@ -0,0 +1,98 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/bo.svg b/public/images/pieces/Alice/bo.svg new file mode 100644 index 00000000..b8c0a462 --- /dev/null +++ b/public/images/pieces/Alice/bo.svg @@ -0,0 +1,98 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/bs.svg b/public/images/pieces/Alice/bs.svg new file mode 100644 index 00000000..abe7c2ed --- /dev/null +++ b/public/images/pieces/Alice/bs.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/images/pieces/Alice/bt.svg b/public/images/pieces/Alice/bt.svg new file mode 100644 index 00000000..faf44577 --- /dev/null +++ b/public/images/pieces/Alice/bt.svg @@ -0,0 +1,80 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/bu.svg b/public/images/pieces/Alice/bu.svg new file mode 100644 index 00000000..fdc0ee59 --- /dev/null +++ b/public/images/pieces/Alice/bu.svg @@ -0,0 +1,92 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/wc.svg b/public/images/pieces/Alice/wc.svg new file mode 100644 index 00000000..fd766a8b --- /dev/null +++ b/public/images/pieces/Alice/wc.svg @@ -0,0 +1,97 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/wl.svg b/public/images/pieces/Alice/wl.svg new file mode 100644 index 00000000..89ad619d --- /dev/null +++ b/public/images/pieces/Alice/wl.svg @@ -0,0 +1,97 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/wo.svg b/public/images/pieces/Alice/wo.svg new file mode 100644 index 00000000..83f0c4b9 --- /dev/null +++ b/public/images/pieces/Alice/wo.svg @@ -0,0 +1,63 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/public/images/pieces/Alice/ws.svg b/public/images/pieces/Alice/ws.svg new file mode 100644 index 00000000..df257304 --- /dev/null +++ b/public/images/pieces/Alice/ws.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/images/pieces/Alice/wt.svg b/public/images/pieces/Alice/wt.svg new file mode 100644 index 00000000..5cbb7337 --- /dev/null +++ b/public/images/pieces/Alice/wt.svg @@ -0,0 +1,145 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Alice/wu.svg b/public/images/pieces/Alice/wu.svg new file mode 100644 index 00000000..bf9f16ad --- /dev/null +++ b/public/images/pieces/Alice/wu.svg @@ -0,0 +1,97 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Grand/bc.svg b/public/images/pieces/Grand/bc.svg new file mode 100644 index 00000000..afc27f05 --- /dev/null +++ b/public/images/pieces/Grand/bc.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Grand/wc.svg b/public/images/pieces/Grand/wc.svg new file mode 100644 index 00000000..b45ea509 --- /dev/null +++ b/public/images/pieces/Grand/wc.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/Grand/wm.svg b/public/images/pieces/Grand/wm.svg new file mode 100644 index 00000000..fd0288db --- /dev/null +++ b/public/images/pieces/Grand/wm.svg @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/pieces/LICENSE b/public/images/pieces/LICENSE index 9d98b4aa..26cb11c2 100644 --- a/public/images/pieces/LICENSE +++ b/public/images/pieces/LICENSE @@ -1,5 +1,4 @@ -SVG images found on chesstempo website: - +SVG standard images found on chesstempo website: https://www4.chesstempo.com/images/pieces/svg/merida/whitepawn.vers1.svg (...) - + Adaptation for checkered pieces +Some fairy pieces found on the web and icon scout: https://iconscout.com/ diff --git a/public/images/pieces/Wildebeest/bc.svg b/public/images/pieces/Wildebeest/bc.svg new file mode 100644 index 00000000..a67f271b --- /dev/null +++ b/public/images/pieces/Wildebeest/bc.svg @@ -0,0 +1,27 @@ + + + + 20 -Camel- (Solid) + Created with Sketch. + + + + + + + + + + + + + + + + + Smashicons . + + + + + diff --git a/public/images/pieces/Wildebeest/bw.svg b/public/images/pieces/Wildebeest/bw.svg new file mode 100644 index 00000000..21a3c9a2 --- /dev/null +++ b/public/images/pieces/Wildebeest/bw.svg @@ -0,0 +1 @@ +Madeby Grids \ No newline at end of file diff --git a/public/images/pieces/Wildebeest/wc.svg b/public/images/pieces/Wildebeest/wc.svg new file mode 100644 index 00000000..bc2b0301 --- /dev/null +++ b/public/images/pieces/Wildebeest/wc.svg @@ -0,0 +1,37 @@ + + + + 20 -Camel- (Outline) + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + Smashicons . + + + + + diff --git a/public/images/pieces/Wildebeest/ww.svg b/public/images/pieces/Wildebeest/ww.svg new file mode 100644 index 00000000..54020bfa --- /dev/null +++ b/public/images/pieces/Wildebeest/ww.svg @@ -0,0 +1 @@ +Madeby Grids \ No newline at end of file diff --git a/public/javascripts/variants/Alice.js b/public/javascripts/variants/Alice.js index cc7a4644..db0881e2 100644 --- a/public/javascripts/variants/Alice.js +++ b/public/javascripts/variants/Alice.js @@ -1,12 +1,86 @@ class AliceRules extends ChessRUles { - getPpath(b) + // TODO: more general double correspondance normal <--> alice + static get ALICE_PIECES() { - return ""; //TODO + return ['s','t','u','c','o','l']; //king is 'l' } - // Idee : this.board assigné tour à tour à board1, board2 - // board1 initialisé plein, board2 vide (via fen: s,t,u,o,c) - // coups cherchés suivant règles normales sur l'un puis l'autre - // puis au final filtre. + static getPpath(b) + { + return (this.ALICE_PIECES.includes(b[1]) ? "Alice/" : "") + b; + } + + getPotentialMovesFrom([x,y]) + { + // Build board1+board2 from complete board + let board1 = doubleArray(sizeX, sizeY, ""); + let board2 = doubleArray(sizeX, sizeY, ""); + const [sizeX,sizeY] = variantRules.size; + for (let i=0; i