Lucas Carbon

Greenhorn
+ Follow
since Sep 03, 2019
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
1
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lucas Carbon

Liutauras Vilda wrote:I read those instructions you posted. Don't know if it is fair to ask, but did you understand them well? I find them quite difficult to understand and get a picture in my head, but maybe because I got used to other wording of the instructions.

Have a look at those found on Wikipedia here, and in particular read the rules. Is your understanding the same comparing to those you were given?




So the way this project went is we did it in steps. The first part was getting the first iteration to print. Which didn't include an updating step, just randomizing boolean values within a border of false boolean values. And I know i had that 100% correct because I was graded for it. But now i'm at the part where I need to start updating the matrix based on the rules i was provided. And thats where it got messy. This is the point where I know things were correct and running.

https://pastebin.com/vRURz9XX

Since then I've changed a lot of stuff based on advice and help from others.
2 weeks ago

Liutauras Vilda wrote:@OP

subject line wrote:Trouble on simple Conways Game of Life project


This project isn't that simple if you think carefully. People don't get stuck on simple things. It may look simply implemented, but behind such implementation possibly are days of planning and experimenting (for me it was weeks, with help of fellow ranchers here).

In the way you wrote this program, isn't simple at all, and I personally wouldn't be able to fix this program by tracking down what index overlooked, or counter wrongly incremented or something else.

Take Junilu's advice very seriously, that will be usefull not only in solving this problem, but will be beneficial throughout your programmer's career if you ever going to specialise in it.

If I were you, I probably would open fresh project start over. Or would start overriding this project's pieces.



Thanks for the input, I will consider this heavily.
2 weeks ago

Liutauras Vilda wrote:

Lucas Carbon wrote:No template just written instructions.
These are the instructions:...


Thank you for the instructions.

How far have you gone with your studies? Is it your first year? Covered some object oriented programming concepts yet?



First year. Scratched the surface of OOP. But for this assignment it's specifically just supposed to be static methods. Unfortunately.
2 weeks ago

Liutauras Vilda wrote:Were you given some template to work on, or that is all you wrote?



No template just written instructions.
These are the instructions:
https://imgur.com/a/VMuGdtY
2 weeks ago

Carey Brown wrote:



Hmm... that seems to be getting closer. I implemented that as well now and it kept the border which is perfect, but now the insides are updating wrong after the first iteration. It repeats full true for the innner, and full false for the inner consecutively. Could it possibly be a bad product of the cloneArray method?
2 weeks ago

Carey Brown wrote:Your neighborhood is always 3x3. No need to use .length.




I attempted this and it gave me an output of this.
6
8
7
=  =  =  =  =  =  =  =
=  O  O  O  =  =  =  =
=  O  O  O  O  =  O  =
=  =  =  O  O  =  O  =
=  O  =  O  =  O  O  =
=  =  =  =  =  =  =  =

=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =

=  =  =  =  =  =  =  =
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O

=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =

=  =  =  =  =  =  =  =
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O
=  O  O  O  O  O  O  O

=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
=  =  =  =  =  =  =  =
2 weeks ago
I thought I had finally completed the project but my matrix's are generating incorrectly and I cant figure out why.
These are my specifications.
"The game is thus parameterized by the particular population density ranges that allow organ-isms to be born or to continue to thrive.  Each cell has eight neighbors (above, below, left, right, and four diagonals).  Thus, if you count the cell as well, there are nine cells in its neighborhood.  Fora birth to occur, the cell must be empty and the neighborhood density be in the birth range.  The birth range can be given as two integers from 1 to 9, birthLow and birthHigh, so that a birth will occur if the cell is empty and the neighborhood population is at least birthLow and no more than birthHigh.  Similarly, a death occurs in a cell if there is an organism there and the neighborhood has less than the minimum population for survival, or greater than the maximum.  Hence there is a live range provided as two integers from 1 to 9, liveLow and liveHigh.  The border of the area is not compatible with life, so the top and bottom rows and the left and right columns will never have organisms"

Incase there is a problem with my current code I'm going to show the entire thing.
The problem I believe lies in the updateMatrix method.



This is what it is currently printing.


Any help is appreciated!


edit: The matrix's look a little wonky but it's supposed to be in the shape of a rectangle.
2 weeks ago
If I type a negative number in, it still comes out as negative and I don't know why.


2 weeks ago