Thread: Kalah game !

  1. #1
    Registered User
    Join Date
    Jan 2020

    Kalah game !

    Hi , I just had a homework to get done before tomorrow to create a KALAH GAME Player 1 Vs Player 2 : I struggle with the two last 5 and 6.

    1. Two players Player1 and Player2 each have in front of them, six stacks full of a
    equal number of coins and an empty stack called its "Kalah". The whole is arranged in
    the following way (e.g. with three pieces in each stack) :
    2. The object of the game is for each player to gradually bring in their
    kalah more than half the pieces of the game. The game also ends if all
    a player's stacks are empty when it's his turn to play. The other player
    then collects his own coins in his kalah.
    3. A move is played as follows:
    The player chooses one of his stacks (not empty) and takes in the hand all the pieces in his kalah.
    pieces in this stack,
    Then the player turns in the trigonometric direction above the game, in
    starting from the stack next to the one he just emptied, and dropping down to
    depletion of one coin in each stack, including in his kalah (but not in his kalah)
    in his opponent's).
    If the last piece lands in his kalah, he plays again immediately.
    If it lands in one of his empty stacks, he captures the pieces that are in
    the opponent's pile facing that empty pile and puts them in his kalah,
    as well as his own last piece.
    In all other cases the opponent plays in turn.
    4. 4. The program must allow the management of a game between two players.
    human (the program is not asked to be able to simulate a player). It
    will need to know how many pieces to fill the stacks at the beginning of the game.
    (it's up to the programmer to set the limits). The program will randomly draw which of the
    two players start. He will distribute the pieces in a stack x
    when a player decides to play a valid stack x, and will take into account the
    different rules. It will have to detect the end of the game and display the player's name.
    who wins, etc.
    5. We should be able to save a game in progress just as we will be able to save a game in progress.
    recall a previously saved one.
    6. Finally, the cancellation of the moves played will be authorized in order to be able to come back in the same position.

  2. #2
    Registered User
    Join Date
    Aug 2019
    inside a singularity
    Good question. Unfortunately, this forum is not for solving questions unless you've attempted to solve it yourself and show us code.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook, The Wizardry Compiled

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting a simple game server for tile based game
    By cpu0 in forum Game Programming
    Replies: 1
    Last Post: 01-19-2017, 12:15 PM
  2. Guessing game: how to quit the game?
    By hzr in forum C Programming
    Replies: 5
    Last Post: 12-18-2008, 10:53 AM
  3. craps game & dice game..
    By cgurl05 in forum C Programming
    Replies: 3
    Last Post: 03-25-2006, 07:58 PM
  4. Game Designer vs Game Programmer
    By the dead tree in forum Game Programming
    Replies: 8
    Last Post: 04-28-2005, 09:17 PM

Tags for this Thread