Castling, en-passent and pawn promotion are all catered for, but the rule "Game is drawn if a position repeats three times" is not implemented. The CPU performs an alpha-beta search to a depth of two moves, but does not examine check at the deepest level.
The JavaScript Source: Games: JavaScript Chess with CPU oppo
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!
Comments feed