aspose file tools*
The moose likes Beginning Java and the fly likes Building a chess applet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Building a chess applet." Watch "Building a chess applet." New topic
Author

Building a chess applet.

Neil James Frarey
Greenhorn

Joined: Jul 03, 2003
Posts: 2
I would like to build a chess applet. Is this a difficult thing to do?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Laying out a board and moving pieces around shouldn't be too much of a challenge. What might make such an undertaking interesting is the AI necessary to make the computer 'smart', or, if you are interested in a multi-player game, the networking and hand-shaking to make two instances of the game talk to each other.
Should be a fun and educational project!
hth,
bear
[ July 03, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
The AI can be solved using Search Trees and MiniMax Algorimiths. If you dont know how to code search trees find out.
You may want to search for bitboards. This is one of many solutions which could be used to represent the board, and personally I think its the best. It works by using a type long (64 bits, as this is the total number of squares on the board) to represent each peice.
Learn about this and if I were you, begin with noughts and crosses first.
See a online version of chess with different rules involving dice..!!
www.chexi.com

A great example of Flash and Java together.
/ James
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Neil!
I would like to build a chess applet. Is this a difficult thing to do?
It sounds like a good beginner's project. Go for it! Check back here often for feedback. I'm sure you'll find plenty amongst our thousands of programmers.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Neil James Frarey
Greenhorn

Joined: Jul 03, 2003
Posts: 2
Thanks for all the encouragement!
I need all the help I can get, thanks for the tips!
Cheers,
Neil.
Eric Hoskland
Greenhorn

Joined: Oct 12, 2000
Posts: 29
A chess applet was my first Java/OO undertaking as well. I still have it on the web
http://paradox.colorado.edu/~neuville/chess/Chess.html
It's not very good and still a little buggy but I get all nostalgic looking at it.
It's definitely a good beginning project, especially if you're not really familiar and comfortable with the whole OO paradigm.
The two pieces of advice I cannot stress enough and wish I would have followed when I started are:
"If you have too many special cases, you are doing it wrong."
"Get your data structures correct first, and the rest of the program will write itself."
(taken straight from Granny Java)
I rewrote the whole program like 3 times because my data structures and special cases got so nasty.
good luck and send me the URL when you get it up on the web
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Building a chess applet.