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

Username:   Password: 
 RegisterRegister   
 2 player chess
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
A.J




PostPosted: Sun Apr 27, 2008 7:07 pm   Post subject: 2 player chess

This is an unfinished Chess program.
I managed to finish 95% of the program (everything except for some of the checkmate procedure. So you might get checkmated when it isn't a checkmate).
I'll fix after making the AI, so I can use the AI to check if it is checkmate.

I'm pretty sure there are A LOT of bugs, but please bear with me.

Comments are appreciated.



(P.S: press the 'q' key on the keyboard, not the 'r' key, to show that you have lost)



Chess.zip
 Description:
Here it is

Download
 Filename:  Chess.zip
 Filesize:  444.15 KB
 Downloaded:  393 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Sun Apr 27, 2008 8:31 pm   Post subject: RE:2 player chess

Why oh why are you not using classes? Using an abstract base class for a piece and then inheriting the base class for king, pawns etc. would be so much easier.
Clayton




PostPosted: Sun Apr 27, 2008 9:18 pm   Post subject: Re: 2 player chess

Just because I'm in Windows, I decided to check this out. I'm going to let this image give you one problem, and you can try and figure out what it is.


chess.PNG
 Description:
 Filesize:  47.3 KB
 Viewed:  170 Time(s)

chess.PNG


CodeMonkey2000




PostPosted: Sun Apr 27, 2008 9:23 pm   Post subject: RE:2 player chess

How did you do that?
Clayton




PostPosted: Sun Apr 27, 2008 9:26 pm   Post subject: RE:2 player chess

I ran the code Confused
zylum




PostPosted: Sun Apr 27, 2008 11:29 pm   Post subject: RE:2 player chess

If youre going to be making an ai, classes and such are definitely not the way to go.. Way too much overhead, especially in turing. I would suggest bitboards, but turing doesnt support 64 bit datatypes.. Maybe you can get away using 2 nats, try it out.
Tallguy




PostPosted: Mon Apr 28, 2008 8:28 am   Post subject: Re: 2 player chess

Clayton wrote:

Just because I'm in Windows, I decided to check this out. I'm going to let this image give you one problem, and you can try and figure out what it is.


you went to the wrong folder, run the .exe in the pictures folder, not the one in the gif folder

same thing happened to me lol
Clayton




PostPosted: Mon Apr 28, 2008 1:56 pm   Post subject: Re: 2 player chess

Tallguy @ Mon Apr 28, 2008 8:28 am wrote:
Clayton wrote:

Just because I'm in Windows, I decided to check this out. I'm going to let this image give you one problem, and you can try and figure out what it is.


you went to the wrong folder, run the .exe in the pictures folder, not the one in the gif folder

same thing happened to me lol
I don't run random .exe's
Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: Mon Apr 28, 2008 2:17 pm   Post subject: RE:2 player chess

I did... it crashed...
A.J




PostPosted: Mon Apr 28, 2008 8:49 pm   Post subject: Re: 2 player chess

sry for the trouble guys!
here is the updated version

I still have ot add the 'promotion' part, when the pawn reaches the end of the other side of the board.

I'm going to add the checkmate AFTER making the AI (so that I can use the AI to determine if it is a checkmate or not for the player)



Chess.zip
 Description:
here it is :D !!!

Download
 Filename:  Chess.zip
 Filesize:  400.28 KB
 Downloaded:  159 Time(s)

Saad




PostPosted: Mon Apr 28, 2008 8:54 pm   Post subject: Re: 2 player chess

A.J @ Mon Apr 28, 2008 8:49 pm wrote:
sry for the trouble guys!
here is the updated version

I still have ot add the 'promotion' part, when the pawn reaches the end of the other side of the board.

I'm going to add the checkmate AFTER making the AI (so that I can use the AI to determine if it is a checkmate or not for the player)


Again like I told you before. Post the code and people can be helpful. Choose not to and you loose on some great way to improve code. Just my 2c
nike52




PostPosted: Mon Apr 28, 2008 8:54 pm   Post subject: Re: 2 player chess

chess. awesome ! i gotta make me chess sometime Very Happy
[Gandalf]




PostPosted: Mon Apr 28, 2008 10:18 pm   Post subject: RE:2 player chess

Now that you have check working, I don't see why checkmate is a problem... If there are no possible moves for the side to move and it is a check then that player is checkmated. No AI involved.

Well done on en passant and more obscure rules such as castling through a check.

I can't imagine you getting more than a 5/6 ply search done in Turing, even with heavy pruning.

Oh, and if you're looking for efficient board representation there's alternatives to bitboards that don't rely on 64 bit data types.
repsoccer16




PostPosted: Tue Apr 29, 2008 8:21 am   Post subject: RE:2 player chess

ya the checkmate shouldn't be hard to add in now that you have check done so put that in then put in A.I...also i agree with Saad..alot of the people on here are quite helpful and could teach you some stuff that could make you better at turing and make more detailed and fun programs if you'd like.
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 1  [ 14 Posts ]
Jump to:   


Style:  
Search: