Design a game in java, JAVA Programming

Assignment Help:

The game of Kala is played on a rectangular board:

1730_Design a Game in java.png

In front of each player are six pits numbered 1 to 6 (called the 'side pits'). To the right of a player's side pits is a special pit, called the player's 'kala'. Initially, all the side pits contain an equal number of stones. A 'move' consists of taking the stones from one of one's own side pits and distributing them anti-clockwise one-by-one in the other pits, including one's own kala, but not the opponent's kala. There are two rules:

  • Players make moves alternately except when the last stone of a heap being distributed lands in the current player's kala, and the current player is rewarded with another go.
  • If the last stone of a heap moved by a player lands in an empty side pit on the player's own side, that stone together with any stones in the opposite side pit belonging to the player's opponent are won and transferred to the current player's kala. This is referred to as a 'capture'.

The game ends when the player whose turn it is cannot make a move (i.e., all of that player's side pits are empty). Each player's ?nal score is the number of stones in the player's kala plus the number (if any) in their side pits. The player with the higher score is the winner. For a good beginner's game, start with two or three stones in each side pit. Starting with six stones or more in each pit results in quite a diffcult game.


Related Discussions:- Design a game in java

What is the difference between inner class and nested class, What is the di...

What is the difference between inner class and nested class? When a class is explained within a scope od another class, then it becomes inner class. If the access modifier o

List the keywords which are used in java 1.1, List the keywords which are u...

List the keywords which are used in java 1.1? The list of keywords which are used in java 1.1 are given below: Keyword Purpose boole

How to implementing the cloneable interface, How to Implementing the Clonea...

How to Implementing the Cloneable Interface The java.lang.Object class contains a clone() method which returns a bitwise copy of the current object. protected native Object cl

What is the jsf, JavaServer Faces(JSF) is a framework for building web-base...

JavaServer Faces(JSF) is a framework for building web-based user interface in Java. Unlike Swing, JSF provides widgets like buttons, hyperlinks, checkboxes, etc. in dissimilar ways

What is event handler works, What is Event Handler works? An event hand...

What is Event Handler works? An event handler is a command which is used to call a function when an event happens, such as the user clicking a button or mouse.

What is an introduction in aop, An introduction permits the user to add new...

An introduction permits the user to add new methods or attributes to an existing class. This can then be explained to an existing class without having to change the structure of th

Area under curve, write a program to find the area under thecurve y=f(x)bet...

write a program to find the area under thecurve y=f(x)between x=a and x=b, integrate y=f(x) between the limits of a and b. the area under a curve between two points can be found by

What is jdbc exactly, What is JDBC exactly? Describe the steps required to ...

What is JDBC exactly? Describe the steps required to execute a SQL query using JDBC.

What is the use of lookupdispatchaction, LookupDispatchAction is useful if ...

LookupDispatchAction is useful if the method name in the Action is not driven by its name in the front end, but by the Locale independent key into the resource bundle. As the key i

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd