Search:

Type: Posts; User: geeksutopia

Page 1 of 2 1 2

Search: Search took 0.50 seconds.

  1. 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...
  2. 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.
  3. 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.
  4. 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;
  5. 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.
  6. 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();
  7. 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...
  8. 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();
  9. 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
  10. 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
  11. 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 =...
  12. 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.
  13. 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);
    ...
  14. 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
  15. 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,
    ...
  16. Replies
    10
    Views
    209

    Re: Binary Tree insert(int value) method

    Where is that?
  17. Replies
    10
    Views
    209

    Re: Binary Tree insert(int value) method

    Wait, where at?
  18. Replies
    10
    Views
    209

    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...
  19. Replies
    10
    Views
    209

    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
  20. Replies
    10
    Views
    209

    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...
  21. Replies
    4
    Views
    147

    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...
  22. Replies
    4
    Views
    147

    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...
  23. Replies
    4
    Views
    147

    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...
  24. Thread: BinaryTree

    by geeksutopia
    Replies
    5
    Views
    120

    Re: BinaryTree

    3 errors and 3 warnings found:
    --------------
    *** Errors ***
    --------------
    File: C:\Users\Carlos Satres\Documents\SystemandDesign\BinaryTree\BinaryTree.java [line: 76]
    Error: Cannot make a...
  25. Thread: BinaryTree

    by geeksutopia
    Replies
    5
    Views
    120

    Re: BinaryTree

    getting 5 errors now:

    Cannot make static reference to the non-static field input
    " " list
Results 1 to 25 of 30
Page 1 of 2 1 2