Thread:SquareFingers/@comment-25827645-20141212102114/@comment-5334617-20141219041000

I still personally prefer the approach of having beginners think in integers

You don't say that anywhere. The assumption that everyone has the same simple-minded idea about health values - that they are integers - is unwarranted, and even insulting the intelligence of some of your readers, and confusing them. You're also showing them brittle code: even if the assumption of integer health values holds for the particular implementation coded by one developer, and the code runs fine and bug-free, that code will break if the next developer decides that health should be in units of one-tenth, rather than units of one. Don't start them out with bad coding habits, and making unstated assumptions and brittle code, start them out with good habits.

And whether dealing in integers or not, the value that partitions positive from negative is zero, so it's more natural to have the expression that partitions alive from dead have that value, zero, rather than another value that makes an assumption about the domain.

I should probably adjust the == TRUE again as you suggest.

I'm sorry if I didn't make myself clear, I was trying to suggest that as it is now (having  near the beginning and   later) looks good to me, I don't think it needs adjusting.

In Draft2, you're missing some  symbols, and one of your  s and some of your  s are not capitalized.

I would introduce  statement with the form that includes the variable name. Again: start them with good habits. It is good programming practice to be sure you know, for each end-of-loop line, what the corresponding start-of-loop line is. Afterwards, perhaps, indicate that the variable can be omitted, but where there is a tool to help you keep your code straight, it's best to use it unless there's a compelling reason not to.

You should reorganize the section:


 * If we wanted to print the values from 3 to 6, we would change the previous example to start
 * Each repetition of a loop is known as an iteration. This loop has 6 iterations (0,1,2,3,4,5).
 * Each repetition of a loop is known as an iteration. This loop has 6 iterations (0,1,2,3,4,5).

to:


 * Each repetition of a loop is known as an iteration. This loop has 6 iterations (0,1,2,3,4,5). If we wanted to print the values from 3 to 6, we would change the previous example to start

Otherwise "This loop" appears to be referring to  rather than.

You might want to mention that a  value of 0 can be used to make infinite loops without  s:

FOR FOREVER = 0 TO 1 STEP 0 ' Code that will run, over and over, forever NEXT FOREVER

Combining this with another concept you describe gives another structure that you might, or might not, want to include.

FOR STOP_LOOPING = 0 TO 1 STEP 0 ' Code that gets executed at least once ' if it should get executed another time, leave STOP_LOOPING alone ' if this is the last time, set STOP_LOOPING to 1 NEXT STOP_LOOPING