cm-engine-runner 1.0.15 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/package.json +1 -1
- package/src/cm-engine-runner/StockfishRunner.js +24 -12
package/README.md
CHANGED
|
@@ -17,9 +17,24 @@
|
|
|
17
17
|
- Stockfish version: 14
|
|
18
18
|
- Latest js version, Multithreadded
|
|
19
19
|
|
|
20
|
+
## Stockfish Skill Levels
|
|
21
|
+
|
|
22
|
+
this.uciCmd('setoption name Skill Level value ' + (LEVELS[props.level][1]))
|
|
23
|
+
|
|
24
|
+
- Level 0 = 1100 ELO rating
|
|
25
|
+
- Level 1 = 1165 ELO rating
|
|
26
|
+
- Level 2 = 1230 ELO rating
|
|
27
|
+
|
|
28
|
+
As you can see the strength is increasing by 65 ELO points for each level, so that;
|
|
29
|
+
|
|
30
|
+
- Level 20 = 2570 ELO rating.
|
|
31
|
+
|
|
32
|
+
And depth to ELO: https://chess.stackexchange.com/questions/8123/stockfish-elo-vs-search-depth?rq=1
|
|
33
|
+
|
|
20
34
|
## References
|
|
21
35
|
|
|
22
36
|
- [UCI reference](http://page.mi.fu-berlin.de/block/uci.htm)
|
|
37
|
+
- [Official Stockfish](https://github.com/official-stockfish/Stockfish)
|
|
23
38
|
- [stockfish.js](https://github.com/nmrugg/stockfish.js/)
|
|
24
39
|
- https://github.com/mcostalba/Stockfish
|
|
25
40
|
- https://github.com/niklasf/stockfish.js (stockfish-v10-niklasf.js)
|
package/package.json
CHANGED
|
@@ -6,17 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
import {ENGINE_STATE, EngineRunner} from "./EngineRunner.js"
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
// [depth, Skill Level]
|
|
10
|
+
export const LEVELS = {
|
|
11
|
+
1: [3, 0],
|
|
12
|
+
2: [3, 1],
|
|
13
|
+
3: [4, 2],
|
|
14
|
+
4: [5, 3],
|
|
15
|
+
5: [5, 4],
|
|
16
|
+
6: [6, 5],
|
|
17
|
+
7: [7, 6],
|
|
18
|
+
8: [8, 7],
|
|
19
|
+
9: [9, 8],
|
|
20
|
+
10: [10, 10],
|
|
21
|
+
11: [11, 11],
|
|
22
|
+
12: [12, 12],
|
|
23
|
+
13: [13, 13],
|
|
24
|
+
14: [14, 14],
|
|
25
|
+
15: [15, 15],
|
|
26
|
+
16: [16, 16],
|
|
27
|
+
17: [17, 17],
|
|
28
|
+
18: [18, 18],
|
|
29
|
+
19: [19, 19],
|
|
30
|
+
20: [20, 20]
|
|
20
31
|
}
|
|
21
32
|
|
|
22
33
|
export class StockfishRunner extends EngineRunner {
|
|
@@ -99,8 +110,9 @@ export class StockfishRunner extends EngineRunner {
|
|
|
99
110
|
})
|
|
100
111
|
const calculationPromise = new Promise ((resolve) => {
|
|
101
112
|
setTimeout(() => {
|
|
113
|
+
this.uciCmd('setoption name Skill Level value ' + (LEVELS[props.level][1]))
|
|
102
114
|
this.uciCmd('position fen ' + fen)
|
|
103
|
-
this.uciCmd('go depth ' + (
|
|
115
|
+
this.uciCmd('go depth ' + (LEVELS[props.level][0]))
|
|
104
116
|
this.moveResponse = (move) => {
|
|
105
117
|
resolve(move)
|
|
106
118
|
}
|