Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Chess in making
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
A.J




PostPosted: Wed May 21, 2008 3:02 pm   Post subject: Chess in making

here's my level 1 chess program (i only managed to finish level 1)

you should be able to beat easily even if you haven't played that much chess

there are a few bugs, so if u could tell me what they are, that would be great Smile



Chess.zip
 Description:
here it is (in the Pics folder)!!!

Download
 Filename:  Chess.zip
 Filesize:  410.49 KB
 Downloaded:  195 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Sean




PostPosted: Wed May 21, 2008 3:05 pm   Post subject: Re: Chess in making

The Tutorial Section isn't the place Twisted Evil

Maybe the Submissions section Question
A.J




PostPosted: Wed May 21, 2008 3:06 pm   Post subject: Re: Chess in making

oops!!

i though this was the submission sry
cud a mod move this Puppy Dog Eyes
A.J




PostPosted: Wed May 21, 2008 5:05 pm   Post subject: Re: Chess in making

I hope people can help me a bit with the glitches in this program
A.J




PostPosted: Fri May 23, 2008 10:22 pm   Post subject: Re: Chess in making

here's a new version (including american chess) but still old crappy AI (a bit better though)

I added title page and buttons for choices, etc...

I finished my minimax with alpha-beta pruning function today, so the final copy should be done soon



Chess.zip
 Description:
here it is!!!

Download
 Filename:  Chess.zip
 Filesize:  462.11 KB
 Downloaded:  101 Time(s)

[Gandalf]




PostPosted: Fri May 23, 2008 11:43 pm   Post subject: RE:Chess in making

I definitely haven't heard of american chess before, and a google search didn't come up with anything tangible... You sure you didn't just make it up? Wink

Did you give the AI an opening book? If not, how deep is your search?
A.J




PostPosted: Sat May 24, 2008 7:02 pm   Post subject: Re: Chess in making

American chess is a pretty well known thing in my school........I don't know where it originated though....

I didn't use an open book. I used minimax with alpha-beta pruning (wiki it Wink).

The AI I have is my 'stupid' AI (looks 0 moves forward). Being my Level 1, it should be pretty easy to beat (so you can just scholars mate it Laughing)

I finished my minimax with alpha-beta pruning function yesterday, and since I have A lot of summatives/exams, I'll finish the good version only by the end of this coming week (by thursday, friday in other words)

I'll add more graphics and better heuristics for my evaluation functions.

Right now, this is how it calculates the heuristic:

pawn: check if it is passed or not ,more points if it is passed ('passed' meaning no threats + passed halfway sorta thing)

knight: if it is in outer ring of board, 2nd outer ring or middle 3 rings (by rings I mean squares). The further away from center,
the worse.

bishop: range (accessible squares) + if it is on the middle diagonal (the diagonal running from the top-right point to the
bottom-left, or top-left to bottom-right)

rook:range (accessible squares)

queen: range (accessible squares)

king: range (accessible squares)

As you can see, m queen/bishop/king's heuristic are currently in the making.
To every piece, I add/subtract points according to how many pieces threaten it/how many (and type of the) pieces it can take

I sort the legal moves for white and black in 2 separate heaps, so when I minmax I run through the moves from best -> worst

I'll finish the chess part soon (and try adding a timer if the player so wishes), but I'm worried about the graphics.

I need some advise on that.

Thanks, Gandalf, for replying.
[Gandalf]




PostPosted: Sun May 25, 2008 12:29 am   Post subject: Re: Chess in making

A.J @ 2008-05-24, 7:02 pm wrote:
I didn't use an open book. I used minimax with alpha-beta pruning (wiki it Wink).

The AI I have is my 'stupid' AI (looks 0 moves forward).

I don't have to wiki it, believe me. Smile I was just wondering because it seemed to play a decent opening compared to other early chess programs, but then went on to leave a bishop hanging for no reason. The disproportionate search compared to the eval explains that, though. It's pretty unusual to work on the eval as much as it seems you have before even getting a basic search going, not that it's a bad thing.

A.J @ 2008-05-24, 7:02 pm wrote:
I sort the legal moves for white and black in 2 separate heaps, so when I minmax I run through the moves from best -> worst

Move ordering is important, however minimax is a full width search so this really has no effect until you start using alpha beta.

A.J @ 2008-05-24, 7:02 pm wrote:
I'll finish the chess part soon (and try adding a timer if the player so wishes), but I'm worried about the graphics.

The graphics are fine, there are other things you should be fixing though...

1.e4 Nf6 2.e5 Nd5 3.d4 Nc6 4.Nf3 b6 5.Bc4 Bb7 6.Bxd5 a6 7.Be4 { The program made this move for me?? } Qb8 8.Bd5 Qc8 9.Ng5 Qb8 10.Bxf7+ { Error, array subscript out of range, line 1158. }

A.J @ 2008-05-24, 7:02 pm wrote:
Thanks, Gandalf, for replying.

No problem. Smile I'm really quite curious how much potential a Turing chess AI has. Maybe consider releasing the source code?
Sponsor
Sponsor
Sponsor
sponsor
A.J




PostPosted: Sun May 25, 2008 9:52 am   Post subject: Re: Chess in making

here's an updated version !!! (still about level 2 AI though...)

I'm putting my source code up now.....but I'm very inefficient with my code (so, 0 comments!!!....sry abt that)

I'll add the comments/improve AI and add a better version.



Chess.zip
 Description:
here it is!!!

Download
 Filename:  Chess.zip
 Filesize:  64.79 KB
 Downloaded:  94 Time(s)

nastynika




PostPosted: Mon May 26, 2008 8:53 am   Post subject: Re: Chess in making

pretty good so far keep up the good work +bits
A.J




PostPosted: Mon May 26, 2008 5:56 pm   Post subject: Re: Chess in making

thanks nastynika!

I'll finish it soon enough!
A.J




PostPosted: Tue May 27, 2008 10:02 pm   Post subject: Re: Chess in making

here's my main program for my summative

its about 35% complete (since I only finished 1.5 games)

danielg and I are doing this.


the minesweeper took me about an hour to make, so its pretty crappy right now.

I'm adding A LOT more , but comments (as long as they are appropriate) are VERY helpful


enjoy the 3-D ASCII Wink



Main Program.zip
 Description:
click on the 'Main Program" program :lol:

Download
 Filename:  Main Program.zip
 Filesize:  43.73 KB
 Downloaded:  113 Time(s)

Saad




PostPosted: Wed May 28, 2008 6:15 pm   Post subject: Re: Chess in making

Unless I'm mistaken. Isn't it supposed to quit minsweepers when I've won. Even though I'm done it still keeps going.


EDIT, also I entered 20 mines and I see 21.



bug.JPG
 Description:
 Filesize:  67.49 KB
 Viewed:  92 Time(s)

bug.JPG


A.J




PostPosted: Wed May 28, 2008 6:59 pm   Post subject: Re: Chess in making

I only see 20 mines....

but it is supposed to quit though...I think I posted the wrong copy, so sry about that Saad Sad

I'll post a MUCH better copy tomorrow.

sry for the inconvenience Saad !!!
Tallguy




PostPosted: Mon Jun 02, 2008 1:28 pm   Post subject: RE:Chess in making

wow, how did u get the computer to play agaist you? (its really well done)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: