Search:

Type: Posts; User: DarkestLord

Page 1 of 2 1 2

Search: Search took 0.24 seconds.

  1. Replies
    4
    Views
    75

    Re: I need help with a Map assignment

    Well I'm just wondering if anyone with experience can make more sense of these directions than me and give me a nudge in the right direction. It's not so much of an issue with compiling as it is know...
  2. Replies
    4
    Views
    75

    Re: I need help with a Map assignment

    Both are currently compiling just fine.

    Right clicking on MapTile gives me the option to make a new "MapTile()". From there I can do a "void setByDescription()". This brings up a pop up window...
  3. Replies
    4
    Views
    75

    I need help with a Map assignment

    Part one of my post will discuss the assignment and part two of my post will have my current code.

    ~~~

    Instructions:

    You are to write a program called MapTest. The program will use a new...
  4. Replies
    8
    Views
    139

    [SOLVED] Re: Method isn't showing up

    But on the top isn't the line "Weapon[] monsterWeapons = {greatAxe, handAxe};" good enough here?

    Edit: Figured it out. Misplaced the array on the Monster class for weapons.
  5. Replies
    8
    Views
    139

    [SOLVED] Re: Method isn't showing up

    OK, current code is this:



    Orc.rollWeaponAttacks();
    int [] orcWeapon1 = Orc.rollWeaponAttacks();
    System.out.println("an ID "+ java.util.Arrays.toString(orcWeapon1));
    ...
  6. Replies
    8
    Views
    139

    [SOLVED] Re: Method isn't showing up

    Oh sorry, I replaced this:


    for(int e = 0; e < 20; e++)
    {
    for(int i = 0; i < Orc.monsterWeapons.length; i++)
    {
    ...
  7. Replies
    8
    Views
    139

    [SOLVED] Re: Method isn't showing up

    OK, I removed the code and replaced it with calling the method and a println() of said method. It showed up this time, but it gave me a bunch of gibberish. It said It said "Weapon's Attack is:...
  8. Replies
    8
    Views
    139

    [SOLVED] Method isn't showing up

    I'm trying to get this MonsterTest to show me the weapon attacks of my rollWeaponAttacks(); method, but it doesn't show up.

    This is my monster class:


    import java.util.Random;
    public class...
  9. Replies
    1
    Views
    112

    Having trouble with a method

    I'm having trouble with this method "rollWeaponAttacks".


    public int[] rollWeaponAttacks(){
    int [] returnInts=new int[monsterWeapons.length];
    for(int i=0; i<monsterWeapons.length; i++){...
  10. Replies
    11
    Views
    221

    Re: Need help creating an array method.

    Yeah, calling it twice would be the simple solution but...this is an assignment and it asks for me to make an array method that allows me to use as many weapons as the user wants. The test would just...
  11. Replies
    11
    Views
    221

    Re: Need help creating an array method.

    Sorry, I'm still pretty new at this. ^^; But...that's all it says. It just highlight "total" under those two and says "compatible types". I think it's because of the [] I added on those ints.
    ...
  12. Replies
    11
    Views
    221

    Re: Need help creating an array method.

    It highlight "total" under the WeaponAttack and WeaponDamage methods and says "incompatible types".
  13. Replies
    11
    Views
    221

    Re: Need help creating an array method.

    Yeah, I compiled and apparently it's incompatible. But that's the problem. I first need to figure out how to make it compatible.
  14. Replies
    11
    Views
    221

    Re: Need help creating an array method.

    Basically I'm supposed to get a random number between 1-20 but I need it for multiple weapons. One could get 5, another 13, and a third could get 17, etc.
  15. Replies
    11
    Views
    221

    Need help creating an array method.

    I need help creating an array method for my monster class. The monster is going to have multiple weapons and I need to figure out how to get attack and damage from all of them.


    /**
    * Write a...
  16. Replies
    13
    Views
    191

    Re: Boolean Method Problem

    Ahhh...but...what makes them new? They are called the same thing in each question? I tried removing "boolean" in front of the question variables, but the problem remains. Is it something else that...
  17. Replies
    13
    Views
    191

    Re: Boolean Method Problem

    OK, updated the detector and the test...

    Currently the program is still telling me the item is cursed no matter what though. I think the problem is in the test, but I'm not sure what it is...
    ...
  18. Replies
    13
    Views
    191

    Re: Boolean Method Problem

    OK, this IS the problem. It's connected to the input somehow. If I do true, true, true, true, true, the fifth "true" for "Summons Monsters" is always true, which means the item is always cursed. I...
  19. Replies
    13
    Views
    191

    Re: Boolean Method Problem

    Oh! I wasn't familiar with &&! Thanks! The program still isn't working, but this is very helpful!

    Hmmm...the only other thing I can think of is the way I coded the test. When I call the method, I...
  20. Replies
    13
    Views
    191

    Re: Boolean Method Problem

    Uhhh how would I go about this? ^^;



    Could you give me an example? I'm still learning things like this.
  21. Replies
    13
    Views
    191

    Boolean Method Problem

    I'm writing a program called Curse Detector. The idea is that you answer 5 questions and this program tells you if an item is cursed.

    The item is cursed if:
    1) The item adds +6 or less to the...
  22. Re: Weapons Test fails under certain conditions

    Thank you for the truth table, but is there a way to make it bigger? I'm having trouble reading it. ^^; Also, what do the -1s mean?
  23. Weapons Test fails under certain conditions

    I'm making a Weapons Class and a Weapons Test.

    The Weapons Class gives me the damage power of each weapon (which changes each time) and the Weapons Test is supposed to show me the value and tell...
  24. Replies
    6
    Views
    148

    Re: Trouble adding an object.

    I see...I'm also trying to list equipment, add equipment, and remove equipment. The equipment class looks like this:


    public class Equipment
    {
    private String name;
    private int weight;
    public...
  25. Replies
    6
    Views
    148

    Re: Trouble adding an object.

    I see...but how would I put it in the backpack from the method? This is what I have so far:



    public class Backpack
    {
    private Canteen theCanteen;
    private Equipment[] theEquipment;
    Backpack()...
Results 1 to 25 of 49
Page 1 of 2 1 2