http://i.imgur.com/qAKrNaN.png
http://i.imgur.com/I6BPjDZ.png
http://i.imgur.com/EJZr0ov.png
This question has confused me because "Errors" are capitalised and I'm not sure what they mean....
Type: Posts; User: JaAnTr
http://i.imgur.com/qAKrNaN.png
http://i.imgur.com/I6BPjDZ.png
http://i.imgur.com/EJZr0ov.png
This question has confused me because "Errors" are capitalised and I'm not sure what they mean....
I'm not sure how I would go about doing that as the string I'm using doesn't always begin with LOOKREPLY and always is followed by around 25 other characters.
Hi, I'm trying to loop through a string and depending on the character, add a JLabel to a game. The problem is the character 'L' represents a lantern but is also used in the reply the game gives...
EDIT: DON'T WORRY, I'VE FIXED THE PROBLEM!
Hi I've figured that out thanks! But now I'm having trouble printing a string in a grid. I've managed to create a string of the surrounding area and am...
Sorry, I don't understand why I can't use Map.matrix[playerX+i][playerY+j]. I thought I would need to use the player's X and Y coordinates to print the 5x5 of what is around the player. I'll show you...
There isn't a runtime error as I can't run it. But it wants me to change - char theLookMatrix[][] to just char theLookMatrix. If I do this then there are still more errors.
Hi, following on from my last question kind of, I'm trying to use a for loop to print out the 2d array that is around it. I'm trying to do this my creating a new 2d array of these coordinates but I'm...
Hi, I've nearly finished everything now, and it wouldn't have been possible without your advice, so thanks!
One last question. I have to make it so entering "LOOK" will reply with a 5x5 grid of...
Thanks I've got it working!
One more question. I've got the grid printing like:
# # # # # # # # # # # # # # # # # # #
# . . . . . . . . . . . . . . . . . #
# . . . . . . G . . . . . . . ....
I'm confused about the use of the String[] array. It seems like an overly complex way to do it. There's very few possible commands and they are:
HELLO
MOVE N
MOVE S
MOVE E
MOVE W
PICKUP...
Here's the code:
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
import java.util.Scanner;
Hi, I was wondering if you could help me with something else. I've done loads more since the last question and I've got a problem taking user input. I've got quite a few methods such as move, which...
I've managed to create an instance of the Map class in the GameLogic class and was just wondering if you could offer me some advice on implementing the player in the game. I'm not sure if the player...
I took your advice and removed the COLUMNS bit as it was causing me a few issues and your way of doing it was much better!
I was wondering if you could help me out with a few things. I've moved on...
I have just realised that I had overlooked something.
I need to be able to use any map that is written in the same form as the one I posted, so whilst that one was 9 rows by 19 columns they won't...
Right, I think I've got it working!
If you don't mind, could you just have one last look to check I've satisfied the requirements:
///Create a class Map that:
///Reads one of the sample...
Hi, I'm struggling a bit with this. I've tried what you said, but I keep getting errors. Here's the code I've got:
import java.io.BufferedReader;
import java.io.FileReader;
import...
I've renamed the variables M and N to columns and rows respectively. I think that's what they should be as you can see from the ASCII map there are 19 columns and 9 rows.
I've also tried printing...
Hi, I've written some code to do this, but it's not working as I expect and am at a loss on how to fix it.
This is what the ASCII map looks like:
###################
#.................#...
I think I've finally figured it out, but I'm not completely sure. I think I've got both the operands and operators in arrays, but as I've used different ways to get them in to the arrays I'm not sure...
Ok, i've read what you said and realised that you can't print an ArrayList like that. I've also read about printing an arrayList using a for loop and I've tried that but it's still printing...
Sorry I'm not sure I understand you when you say it needs to be an array not an arrayList? Surely it's better to use an ArrayList as I don't have to define how big it is?
Here is my code incase...
When I'm trying to print using that I'm getting the error "The method toString(long[]) in the type Arrays is not applicable for the arguments (ArrayList<String[]>)"
Eclipse is suggesting I change...
I've spent some time researching how to do it and I've come up with something but I've got a few issues. Here's the code:
public static Object[] parseInput(String stringCalculator)
{...
Sorry, I'm not sure exactly what you mean. I've already got the input split in to an array so what I really want to do is take all the characters that are +-/* from the array and put them in the...