This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#51 2012-09-29 15:40:36

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Challenge The Turk to a game of CHESS!

New version today.

I fixed a few bugs.  When black was capturing en passant, it was completely broken.

Also, I added a few more corrections to the opening book.  If you find any more short games (say less than 10 moves) let me know the game listing so I can fix it.

I also added the + check indicator to the notation listing.

And, with this update, I feel that the 3-ply engine is working pretty well.  I'm still seeing a few cases where it is making poor moves, but at some point I just need to realize that it is a 3-ply engine and there is not much that can be done. 

Time for me to focus on a new game.


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#52 2012-10-01 16:52:11

eventexception
Scratcher
Registered: 2011-04-08
Posts: 500+

Re: Challenge The Turk to a game of CHESS!

Hi BoltBait! 

I have several ideas for modified chess games or a new kind of board game,
for example towers only, eight towers or a smaller board.

Any advice how to reuse your AI ?

Btw. think time limitation for the engine is still not feasible?

Offline

 

#53 2012-10-01 18:54:18

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Challenge The Turk to a game of CHESS!

I think modifying my chess game would be fairly easy.  Just duplicate the pieces you want and adjust the starting positions, etc.  Also, there is a script on the stage that sets up the "board" list with piece values.

As for the algorithm, it should work the same.  You may need to adust the board evaluation function, but that's about it.

A MiniMax algorithm works this way:

First you need to write a function that generates a list of all available moves. (See W Move sprite)
Then, you'll need to write a board evaluation function.  (See Scratch sprite, CalculateScratchTotal) If white pieces are positive values and black pieces are negative, then you can add up all board positions to determine what the board is worth.  If the total is positive, white is winning.  If the total is negative, then black is winning.  A good board evaluation function is more complicated than just totalling up all the pieces.  Some consideration must be given to board position, pawn chains, etc.
Finally, you'll need to write a X-Ply engine. (See 3 Ply sprite or 4 Ply sprite)  This loops through all possible moves and calls the board evaluation function to see the effects of each move... (was it good or bad for the computer player, etc.)  It will need to pick the best move for the player.

I have not properly explained the innerworkings of the MiniMax engine here.  You should look at this image to see how they really work:

http://en.wikipedia.org/wiki/File:Plminmax.gif


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#54 2012-10-02 17:12:32

eventexception
Scratcher
Registered: 2011-04-08
Posts: 500+

Re: Challenge The Turk to a game of CHESS!

Thank you!

Offline

 

#55 2012-10-02 19:00:34

littlemisschic
New Scratcher
Registered: 2012-06-28
Posts: 59

Re: Challenge The Turk to a game of CHESS!

cool game!  smile

Offline

 

#56 2013-04-12 19:54:33

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Challenge The Turk to a game of CHESS!

1.e4  Can't Remember
2.Ke2  Can't Remember
3.Kd3  Qa7?
4.Kc3  Qxc3!

It is legal to move a king into check and the turk wins by CAPTURING your king!


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&action=onlineStatus&type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&action=projects&type=newest&return=image&num=1

Offline

 

#57 2013-04-18 12:43:03

qwerts9000
Scratcher
Registered: 2011-02-21
Posts: 100+

Re: Challenge The Turk to a game of CHESS!

Amazing Game!

Offline

 

Board footer