fetch("https://airbackend.com/chessMove/api.php", {
method: "POST",
body: JSON.stringify({
request: "nextMove",
gameState: "rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNRw1111",
level: 4,
move: [[0, 1], [2, 2]]
})
}).then((result) => {
result.json().then((jsonResult) => {
console.log(jsonResult);
});
});
rnbqkbnrpppp-ppp------------p-------------------PPPPPPPPRNBQKBNRb111134
{
prev: "rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNRb1111",
score: 0,
level: 3,
move: [[6, 3], [4, 3]],
next: "rnbqkbnrpppp-ppp------------p-------------------PPPPPPPPRNBQKBNRw1111"
}
fetch("https://airbackend.com/chessMove/api.php", {
method: "POST",
body: JSON.stringify({
request: "checkMove",
gameState: "rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNRw1111",
move: [[0, 1], [2, 2]]
})
}).then((result) => {
result.json().then((jsonResult) => {
console.log(jsonResult);
});
});
{
"prev": "rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNRw1111",
"move": [[0,1],[2,2]],
"moveValid": true
}
fetch("https://airbackend.com/chessMove/api.php", {
method: "POST",
body: JSON.stringify({
request: "",
gameState: "",
level: ,
move:
})
}).then((result) => {
result.json().then((jsonResult) => {
console.log(jsonResult);
});
});
request: | |
gameState: | |
level: | |
move: |
{
"prev": "rnbqkbnrpppppppp--------------------------------PPPPPPPPRNBQKBNRw1111",
"score": 0,
"level": 3,
"move": [[0,1],[2,2]],
"next": "r-bqkbnrpppppppp--n-----------------------------PPPPPPPPRNBQKBNRb1111"
}