An Intelligent Nim Computer Game, Part 1
In this article, you learn how to play Nim, and discover tools for creating an intelligent computer player. In the next article, you apply those tools to the creation of that player, while building console and G
Tutorial Details:
Introducing Nim
The game of Nim typically involves two players and a pile of matches, stones, marbles, or some other kind of objects. Each player alternately makes a move by taking one, two, or three objects from the pile. The player who takes the last object(s) loses -- and the other player wins. For example, suppose there's a pile of five matches. Player A takes two matches, leaving three. Player B then takes two matches, leaving one. Player A must take the final match, and loses. Player B wins.
Game Trees
A game tree describes all possible moves, via its branches, and resulting game configurations, via its nodes, in a two-player game. The root node represents the initial game configuration and the leaf nodes represent the terminal configurations: win, lose, or draw. There is only one terminal configuration in Nim -- no matches are left in the pile. That configuration represents a win for Player A if Player B makes the last move, or a win for Player B if Player A makes the last move.
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: An Intelligent Nim Computer Game, Part 1
View Tutorial: An Intelligent Nim Computer Game, Part 1
Related
Tutorials:
Understanding Java Card 2.0 - JavaWorld March 1998
Understanding Java Card 2.0 - JavaWorld March 1998 |
Solve real problems with aglets, a type of
mobile agent - JavaWorld May 1997
Solve real problems with aglets, a type of
mobile agent - JavaWorld May 1997 |
Make room for JavaSpaces, Part 3 - JavaWorld March
2000
Make room for JavaSpaces, Part 3 - JavaWorld March
2000 |
Java security evolution
and concepts, Part 1: Security nuts and bolts - JavaWorld April
2000
Java security evolution
and concepts, Part 1: Security nuts and bolts - JavaWorld April
2000 |
WAP for Java developers - JavaWorld June
2000
WAP for Java developers - JavaWorld June
2000 |
J2ME: The next
major games
platform? - JavaWorld March 2001
J2ME: The next
major games
platform? - JavaWorld March 2001 |
Breathe intelligence into Java - JavaWorld April 2001
Breathe intelligence into Java - JavaWorld April 2001 |
Web services hits
the Java scene,
Part 1
Web services hits
the Java scene,
Part 1 |
Will Big Blue
eclipse the Java
tools market?
Will Big Blue
eclipse the Java
tools market? |
Evolve your apps with the Phased
Process pattern
Evolve your apps with the Phased
Process pattern |
Unleash mobile agents
using Jini
Unleash mobile agents
using Jini |
Java's secret weapon
Java's secret weapon |
Navigate through
virtual worlds using Java 3D
Navigate through
virtual worlds using Java 3D |
Develop state-of-the-art mobile
games
Develop state-of-the-art mobile
games |
Introducory
article
Introducory
article |
Eye Of Newt -
LDAP Editor
Eye Of Newt - LDAP Editor |
The HTML Renderer Shootout, Part 1
The HTML Renderer Shootout, Part 1
In this article, we will review 11 different HTML renderers, comparing their features, compliance, and speed; searching for the best one for any project. |
An Intelligent Nim Computer Game, Part 1
An Intelligent Nim Computer Game, Part 1
In this article, you learn how to play Nim, and discover tools for creating an intelligent computer player. In the next article, you apply those tools to the creation of that player, while building console and G |
Create intelligent Web spiders
Create intelligent Web spiders
This article demonstrates how to create an intelligent Web spider based on standard Java network objects. The heart of this spider is a recursive routine that can perform depth-first Web searches based on keyword/phrase cri |
Develop WAP Applications with Java Servlets and JavaServer PagesTM
WAP, the Wireless Application Protocol, was designed to take advantage of the several data-handling approaches already in use. WAP integrates the Handheld Device Markup Language (HDML) and the Handheld Device Transport Protocol (HDTP) developed by Unwired |
|
|
|