Oh thanks! I never though of that. It works perfectly now!
Type: Posts; User: sp11k3t3ht3rd
Oh thanks! I never though of that. It works perfectly now!
Hey, I'm trying to make a basic Map Editor and was wondering how to create multiple image objects based on a key event. In the program right now, the player moves around. When they hit enter, an...
Thanks! I added a while loop for while the file has another line. Then in that is an if statement where if the string is the next string in the file, it does what it's supposed to. Otherwise it goes...
I need a scanner to go through a file an see if it contains a certain string. Is there a method that I can use or am I out of luck? I essentially need a contains method but for the scanner and after...
I added a line that prints out the array elements. And here's what it prints out:
Does anyone have any ideas because I got really confused by putting this debug statement in.
It's because you have the line:
private static double NaN;
Then the value for that is never set and you start to return that value even though you never set it to anything. Also please use...
I don't understand what your trying to accomplish with this code. What do you want the code to do?
Hey, I just was playing around with the program and it only loads 1 thing from the text file. If you have more than 1 thing in it, it doesn't get loaded. Any ideas? I changed the code to this:
...
Oh, I was confused about what it meant by arc. Thanks!
Alright I'm making a text based calculator. As of right now it does addition, subtraction, multiplication, division, square roots, squares, sine, cosine, and tangent. I am wondering if there is the...
Thanks a ton! I would have never figured that out!
Thanks so much!
I meant that when I saved the array list to the file its format was [a,b,c]. I said that I knew you could take the brackets off after the file was saved (making the saved file look like "a,b,c") but...
This is the userInput class:
import java.io.*;
public class userInput {
String input = null;
public String getUserInput(String prompt) {
I saved a,b,c in the text file which came to [a,b,c]. When I loaded it did this:
I'm trying to work out a way to save stuff in a text based game i'm making. The players inventory is an Array List. I worked out how to save the contents of it to a txt file but I have absolutely no...
Okay I have 3 classes. One of them called player has an array list with two methods that can add and delete things from the array list. Another is called shop. The player array list has values set...
Never mind, I'm just going to keep it as it is. That way if anyone got a hold of the code they'd get tripped up a bit. :D
So use a loop with a position variable that increments each time it goes through all the characters? Suggestion on loop type?
Wow... :o I can't believe I didn't see that. Any suggestions on different values I could use or should I just make the capital letters the same as the lowercase letters?
This is all of my code. The weird thing is that I also am making the same program in C++. It uses the same changes (in both programs a gets changes to P1) but they both do it wrong, but in the same...
I'm changing my encryption program so that instead of numbers it uses a combination like D5 or A9. This will make it easier for the decryption part of the program. It's not working properly though....
Alright thanks! I might just take out the characters that are used in the Java Regex engine. This is only for my sophomore level science fair so it won't matter and I dont want peoples heads...
I'm making the encryption program mentioned in my other post. When I type all other character besides " ' /\ and . it works fine besides the question mark. It gives me this error when ever i type in...
Wow... :o...Thanks!