• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Game of life - coding from book

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to mess around with some code in my java book. I entered the code just as how it is in the book and it compiles, but it seems to never finish running. Is there something wrong with the coding that is causing it to never finish and print any output? Here is the code:

 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's look at the code together, OK? The first routine, of course, is "main()". What main does is declare and initialize a few variables, and then call readInitialGeneration().

readInitialGeneration() loops over the boolean array that's passed in, and does what, now?



Start typing, boy!
 
MP Olsen
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lol, I typed that code in so quick and looked at it and didn't realize that at all. The book didn't mention anything about inputing the symbols, and I never payed attention to that line when I coded it. Guess I'll have to edit it so I don't gotta type anything in.

Thanks for pointing out my ignorance, lol.
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic