Results 1 to 8 of 8
  1. #1
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Programming Kalah Rules

    I am trying to program the method that allows you to make a move. I am using two 1 dimensional arrays for each player's stores and then just using two ints to store the houses. I was wondering what mechanism I could use to remove all the seeds from one store and then deposit them in sequential stores and houses etc. I tried a for loop, but then realised that there may not be 3 seeds in the store you are emptying? Could I use a while loop instead? any help would be appreciated!

  2. #2
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: Programming Kalah Rules

    I reiterate, this forum is useless!

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,524
    Blog Entries
    7
    Rep Power
    20

    Default Re: Programming Kalah Rules

    Quote Originally Posted by Hazza View Post
    I reiterate, this forum is useless!
    Maybe your short description of your problem was incomprehensible?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: Programming Kalah Rules

    What do you want? An essay?!

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,524
    Blog Entries
    7
    Rep Power
    20

    Default Re: Programming Kalah Rules

    Quote Originally Posted by Hazza View Post
    What do you want? An essay?!
    Nope, just an explanation of what a 'Kalah' is; I guess its a game, but what are 'houses', 'stores', 'seeds'? In general: what are the rules of the game? (if we're talking about a game that is).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: Programming Kalah Rules

    Oh sorry I though you were being facetious with me! The best explanation is actually on Wikipedia:

    Kalah - Wikipedia, the free encyclopedia

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,524
    Blog Entries
    7
    Rep Power
    20

    Default Re: Programming Kalah Rules

    Quote Originally Posted by Hazza View Post
    Oh sorry I though you were being facetious with me! The best explanation is actually on Wikipedia:

    Kalah - Wikipedia, the free encyclopedia
    Got it; nice game b.t.w.; I'd use an array with 14 elements and think of it as a circular array; elements #0 ... #5 are your houses; element #6 is your store; elements #7 ... #12 are your opponents houses and element #13 is your opponents store.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    Hazza is offline Member
    Join Date
    Oct 2012
    Posts
    64
    Rep Power
    0

    Default Re: Programming Kalah Rules

    Yeah I did what you said and its all great thanks! i am trying to program the rules now! I have used a while loop first of all to say while (seedsinparticularhouse != 0) but am confused about the inner loop(s)?!

Similar Threads

  1. IF / ELSE Rules
    By johnnypict in forum New To Java
    Replies: 8
    Last Post: 11-16-2012, 09:45 AM
  2. Architecture Rules 2.1.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-11-2008, 02:39 PM
  3. Architecture Rules 2.1.0
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-05-2008, 06:18 PM
  4. Replies: 1
    Last Post: 07-05-2008, 03:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •