Important alert: (current site time 7/16/2013 2:40:59 AM EDT)
 

winzip icon

RRChess(Updated)

Email
Submitted on: 12/27/2005 12:51:10 PM
By: Robert Rayment 
Level: Intermediate
User Rating: By 36 Users
Compatibility: VB 6.0
Views: 19471
author picture
(About the author)
 
     ~RRChess~ by Robert Rayment. Program to solve checkmate problems and play chess games with another person or against the computer. The chess engine is not very strong, only operating at 4 or 5-ply, so you should be able to win fairly easily but it might surprise you at times. Making such a program bug-free I found quite difficult. So far as I can tell, all the legal moves, castling rules, en passant, promotion etc are OK. There are WAV sounds in the resource file for CHECK, CHECKMATE etc. Games and positions can be saved and loaded. See Help for more info. in particular the section on Starting a game. (Zip 500 KB). __________________________________________________ Update: to allow computer to play on, if is it's turn, when move list is double-clicked. Code cleaned up a bit from CodeFixer. __________________________________________________ Update2: added a couple of extra color schemes. These can be changed in Sub cmdColorSchemes. __________________________________________________ Update3: fixed bug on sound skipping. __________________________________________________ Update4: correction to playback when computer given odds - so many subtleties! __________________________________________________ Update5: some typos and menu re-arrangement.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :RRChess(Updated)
'**************************************
A few, see code
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 68 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
11/12/2005 6:43:38 AMLight Templer

Hi Robert, looks great and new! A sure winner ;-) My 5 to and regards - LiTe

(If this comment was disrespectful, please report it.)

 
11/12/2005 11:00:43 AMD. Rijmenants

Just Great! Fantastic GUI. Game engine a bit slow, but beautiful very complet game. Five Queens ***** from me!
(If this comment was disrespectful, please report it.)

 
11/12/2005 12:31:27 PMmichael doering

Hello Robert,
very very nice app.

Have you seen the solution from 'Ulli',
search for 'Chess playing'
(If this comment was disrespectful, please report it.)

 
11/12/2005 2:02:02 PMChris Seelbach.

Any game that lets an old man win, is worth 5 stars. ;)
(If this comment was disrespectful, please report it.)

 
11/12/2005 4:37:12 PMDave

Wow. Excellent work Robert.

You spoke about this some months back in email and it's great to see it take shape.

Your GUI/Interface design has made huge leaps too. Overall a really excellent game you've got hear robert, keep it up mate!

Lets make this a winner :)
(If this comment was disrespectful, please report it.)

 
11/13/2005 12:24:10 AMRobert Rayment

michael: yes, Ulli's program is referenced in the Help file.

Thanks for feedback.

(If this comment was disrespectful, please report it.)

 
11/13/2005 9:37:46 AMpietro ing. cecchi

nice chess game.
nothing to say against.
and besides, it let me win at the first attempt...

cecchi.infinito.it

FIVE pumpkins from me,
and always thanks for sharing your code
(If this comment was disrespectful, please report it.)

 
11/13/2005 9:38:45 AMTerriTop

Very Cool Robert! Thanks for sharing this nice bit of coding! TerriTop
(If this comment was disrespectful, please report it.)

 
11/13/2005 3:19:46 PMHeriberto Mantilla Santamaria

It's the first chess game that I see in PSC, it's VERY LIMITED but it's an excellent beginning, sure in future it can be better.
(If this comment was disrespectful, please report it.)

 
11/13/2005 3:29:07 PMHeriberto Mantilla Santamaria

Ah, a suggestion the machine thinks too much a play, don't give so much priority to the first 3 plays, it's almost impossible to make a jacke in a single 3 plays.
(If this comment was disrespectful, please report it.)

 
11/13/2005 11:32:43 PMRobert Rayment

Heriberto: It does play a couple of Book moves at the beginning of a full game - see the Help.
(If this comment was disrespectful, please report it.)

 
11/13/2005 11:44:06 PMRobert Rayment

Heriberto: Also there are other chess programs on PSC, in particular see Ulli's at CodeId=31064.
(If this comment was disrespectful, please report it.)

 
11/14/2005 12:47:21 AMPaul Turcksin

What else can I say? This is simply brilliant! Thanks for sharing this pearl.
(If this comment was disrespectful, please report it.)

 
11/14/2005 10:23:54 AMHeriberto Mantilla Santamaria

Thanks Robert, I play with this, it's really excellent to be a beginning.

Although it lacks to improve the machine of inference of the computer a little.

Anyway thannks for sharing and take my 5 fives.
(If this comment was disrespectful, please report it.)

 
11/14/2005 10:35:51 AMHeriberto Mantilla Santamaria

How do I make an roque?
(If this comment was disrespectful, please report it.)

 
11/14/2005 10:50:32 AMRobert Rayment

Heriberto: 'roque' is that a 'rook' and if you mean promotion then for a human player a selection box comes up, for the computer it can only promote to a queen.
(If this comment was disrespectful, please report it.)

 
11/14/2005 11:13:25 AMRichard Mewett

