Win a copy of Spring Boot in Practice this week in the Spring forum!

Ryan Tracey

Greenhorn
+ Follow
since Jan 20, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ryan Tracey

Hmm I have an infinite loop lol must be to do with my flag not becoming false due to problem you mentioned :S.

Could you help me write what I meant?

I need a new array of my class Waypoints it should be 1/2 the size of the AListWP because that is where its reading in the info 2 at a time.

Then I made a for loop to populate the Waypoint array. The way I figured the logic on this was to increase i by 2 each time so I can use i to get out info sequentially from the AListWP ArrayList.

Then once j is the same as the size of the ArrayList it should end the while loop.

11 years ago
Ok here is my robot (still some unfinished methods) but I was wondering if you could tell me if:
1) The logic behind the pathfinding is correct? (See code below)
2) Am I correctly using distance :S?
3) Waypoint is a class I created of type Waypoint(int,int), I have an array of these. How do I input the next Waypoint for the move method - I assume this is done through the main Class is this correct :S?

11 years ago
Hey I edited the code above so it shows all the Class. The reason I didn't enter it though is because I made a random For Loop that should of run for plenty of time but stuck at the same error so I didn't want to throw uneccesary code :S.

As for the error I am getting -- The program compiles BUT when I run it the Try/Catch throws me the error from above :S.

I know when I get compile errors to try and hunt it down to the line and fix it NP but I have never really used Try/Catch lol and it's just giving me the error from above.

But as requested mate, the full Class is now there thanks for taking an interest!

/|RT
11 years ago
The error I am having here is that my code is only printing the first and second number from the file and it is set out like this
-------------------
12 2
? ?
? ?
? ?
? ?
? ?
-------------------
Without the ---- and I can only remember the 12 2 because they print, but everything else isn't appearing and it is letting me compile HOWEVER when it runs it catches an error that says "Error: Index 2:, Size: 2"

When I was just reading and printing the file using:

It was working correctly.


But this is the main code and the problem.
11 years ago
Thanks guys, didn't bother posting all code but you gave me the answer - sat here for hours coding and messing my eyes up missing simple things. Please feel free to help on my next questions :p...
11 years ago
Hey there Java Forums I don't know how to create an Array of my class Waypoints...

The format to build a Waypoint is (int,int)

11 years ago