Thats true. I had this in my earliest effort where each bot had a score for each map. In the constructor I called it then fm1, fm2 ,fm3 , fm4 , fm5.
public class Bot {
public int fm1,...
Type: Posts; User: craigjlner
Thats true. I had this in my earliest effort where each bot had a score for each map. In the constructor I called it then fm1, fm2 ,fm3 , fm4 , fm5.
public class Bot {
public int fm1,...
Well thanks for your help on this one guys but I'm going to throw in the towell. I had a good read of the collections and map APIs and I think its too hard a problem to solve. I'm going to move on to...
I took what you wrote into account and everything. Unfortunately I still cant progress very far. I tried drawing the class relationships out on paper but I'm still stuck. Problem is when I try to put...
I am trying to write a program that organizes results from a tournament of computer games using bots. I want to do interesting things with the data like rank the bots on the results of each map,...
Well I did it :o Thanks Greg.
//FriendList.java
public class FriendList {
public static void main (String[] args) {
String [] friends = {"danny", "vic", "Laura", "Mike", "Jenny",...
//FriendList.java
public class FriendList {
public static void main (String[] args) {
String [] friends = {"danny", "vic", "Laura", "Mike", "Jenny", "Asrath"};
System.out.println...
The first for loop prints : Danny, vic , laura, mike , jenny, asrath.
I want the second for loop to print them in reverse like: asrath, jenny mike, laura, vic. Danny.
Hello again. I have an array of friends names and I want to print it in reverse. I know this question seems a bit lazy, but i really have tried casting the string as ints and even using lazy =...
1. I see what you mean : when i say Player1 = new Player (1, 0, 0) main should go to the Player class and find that the paraemters reprensent 'int location, int turns, int skipped'. However when I...
Hello JHoff93 I liked what your program was doing, so I have modified it a bit and opened a new thread called 'invoking method from another class' in this section which you might like to follow :o
Hi. I am a beginner still in Java. This is a 'chutes and ladders' game. It has 3 classes:
Players.java (contains main() )
Player.java (is basically the blue print for Player objects which will...
craig@craig-laptop:~$ cd Documents/panda/java3
craig@craig-laptop:~/Documents/panda/java3$ javac PigLatinTranslator.java
craig@craig-laptop:~/Documents/panda/java3$ javac PigLatin.java...
Hi Norm. :) Well after much experimenting I changed to translate(sentence); in the main method to translateWord(sentence); sort of bypassing the translate method entirely. I changed translateWord to...
This program is supposed to read a sentence of user input and translate it to piglatin by appending "yay" to a word beginning with a vowell and for words beginning with consonants or consonant blends...
I think I know what your saying. I should write a method in the Coin class, something like public void headCount () and declare headCount as a variable?
How do I write a method in the Coin class to...
Well I got there. I printed the state of each headCount object at the bottom of the code. And it shows me which one attained 3 and which one didnt. I am happy with that too, I just wonder is there a...
I am flipping two coins and the first coin that produces three HEADS in a row wins. The programme should terminate after a coin reaches this goal. And I want to know which coin it was and print a...
Ok so how can I pinpoint the integer at the position of pos and compare it to zero, even and odd ?
Hello there. Here is my task which I am stuck on:
"Design and implement an application that determines and prints the number of odd, even and zero digits in an integer value read from the keyboard."...
Thanks for your help, that worked a charm :o
Hi. Please review my code. I'm trying to use println to print an RRP variable of $79.99 for book1. But I think it cannot recognize it because RRP is declared in the Main class (Book.java) whilst I am...
Ok I have this sorted now Norm.:o Thanks for your help.
Ok I've got scruffy sorted :o
Now im trying to make a new dog Spot by doing this:
Spot = new Dog ();
Spot.setName (Spot);
but get error:
I've tried editing the constructor to this:
//constructor: initializes the instance data name and age:
public Dog ()
{
name = Scruffy;
age = 14;
}
Firstly thanks taking the time to help me out.
I can compile and run this program but where I want to print the Dogs name and age (with the toString method) it prints only the age, returning...