Robert, a great submission! This is something I've never tried myself and its good to see something so original. 5*
(If this comment was disrespectful, please report it.)

 
11/14/2005 4:46:26 PMHeriberto Mantilla Santamaria

The meaning of Roque (sorry this word I write in spanish coz I didn't find as translating it) is: When the King (only first one) move to the Position of the Tower I produced a "Roque".

This play one can only make if the king has not moved of his beginning and the player makes it an only time in the game.
(If this comment was disrespectful, please report it.)

 
11/14/2005 5:13:27 PMRobert Rayment

Heribert: What English call 'castling'. Simply move the King 2 squares when castling is allowed. Sorry your English is confusing but much better than my Spanish :)
(If this comment was disrespectful, please report it.)

 
11/14/2005 9:49:31 PMHeriberto Mantilla Santamaria

Thanks for the information, now I can see castling, yeah my english is really bad.
(If this comment was disrespectful, please report it.)

 
11/16/2005 9:57:05 PMHeriberto Mantilla Santamaria

Kurt Programmer you should be the dad of the chickens of the programming to only give a point.
(If this comment was disrespectful, please report it.)

 
11/17/2005 1:16:21 AMRobert Rayment

Heriberto: 'dad of chickens of the programming' I love it :) Kurt programmer, planetsource, samppa - probably the same person. There's always been 'one-voters' on PSC - just their bit of fun. As a comment on submissions it's meaningless - no worries.
(If this comment was disrespectful, please report it.)

 
11/17/2005 11:58:37 AMRogério Lopes Weinert

Excellent! 5 from me.
(If this comment was disrespectful, please report it.)

 
11/18/2005 2:29:43 AMChetankumar Digambarrao Akarte

VERY GOOD
My suggesion is that if possible add skins
chetan
(If this comment was disrespectful, please report it.)

 
11/20/2005 4:07:24 AMAgustin Rodriguez

Congratulations! I always liked your codes, but with restrictions to some interfaces. But now it is excellent.
5 Kings .
(If this comment was disrespectful, please report it.)

 
11/20/2005 12:44:37 PMBrainThrust

I can't understand why Kurt gave you one globe for this great work maybe his jealous but anyway i'll give you one globe also for this project.
(If this comment was disrespectful, please report it.)

 
11/20/2005 12:45:24 PMBrainThrust

just kidding!!! i'll give you 5 stars for this excellent work
(If this comment was disrespectful, please report it.)

 
12/8/2005 12:45:30 AMuzomaki naruto

Very nice code!

Thanks for sharing!


(If this comment was disrespectful, please report it.)

 
12/16/2005 1:38:33 PMRedGalaxy UK

I like it. Instantly noticed a rules problem though; it doesn't appear to recognise the En Passant (sp?) capture move?

On the whole though, fantastic work!
(If this comment was disrespectful, please report it.)

 
12/17/2005 2:01:03 AMRobert Rayment

I'm surprised, it passed all the en passant tests I tried! Are you sure you are applying the correct rule?
(If this comment was disrespectful, please report it.)

 
12/17/2005 3:34:33 AMRedGalaxy UK

Positive. My first move was a pawn two rows forward, the computer's move was the exact opposite pawn also two rows forward. That should allow me to take the computer's pawn by moving mine to either side of the computer's. Tried this and it didn't register it :(
(If this comment was disrespectful, please report it.)

 
12/17/2005 8:53:48 AMRobert Rayment

I'm afraid you've got the rule wrong! For white to take en passant it must have a pawn on row 5 (not 4). Then black also has to move to row 5 but on an adjacent column, white can then take as if black had moved to row 6. Vice versa for black where black has to be at row 4 etc.
(If this comment was disrespectful, please report it.)

 
12/18/2005 8:56:45 AMRedGalaxy UK

Oops! Shows how long it was since I played a full game... I had the right rule, just wrong positioning. Now I'm going to hide for my mistakes!
(If this comment was disrespectful, please report it.)

 
12/30/2005 4:07:07 AMJose

Good work again. If I may offer a suggestion, would there be a marked improvement if some of the engine routines were written in asm, or by using bitboards, etc ? It would also be nice to see different implementations of the search, like heuristics and pruning, alpha-beta versions, etc.
(If this comment was disrespectful, please report it.)

 
12/30/2005 9:37:01 AMRobert Rayment

Jose: It does use alpha-beta pruning apart from finding checkmates which require brute-force. There are lots of ways to improve the speed, some of which I mention in the Help. I notice on the Web that some chess programs have been years in development - not sure I want to:) Thanks for comments.
(If this comment was disrespectful, please report it.)

 
1/31/2007 1:35:02 PMJason

Robert, the best chess program on PSS. Great work, well done, thanks a mil...
(If this comment was disrespectful, please report it.)

 
6/23/2007 8:43:43 AMJoaquin Marcher

Robert are you a robot? hehee you always doing this spectacular applications i know, this one it`s old but is the same :P
(If this comment was disrespectful, please report it.)

 
6/1/2010 3:02:15 AMR. Pierce

I've played quite a few games on the
r e t a r d level. Only won a few!
After a few years, thought I'd say it's
a great implementation ! +5
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.