Jack Fraser

Greenhorn
+ Follow
since Jul 08, 2013
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 Jack Fraser

Nevermind. I'm retarded.
7 years ago
I can't seem to use the methods in the subclass unless they are static.
7 years ago
A friend and I are currently working on an assignment and we are both stuck on the same spot with subclasses.

The superclass

The subclass.

And then trying to call the subclass from a method in another class


When the code is run (House1.getLength();) it says that the length is 0.0 when it should be 50.0.

Any help is appreciated.
7 years ago
My code is nowhere near finished and I will clean it up eventually by writing it in methods and such. Also, I have never used Enums before so... Yeah...

As for what you mean with the arrays and GUI, I have no idea what you mean either. :/
8 years ago
Don't worry about it. I made a stupid error which I have fixed now; I wasn't copying when nothing happens to the cell to the other array.

Thanks everyone for your help
8 years ago
And then there is the glider:
8 years ago
There isn't really a problem with the code as such, it's just that it's results aren't what I want and I don't know how to fix it. Here are some screenshots of my problems


8 years ago
Uhhhh, I've had another problem with my code, (t's to do with the copying and clearing of the arrays) and I'm not sure what I am doing wrong.



Thanks in advance for any help I get
8 years ago
Thanks for the help, I should be able to solve my problem now. Thanks
8 years ago
Ashish Dutt, I have always used 'revalidate();' in eclipse but it seems to have changed to 'invalidate();'. Thanks for the reply anyway.

Ulf Dittmer, I changed my code a bit and I spent a few hours looking around on the internet for someone who had the same problem as me. That was the exact problem that I had. One question, do I have to clear the one that I read from after I write it to the second?
8 years ago
The rest of the code (I changed it a bit in attempt of fixing it xD):
8 years ago
My problem:
So, I have been working on the Game of Life for a school project and I think I have gotten the algorithm for it wrong. Something like that.
I can't seem to figure out how to get things like gliders to work.

Whenever I make a glider, it just turns into a still life shape. (2x2 box). The same thing also happens for all of the oscillators.

Also, this is my first post so... If I'm doing this wrong, just let me know




array[o][i] is a 2D boolean array that stores if a cell is dead or alive and grid[o][i] is just the display in swing. (It's just an array of JPanels).
If you need any more code, just ask.

8 years ago