Teaching our five year old to code by cheating
I&#x27;ve done something a bit like this for &quot;career days&quot; for elementary school kids.  I coded up a perl script that was basically something like this:<p><pre><code>    #!&#x2F;usr&#x2F;bin&#x2F;perl
    $score = $ARGV[0]

    if ($score &gt; 90) {
        print &quot;A&quot;;
    elsif ($score &gt; 80) {
        print &quot;B&quot;;
    elsif ($score &gt; 70) {
        print &quot;C&quot;;
    elsif ($score &gt; 60) {
        print &quot;D&quot;;
    } else {
        print &quot;E&quot;;
    }
</code></pre>
And I&#x27;d ask, &quot;What do you think happens if you put in &#x27;85&#x27;?  What about 10000?  What about -30?&quot;  If the group I was talking to seemed pretty sharp on the uptake, I&#x27;d ask, &quot;If you wanted to hack it so that people who got 95 got an E, and people who got 50 got an A instead, what would you do?&quot;<p>The kids really seemed to enjoy that.  Apparently they even told the teachers I was teaching them to hack programs -- a bit concerning for the teachers, but mission accomplished as far as I&#x27;m concerned.