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

#1 2012-08-24 14:53:57

coinman
Scratcher
Registered: 2011-04-19
Posts: 500+

Checkers AI help

I was working on a checkers AI (there are 0 on the website) and got stuck on making the AI make his second move. Could someone help me? http://scratch.mit.edu/projects/coinman_test/2745289 LOTS of credit will be given.


Click the picture below to play my best game yet, Snowball Fight!
http://scratch.mit.edu/static/projects/coinman/3221194_sm.png

Offline

 

#2 2012-08-24 15:06:29

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Checkers AI help

Instead of

if <(turn) = [2]>
end
use
if <((turn) mod (2)) = [0]>
smile


http://i50.tinypic.com/312u714.jpg

Offline

 

#3 2012-08-24 16:09:54

coinman
Scratcher
Registered: 2011-04-19
Posts: 500+

Re: Checkers AI help

BirdByte wrote:

Instead of

if <(turn) = [2]>
end
use
if <((turn) mod (2)) = [0]>
smile

Thanks, i might be able to do it from here but i'm not telling a mod to close it  wink .


Click the picture below to play my best game yet, Snowball Fight!
http://scratch.mit.edu/static/projects/coinman/3221194_sm.png

Offline

 

#4 2012-08-24 16:12:36

coinman
Scratcher
Registered: 2011-04-19
Posts: 500+

Re: Checkers AI help

BirdByte wrote:

Instead of

if <(turn) = [2]>
end
use
if <((turn) mod (2)) = [0]>
smile

Wait a minute it didn't work because of my other scripts  sad


Click the picture below to play my best game yet, Snowball Fight!
http://scratch.mit.edu/static/projects/coinman/3221194_sm.png

Offline

 

#5 2012-08-26 08:15:03

coinman
Scratcher
Registered: 2011-04-19
Posts: 500+

Re: Checkers AI help

bump


Click the picture below to play my best game yet, Snowball Fight!
http://scratch.mit.edu/static/projects/coinman/3221194_sm.png

Offline

 

#6 2012-08-26 08:37:16

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Checkers AI help

Checkers AI is typically achieved by using a game tree.  The scripting is quite complex (recursive functions), but it is probably the best way to go about doing this.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer