Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Chess Board Single Loop

by davido (Cardinal)
on Oct 03, 2013 at 23:39 UTC ( [id://1056817]=note: print w/replies, xml ) Need Help??


in reply to Re: Chess Board Single Loop
in thread Chess Board Single Loop

In week one or two of intro to CS at a community college level, students may not have been introduced to the concept of arrays, nested loops, unpack templates, map, and so on. However, anyone with grade-school math in their past understands remainders with integer division (ie, the modulus operator). What's amazing is that such a simple thing, taught in 4th grade, is useful to low-level-language programmers even today when using arithmetic to simulate multi-dimensional structures in flat memory.


Dave

Replies are listed 'Best First'.
Re^3: Chess Board Single Loop
by marinersk (Priest) on Oct 04, 2013 at 11:48 UTC
    Ironically, all my math teachers in elementary school glossed over the chapters which covered other bases (generally base 12 for the clock and we were done) and completely skipped over modulo operations.

    I first learned about the concept of "modulo" in my first programming course in high school -- and that was taught after nested loops.

    It's funny how we keep having to learn that the rest of the world didn't have our life experiences; they had their own. To me, nested loops seems like the third thing you learn in programming; to you, knowing modulo seems like a 4th grade thing.

    Excellent post, davdio, as always.

    Update: After posting this, I see a metric ton of the same approach being done, including re-reading one of your prior posts, davido, and realize that the code snippet was unnessesary.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1056817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found