Computer Science Canada

Chess in making

Author:  A.J [ 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

Author:  Sean [ 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

Author:  A.J [ 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

Author:  A.J [ 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

Author:  A.J [ 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

Author:  [Gandalf] [ 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?

Author:  A.J [ 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.

Author:  [Gandalf] [ 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?

Author:  A.J [ 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.

Author:  nastynika [ Mon May 26, 2008 8:53 am ]
Post subject:  Re: Chess in making

pretty good so far keep up the good work +bits

Author:  A.J [ Mon May 26, 2008 5:56 pm ]
Post subject:  Re: Chess in making

thanks nastynika!

I'll finish it soon enough!

Author:  A.J [ 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

Author:  Saad [ 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.

Author:  A.J [ 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 !!!

Author:  Tallguy [ 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)

Author:  A.J [ Sun Jun 08, 2008 10:22 am ]
Post subject:  Turing Chess/FP

Here is my final project in making.

danielg (another user on this site) and I have made 4 games already:

- Chess (still improving the AI. didn't want to put the new AI since it is a bit buggy)
- MineSweeper (the Easy/Hard choices don't do anything....for now. I have yet to add an 'end' page)
- MasterMind (Everything except for 'end' page exists)
- Connect 5 (Everything except for 'end' page exists)

Please suggest improvements fast, since project is due this friday (yeah, don't tell me..........I'm screwed)

(P.S: Open the "Main Program.t" for the whole thing, or the individual programs to look at the individual parts)

Author:  CodeMonkey2000 [ Sun Jun 08, 2008 11:31 am ]
Post subject:  RE:Chess in making

AJ, please keep things in the same thread. Thanks Very Happy (I think I have merging threads down Razz)

Author:  A.J [ Sun Jun 08, 2008 4:10 pm ]
Post subject:  Re: Chess in making

thanks buddy (codemonkey 2000) Very Happy

sry abt that......I was in a hurry and I forgot abt my other threads.......
please forgive me Puppy Dog Eyes..........

and abt the chess program..I made it better and I've made it bug-free (100%)!!!

I'll post it up as soon as I finish my 4 other summatives Very Happy

Author:  A.J [ Sun Jun 08, 2008 9:12 pm ]
Post subject:  Re: Chess in making

I got the AI working.

I'll post the new version tomorrow.

meanwhile if people cud check out my chess game and the other games, that wud be great

(sry I'm not editing the previous one, but I'm late for something, so I g2g)

thanks


: