• Post Reply Bookmark Topic Watch Topic
  • New Topic

Checkers Game (AI)  RSS feed

 
J Hall
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm interested in creating a basic Checkers applet game. Where do I begin in order to create something like this in terms of artificial intelligence. Here are two different games with some sort of AI (the first with a good AI and the second can easily be beaten).

1. Maverick Checkers by Okoware
- I really like this one even though I can't beat it.

2. Checkers by Darkfish
- this one seems to have a weak AI
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

The most important thing you need to get started, simply enough, is an idea of how to play checkers. Not just the rules, but an idea of an actual strategy for playing the game. It could be a rule-based strategy, in which the player does X in situation Y, for all possible situations; it could be a pattern-based strategy, in which the player does X for board configuration Y, for all possible boards; it could even be random moves given the constraints of the rules (although that's not a very good strategy!)

Once you understand the strategy, you then need to design the application. The first thing you'd want to think about would be the data structures: how is the board represented, how are positions represented, how are moves represented, etc. You want to choose data structures that make expressing your strategy simple and efficient.

Then you have three tasks left to do: first, you have to implement the data structures, second, you have to implement your AI, and third, you have to implement the GUI, The GUI represents those data structures graphically, and give the human player controls to manipulate them. The AI directly manipulates the data. You can write these three parts at the same time, or in any order; you'll almost certainly want to iterate while writing them so that the design is influenced by your early attempts at an implementation.

Finally, let me give you one piece of advice: write a little, compile, test, then write a little more. Never write more than ten lines of code without compiling and testing. Use tools like Ant and JUnit to automate your build process and testing, respectively. And at every point, make sure you understand what you're doing: no "voodoo coding," where you do something just because "it works." Take your time and have fun!
 
J Hall
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the input.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!