Search:

Type: Posts; User: geeksutopia

Search: Search took 0.18 seconds.

  1. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    package RiskProject;


    public class Card{
    //set for the Type of Countries
    public enum Country{ALASKA, ALBERTA, CENTRAL_AMERICA, EASTERN_UNITED_STATES, GREENLAND, NORTHWEST_TERRITORY,
    ...
  2. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    Well managed to get it to iterate through the list to get

    Just can't seem to figure out how to test if multiples of say ARTILLERY appears in the hand



    public boolean canTurnInCards(){
    ...
  3. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    With the current coding, an arrayList is being created, all I am trying to say with this is if the same enum(Infantry, Artillery, or Calvalry) appear three times in this ArrayList, then the statement...
  4. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    There is another class (class Player) which draws the cards and holds them. all it does is (riskCards.draw(Card)). So it holds the cards drawn.
  5. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    but wait shouldn't it be if there are three of a kind, the statement is true.
  6. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    import java.util.ArrayList;

    public class HandTest{

    public enum Arms{INFANTRY, ARTILLERY, CALVALRY};

    private final Arms arms;

    public HandTest(Arms arms){
    this.arms = arms;
  7. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    The reason for those errors is cause the class Card and the class HandTest are in the same package.
  8. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    package RiskProject;

    import java.util.ArrayList;

    public class HandTest{



    Card.Arms[] arm = Card.Arms.values();
  9. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    6 errors found:
    File: C:\Users\Carlos Satres\Documents\SystemandDesign\RiskProject\Hand.java [line: 32]
    Error: Arms cannot be resolved to a variable
    File: C:\Users\Carlos...
  10. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    package RiskProject;

    import java.util.ArrayList;

    public class Hand{

    private final ArrayList<Card> deck;
    public int MAXCARDS = 4;
    Card.Arms[] arm = Card.Arms.values();
  11. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    Tried it, and nothing. Got an Arms cannot be resolved to a variable
  12. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    The name of the enum is Arms, which I instantiated with


    Card.Arms[] arm = Card.Arms.values();


    And tried putting it into practice in the boolean using
  13. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    found out the answer to the return statement which is "return deck.get(index1);" which compiles correctly.

    Working on the canTurnInCards statement which I am using


    Card.Arms[]arm =...
  14. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    It's supposed to return an instance of the Card class, sort of what is in your hand now, The three cards that get removed are gone completely.
  15. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    Just implemented that and it compiles. Now the return statement is giving me problems.


    public Card removeCardsFromHand(int index1, int index2, int index3){
    deck.remove(index1);
    ...
  16. Re: Trying to make a Risk game, but I got stuck on the Hand class.

    The error is posted in the Hand class, I am stuck on the the remove cards from hand method. Just can't seem to figure out what to do here
  17. Trying to make a Risk game, but I got stuck on the Hand class.

    package RiskProject;

    public class Card{
    //set for the Type of Countries
    public enum Country{ALASKA, ALBERTA, CENTRAL_AMERICA, EASTERN_UNITED_STATES, GREENLAND, NORTHWEST_TERRITORY,
    ...
Results 1 to 17 of 17