Ryan McNeely

Greenhorn
+ Follow
since Jun 10, 2010
Ryan likes ...
Mac
Merit badge: grant badges
For More
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 Ryan McNeely

Hey All,
I'm struggling with p 121 just like our original inquirer. It's the same code as above. I've figured them all out except for the insertion code: "x = x + 0"
Obviously I'm getting to know the nature of "break;". I also appreciate that there's a philosophy that says don't use breaks in loops. But I'm learning a lot from this problem anyway.

..........0...............1..................2
.....4...3...2......4...3...2......4...3...2
x...3...6...........3...6...........3...6....
y...28.26.........22.20.........16.14....
.........24.............18..............12.........

I include the last line here because the inner loop breaks at 2nd iteration of inner loop, bringing me to "y=y-2" in the outer loop.

I keep ending with x=6, y=12
The book says it should be x=6, y=14

life is green
Ryan
13 years ago