Search:

Type: Posts; User: geeksutopia

Page 1 of 2 1 2

Search: Search took 0.10 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,
    ...
  18. Replies
    10
    Views
    1,375

    Re: Binary Tree insert(int value) method

    Where is that?
  19. Replies
    10
    Views
    1,375

    Re: Binary Tree insert(int value) method

    Wait, where at?
  20. Replies
    10
    Views
    1,375

    Re: Binary Tree insert(int value) method

    Its supposed to walk the BinaryTree inOrder Traverse, and print out the array in that order, here is my modification to the insertMethod, it looks like it reads the root and and rightSubtree with the...
  21. Replies
    10
    Views
    1,375

    Re: Binary Tree insert(int value) method

    Its supposed to take the different arguments and print out the right and left subtree, problem is, it reads the root but returns null for both left and right subtrees
  22. Replies
    10
    Views
    1,375

    Binary Tree insert(int value) method

    So here is the code that I have. The problem is my insert method. It compiles, but it doesn't do so well in the test class I have set up for it.

    package SystemandDesign.BinaryTree;

    import...
  23. Replies
    4
    Views
    1,313

    Re: Binary Tree java test class.

    I realize it is taking the value that I am entering as a boolean, its just for this BinaryTree class, I have the faintest clue on how to insert a value(the testcase, not the actual class) into the...
  24. Replies
    4
    Views
    1,313

    Re: Binary Tree java test class.

    1 error and 4 warnings found:
    -------------
    *** Error ***
    -------------
    File: C:\Users\Carlos Satres\Documents\SystemandDesign\BinaryTree\BinaryTreeTest.java [line: 30]
    Error: The method...
  25. Replies
    4
    Views
    1,313

    Binary Tree java test class.

    So, managed to get my Binary Search Tree to work properly:


    package SystemandDesign.BinaryTree;

    import java.io.FileInputStream;
    import java.io.IOException;
    import java.util.List;
    import...
Results 1 to 25 of 32
Page 1 of 2 1 2