Merge branch 'mi-g-master'

This commit is contained in:
Timo Ley 2020-07-18 16:39:46 +02:00
commit beb3e37348
10 changed files with 92 additions and 93 deletions

View File

@ -9,13 +9,13 @@ Demos
[Controlled interface](https://mi-g.github.io/jocly/examples/browser/control.html) for playing Chess.
Click _**Other Jocly games**_ to switch to other games.
Simple human vs computer: [Classic chess](https://mi-g.github.com/jocly/examples/browser/simple.html?classic-chess),
[Circular chess](https://mi-g.github.com/jocly/examples/browser/simple.html?circular-chess),
[Multi layers chess](https://mi-g.github.com/jocly/examples/browser/simple.html?raumschach),
[Hexagonal chess](https://mi-g.github.com/jocly/examples/browser/simple.html?glinski-chess),
[Chinese chess](https://mi-g.github.com/jocly/examples/browser/simple.html?xiangqi),
[Middle-age chess](https://mi-g.github.com/jocly/examples/browser/simple.html?courier-chess),
[Scrum](https://mi-g.github.com/jocly/examples/browser/simple.html?scrum)
Simple human vs computer: [Classic chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=classic-chess),
[Circular chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=circular-chess),
[Multi layers chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=raumschach),
[Hexagonal chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=glinski-chess),
[Chinese chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=xiangqi),
[Middle-age chess](https://mi-g.github.com/jocly/examples/browser/simple.html?game=courier-chess),
[Scrum](https://mi-g.github.com/jocly/examples/browser/simple.html?game=scrum)
Or see and try [all available games](https://mi-g.github.com/jocly/examples/browser/multiple.html)
@ -62,7 +62,7 @@ Building
Notes:
- using `gulp build watch` instead of `gulp build` makes *gulp* start watching files after the build. Whenever a file is changed, a build is automatically generated
- you can use `--no-default-games` to prevent including the game modules from directory, and `--modules <colon-separated-directories>` to specify additional game modules to include. For instance, `gulp --no-default-games --modules src/games/chessbase:src/games/checkers build` will only generate distribution for Chess and checkers games
- you can specify the games to be built in the distribution with the `--games` option. For instance, `gulp --no-default-games --modules src/games --games xiangqi:classic-chess build` only generates Jocly for Classic Chess and XiangQi
- you can specify the games to be built in the distribution with the `--games` option. For instance, `gulp --no-default-games --modules src/games/chessbase --games xiangqi:classic-chess build` only generates Jocly for Classic Chess and XiangQi
- using the `no-obsolete` option filters out the games marked as obsolete
API Documentation

View File

@ -144,9 +144,9 @@
return [0];
else if(piece.t==3)
return [2];
else if(piece.t==0 && geometry.R(move.t)==7)
else if(piece.t==0 && (move.t in promo[1]))
return [4,5,6,7];
else if(piece.t==2 && geometry.R(move.t)==0)
else if(piece.t==2 && (move.t in promo[-1]))
return [4,5,6,7];
return [];
},

View File

@ -110,7 +110,7 @@
castle: {
"0/3": {k:[1,2],r:[2,1],n:"O-O"},
"28/31": {k:[30,29],r:[29,30],n:"O-O"},
"28/31": {k:[29,30],r:[30,29],n:"O-O"},
},
evaluate: function(aGame,evalValues,material) {

View File

@ -148,9 +148,9 @@
return [0];
else if(piece.t==3)
return [2];
else if(piece.t==0 && geometry.R(move.t)==7)
else if(piece.t==0 && (move.t in promo[1]))
return [4,5,6,7];
else if(piece.t==2 && geometry.R(move.t)==0)
else if(piece.t==2 && (move.t in promo[-1]))
return [4,5,6,7];
return [];
},

View File

@ -8,11 +8,11 @@
5:'a4',16:'b4',26:'c4',37:'d4',47:'e4',58:'f4',69:'g4',81:'h4',92:'i4',104:'k4',115:'l4',
6:'a5',17:'b5',27:'c5',38:'d5',48:'e5',59:'f5',70:'g5',82:'h5',93:'i5',105:'k5',116:'l5',
7:'a6',18:'b6',28:'c6',39:'d6',49:'e6',60:'f6',71:'g6',83:'h6',94:'i6',106:'k6',117:'l6',
19:'b7',29:'c7',40:'d7',50:'e7',61:'f7',72:'g7',84:'h7',95:'i7',107:'k7',
30:'c8',41:'d8',51:'e8',62:'f8',73:'g8',85:'h8',96:'i8',
42:'d9',52:'e9',63:'f9',74:'g9',86:'h9',
53:'e10',64:'f10',75:'g10',
65:'f11',
19:'b7',29:'c7',40:'d7',50:'e7',61:'f7',72:'g7',84:'h7',95:'i7',107:'k7',
30:'c8',41:'d8',51:'e8',62:'f8',73:'g8',85:'h8',96:'i8',
42:'d9',52:'e9',63:'f9',74:'g9',86:'h9',
53:'e10',64:'f10',75:'g10',
65:'f11',
};
var geometry = Model.Game.cbBoardGeometryHex([
@ -35,7 +35,7 @@
}
var promo = {
"1": { 7:1, 19:1, 30:1, 53:1, 65:1, 73:1, 86:1, 96:1, 107:1, 117:1 },
"1": { 7:1, 19:1, 30:1, 42:1, 53:1, 65:1, 75:1, 86:1, 96:1, 107:1, 117:1 },
"-1": { 2:1, 13:1, 23:1, 34:1, 44:1, 55:1, 66:1, 78:1, 89:1, 101:1, 112:1 },
}

View File

@ -217,4 +217,3 @@
}
})();

View File

@ -111,8 +111,8 @@
},
castle: {
"2/0": {k:[1],r:[1],n:"O-O"},
"22/20": {k:[21],r:[21],n:"O-O"},
"2/0": {k:[1],r:[1,2],n:"O-O"},
"22/20": {k:[21],r:[21,22],n:"O-O"},
},
evaluate: function(aGame,evalValues,material) {

View File

@ -8,11 +8,11 @@
5:'a4',16:'b4',26:'c4',37:'d4',47:'e4',58:'f4',69:'g4',81:'h4',92:'i4',104:'k4',115:'l4',
6:'a5',17:'b5',27:'c5',38:'d5',48:'e5',59:'f5',70:'g5',82:'h5',93:'i5',105:'k5',116:'l5',
7:'a6',18:'b6',28:'c6',39:'d6',49:'e6',60:'f6',71:'g6',83:'h6',94:'i6',106:'k6',117:'l6',
19:'b7',29:'c7',40:'d7',50:'e7',61:'f7',72:'g7',84:'h7',95:'i7',107:'k7',
30:'c8',41:'d8',51:'e8',62:'f8',73:'g8',85:'h8',96:'i8',
42:'d9',52:'e9',63:'f9',74:'g9',86:'h9',
53:'e10',64:'f10',75:'g10',
65:'f11',
19:'b7',29:'c7',40:'d7',50:'e7',61:'f7',72:'g7',84:'h7',95:'i7',107:'k7',
30:'c8',41:'d8',51:'e8',62:'f8',73:'g8',85:'h8',96:'i8',
42:'d9',52:'e9',63:'f9',74:'g9',86:'h9',
53:'e10',64:'f10',75:'g10',
65:'f11',
};
var geometry = Model.Game.cbBoardGeometryHex([
@ -30,7 +30,7 @@
],posNames);
var promo = {
"1": { 7:1, 19:1, 30:1, 53:1, 65:1, 73:1, 86:1, 96:1, 107:1, 117:1 },
"1": { 7:1, 19:1, 30:1, 42:1, 53:1, 65:1, 75:1, 86:1, 96:1, 107:1, 117:1 },
"-1": { 2:1, 13:1, 23:1, 34:1, 44:1, 55:1, 66:1, 78:1, 89:1, 101:1, 112:1 },
}