Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First 2nd edition Code Magnets

 
Ted Kaz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I give away the ranch with a dash of code. Is it possible that the Code Magnets scramble on page 20 have a certain line of code that needs to be duplicated to get the proper output?
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. One of the magnets needs to be used twice in order to produce the correct results. This is not reflected in the solution shown on page 25. (Entering the code on pg 20 does result in incorrewct ouput). The "problem" then becomes by reusing that one magnet, the while loop beomces unneccessary since you only "loop" through it one time.
 
Ted Kaz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have no idea how good that makes me feel :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic