Forgot your password?
typodupeerror

Comment "License plate" increment problem. (Score 1) 962

A "license plate" increment problem: Incrementing a sequence like AAA, AAB, ..., AAZ, ABA, etc that goes up to ZZY, ZZZ, AAA, AAB, ... Have the kids figure out how to get Z's to roll over to A's in the next higher place WITHOUT using if statements. Great for showing number representation, character sets and how they map to integers, integer division and/or modulo operators, concepts of overflow, talking about how jumps can be avoided sometimes, etc. Saw it in a high school programming class. No idea where the teacher got it. Frustrating as all hell... :)

Slashdot Top Deals

Term, holidays, term, holidays, till we leave school, and then work, work, work till we die. -- C.S. Lewis

Working...