java - Trouble With Recursion/Enumerations -


I am currently trying to write a code for the party pong game in Java. This deal, there are 2 players in each team. If a player makes a cup, then he is removed. If both players make a cup, then two are removed and they get a bonus shot. If a player does not make a cup, then he has to remove one of his cups. In this way, the game always ends with each goal, for each team to win in a different way to win, to each team to start with some cups like 1/2, each team How many different ways to win? How to write intrusion to make this task easy It seems that the output is something like this:

  [Folder]% Java PartyPong 0 wins Team 1: [folder]% Java PartyPong 1 Team 1 wins: 1: One team wins 1: B Team 2 Win: 1: X [Folder]% Java PartyPong 2 Team 1 Win: 1: A2: A1: A Team 1 Win: 1: A2 : A1: B Team 2 Win: 1: A2: A1: X Team 1 Win: 1: A2: B1: A Team 1 Win: 1: A2: B1: B Team 2 Win: 1: A2: B1: X Team 2 Win: 1: A2: AB Team 1 Win: 1: A2: A X Team 1 Win: 1: B2: A1: A Team 1 Win: 1: B2: A1: B Team 2 Win: 1: B2: A1: X Team 1 Win: 1: B2: B 1: Team 1 Win: 1: B2: B1: B Team 2 Win: 1: B2: B1: X Team 2 Win: 1: B2: AB Team 1 Win: 1: B2: X Team 1 Wins: 1: Abby Team 2 Win: 1: X2: Team 2 Win: 1: X2: B Team 1 Win: 1: X2: X1: A Team 1 Win: 1: X2: X1: B Team 2 Wins: 1: X2: X1: X   

Does anyone point me in the right direction how to make it easier to navigate ?? Thanks

follow this psuedocode

  // input one empty The function works in the function after the combosLeft (cup in form of number cup, number as cup B, list as list & lt; list & lt; string & gt; & gt; pass by reference ( Popups) as the soFar list & lt; string & gt;) // If none of the players came out of the cup with reference, then the temporary list as a & lt; String & gt; Temp: clon (sofar) push_onto (floating, "A") combos lift (cup A - 1, cup B, floating, list) // recurring temp: clone (sofar) push_onto (temp, "B") combos lift (Cup A, Cup B - 1, Temp, list) // recursion temp: clone (sofar) push_onto (floating, "AB") combos lift (cup 1a, cup bb-1, floating, list) // Function combosLeft (number form)      You can also create a cover function for the convenience  
  Cup in the form of a cup, B) as the list & lt; List & lt; String & gt; & Gt; List as list & lt; List & lt; String & gt; & Gt; As a list, soFar & lt; String & gt; CombosLeft (cup A, cup B, list, soFar) return list end function   

If you need more signals then just tell me good luck :)

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -