Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building a chess applet.

 
Neil James Frarey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to build a chess applet. Is this a difficult thing to do?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Neil James Frarey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all the encouragement!
I need all the help I can get, thanks for the tips!
Cheers,
Neil.
 
Eric Hoskland
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic