Jeremy Anderson

Greenhorn
+ Follow
since Nov 02, 2004
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeremy Anderson

Got it working, thanks very much. Keep your helping hand warm, got another project started!
14 years ago
Thank you very much, I appreciate you taking time out of your day to help me. The only question I have is about the constants, since that was not included. I'm assuming that NORTH =1, NORTH_EAST=2, etc, etc, and that MAX_X and MAX_Y are both = 10. If that's the case, I can create the super class and let er rip. Thanks again!
14 years ago
I will try to give that a go, although I don't think that's the problem. The grid runs from -10/10 and -10/10, and the move method will subtract from the current coordinates as necessary (moving south). Thanks for the help so far, I will let you know how it goes.
14 years ago
I've been working on this program for a while now, and I can't seem to get it to work right.

Classes here

My problem is that I cannot get the cars to stay inside the "grid" no matter what I do. I've tried different methods to do it, the one I have now works "in theory" but I cannot produce the results on screen that I do when I run through the numbers in my head.

If someone could run through it and see if there is a logic error in there or if "in theory" just won't do it with this particular set-up, that would help a bunch.

Right now, I need some guidance becuase it's got me stumped. Thanks in advance guys!
[ December 05, 2004: Message edited by: Jeremy Anderson ]
14 years ago
I got another question, updated the classes on my storage space and would like to see if anyone can help me with this.

My problem is that I cannot get the grid to update the cars on the grid based on their coordinates. To me, it seems that everything is in order and it should be updated, but something must be wrong I'm not seeing.

If you guys wouldn't mind taking another look, I would really appreciate it. I'm going to talk to my teacher anyway no matter what tomorrow, but this may help me eliminate one problem and maybe give me a chance to ask him about another that comes up (and with this project, they will.) Thanks again guys!
14 years ago
Sure thing, didn't see that rule. Hope all is well now!
14 years ago
It's probably a little bit of both of us that needs help. I understand where she is coming from, but I'm too stuck to get out of this one. I almost have it, and I appreciate all your help.
14 years ago
OK, got it to play and have it running to the point of where I can pick the integers to play. I must have a logic error in the displayGrid method, it's only showing up one line at a time. I'm running through it right now to find the error, having no luck. Thanks for the help so far, I really appreciate it!
14 years ago
I appreciate the quick help, It helped me a great deal. The only problem I am having is that I still get the nullpointerexception error when I try to run my game driver class- (basically main method with

inside to begin the game.

I have no idea where this is coming from, can't figure out how things aren't working. I get the error in the game class, at the point where it says



If you happen to catch anything else, I would appreciate it. May just have to sit my teacher down and say that I am completely lost and that I REALLY NEED HELP! She has a policy to let students learn on their own, but I am just too stuck on this one.
[ November 02, 2004: Message edited by: Mr Anderson ]
14 years ago
I'm sorry in advance if this is a stupid question, but I cannot seem to get this program of mine to work. The goal of the program is to get acquainted with creating our own classes, and I can't seem to get some of it to work. I'm not sure if I should post all the code here- it would probably take up too much room, so I will add it and externally link.

Here are the main classes of my program:

Classes here

I will have a "Game driver" class with a main method to run the playGame method in the game class to make it run. The assignment is to have two bumper cars on a grid from -10 10 on both the x and y axis- we are supposed to generate a random length and direction for movement and make the cars "bouce" off the wall if they are to go outside the boundary.

I am getting an error on the Grid class at:
System.out.print("What integer would you like to. . . : ");
car1ID = scan.nextInt();

saying it "cannot find symbol" with the car1ID highlighted.

Other than that, I can't find anything wrong. Only problem is, it would successfully compile before I made a few changes to the Game class- I was getting the wonderful nullPointerException error and tried to fix it- and I ended up making it worse.

The program is pretty much done and seems like it should work (in theory) but I can't even get to the point where I can test it. If you guys have any ideas as to what is wrong, I would really love to hear them. I'm completely lost right now. Thanks in advance guys!
[ November 02, 2004: Message edited by: Mr Anderson ]
14 years ago