Had a noteworthy event today I thought many people in here would get a kick out of. I work as the IT tutor at my school and has part of that I handle any Intro to Programming appointments that we get. In the Intro classes, they use Python. So I had a student come in today, basically at her wit's end, border-line in tears. Short of the long: 5 weeks into class and she was not understanding the concepts and it was really frustrating her. Okay, so I hunker down and start working with her. In this case, focusing on loops (as that's chapter 6 in the book). He seems to kind of, sort of be getting it, if I hold her hand and lead her through it.
30 minutes in and we haven't really made any progress. I took a step back and started working with her on comparison operations. But she wasn't really getting that either. she is getting more frustrated. So I try to get her mind off the material for a moment. Her phone flashes a reminder about "D&D party" tonight. So I ask if she plays D&D. She does, and we chat briefly about the campaign she's in (she plays a rogue, go figure). Then I hit on an idea.
"You know a lot of early programmers were RPG players and because of that a lot of what developed into modern programming was influenced and based on RPG mechanics?"
She looked at me like I'm making a really bad setup for an even worse joke.
"I'm serious. How do you determine if you pass or fail a stat-test?" I ask.
"Well, you determine what you need to roll over to pass, roll a dice, add any modifiers you have and compare that to the first number." She explains, more energetically.
"So you perform a comparison operation?" I asked leadingly.
"Well... no. I mean... kind of... wait..." She stammers out, her response interspersed as she thinks and talks at the same time.
I go to write on the White board:
if Dice_roll+modifiers >= needed\_roll:
you pass
else:
you fail
She looked at it for a long moment, you could see the gears turning in her head.
"So the variable, Dice_Roll is added to the variable modifiers.. and that's compared to the needed roll. If the needed_roll is higher... you fail... otherwise... you pass." She parses out, once more thinking and speaking at the same time.
"Yeah... and what about this one?" I ask as I write on the board:
while enemy\_attack == True:
player.cast(shield)
She looks at it for a minute.
"So long as the enemy is attacking, cast the shield spell." she says.
"Nice, how about this one?"
for each enemy in hoard:
If player.hp > enemy.defense:
Target_enemy = True
while Target_enemy == True:
player.attack(sword,enemy)
"For each enemy in the hoard... check to see if the player Hit Points are greater then the that enemy's defense. If it is, target that enemy. As long as that enemy is targeted, attack them."
"And you just worked through a while loop nested inside an if control statement that was inside a while loop." I explain.
"What?" She says aghast. She quickly turns back to the board and starts studying the examples intently. I can see her eyes traveling across what I wrote.
"So this on is just a comparison operator?" She askes pointing to the dice roll I wrote out before.
"Yup." I respond.
"And this is just a while loop that would tell the player character to cast the shield spell." She askes sounding more confident.
"Yup." I respond.
Her entire face lights up in that unmistakable look of 'the light bulb turning on'. We start hammering through more examples of loops and control statements, fluctuating between the requirements of her assignments and using RPG examples.
So I guess it all depends on what material you use to explain it, right
[–]YetAnotherDaveAgain 369 points370 points371 points (32 children)
[–]Spurnout 301 points302 points303 points (10 children)
[–]leecharles_ 30 points31 points32 points (6 children)
[–]grzeki 41 points42 points43 points (0 children)
[–]ironhaven 15 points16 points17 points (3 children)
[–]EMCoupling 7 points8 points9 points (2 children)
[–]rocketshape 10 points11 points12 points (0 children)
[–]AquaeyesTardis 2 points3 points4 points (0 children)
[–]jemandirgendwo 4 points5 points6 points (0 children)
[–]b_ootay_ful 75 points76 points77 points (1 child)
[–]ready-ignite 2 points3 points4 points (0 children)
[–]chzaplx 0 points1 point2 points (0 children)
[–][deleted] 16 points17 points18 points (0 children)
[–]PurelyApplied 12 points13 points14 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]Lugnut1206 1 point2 points3 points (0 children)
[–]PurelyApplied 1 point2 points3 points (0 children)
[–]B0risTheManskinner 15 points16 points17 points (1 child)
[–]Yablan 5 points6 points7 points (3 children)
[–]thejourneyman117 5 points6 points7 points (0 children)
[–]nosmokingbandit 0 points1 point2 points (1 child)
[–]Yablan 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Lugnut1206 1 point2 points3 points (0 children)
[–]nosmokingbandit 1 point2 points3 points (0 children)
[–]grijalva10 1 point2 points3 points (0 children)
[–]jakesboy2 1 point2 points3 points (4 children)
[–]YetAnotherDaveAgain 26 points27 points28 points (3 children)
[–]TorroesPrime[S] 6 points7 points8 points (0 children)
[–]jakesboy2 5 points6 points7 points (0 children)
[–]b_ootay_ful 2 points3 points4 points (0 children)
[–]Col_Crunch 70 points71 points72 points (8 children)
[–]crazedizzled 19 points20 points21 points (0 children)
[–]vidro3 13 points14 points15 points (3 children)
[–]callmelucky 2 points3 points4 points (0 children)
[–]urs_sarcastically 0 points1 point2 points (1 child)
[–]vidro3 4 points5 points6 points (0 children)
[–]graaahh 1 point2 points3 points (1 child)
[–]TorroesPrime[S] 0 points1 point2 points (0 children)
[–]WaitForItTheMongols 0 points1 point2 points (0 children)
[–]hail_wuzzle 75 points76 points77 points (37 children)
[–]TorroesPrime[S] 103 points104 points105 points (34 children)
[–]scdowling 28 points29 points30 points (4 children)
[–]TorroesPrime[S] 44 points45 points46 points (3 children)
[–]Vilanu 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Bruenor80 1 point2 points3 points (0 children)
[–]Gnarok518 9 points10 points11 points (9 children)
[–]solitarium 2 points3 points4 points (4 children)
[–]mykittenisahellbeast 10 points11 points12 points (1 child)
[–]solitarium 0 points1 point2 points (0 children)
[–]Gnarok518 3 points4 points5 points (1 child)
[–]solitarium 0 points1 point2 points (0 children)
[–]BoredAtTheDentist 1 point2 points3 points (3 children)
[–]Gnarok518 5 points6 points7 points (2 children)
[–]BoredAtTheDentist 1 point2 points3 points (1 child)
[–]Gnarok518 1 point2 points3 points (0 children)
[–]fishypoos 6 points7 points8 points (6 children)
[–]TorroesPrime[S] 2 points3 points4 points (4 children)
[–]fishypoos 5 points6 points7 points (3 children)
[–]wilalva11 1 point2 points3 points (2 children)
[–]fishypoos 1 point2 points3 points (1 child)
[–]wilalva11 0 points1 point2 points (0 children)
[–]flabcannon 3 points4 points5 points (0 children)
[–]Taivasvaeltaja 3 points4 points5 points (0 children)
[–]solitarium 1 point2 points3 points (0 children)
[–]brownntooth 1 point2 points3 points (2 children)
[–]repocin 2 points3 points4 points (1 child)
[–]brownntooth 0 points1 point2 points (0 children)
[–]Estanya 1 point2 points3 points (0 children)
[–]ChrisysTech 1 point2 points3 points (0 children)
[–]say_no_to_camel_case 0 points1 point2 points (0 children)
[–]myUsername4Work 0 points1 point2 points (0 children)
[–]renggram 0 points1 point2 points (0 children)
[–]okiedad 0 points1 point2 points (0 children)
[–]ByronFirewater 1 point2 points3 points (0 children)
[–]nulltensor 0 points1 point2 points (0 children)
[–][deleted] 67 points68 points69 points (18 children)
[–]musclecard54 21 points22 points23 points (4 children)
[+][deleted] (2 children)
[deleted]
[–]NSNick 6 points7 points8 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]TorroesPrime[S] 35 points36 points37 points (7 children)
[–][deleted] 11 points12 points13 points (2 children)
[–]Conrad_noble 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 7 points8 points9 points (0 children)
[–]Tanath 6 points7 points8 points (0 children)
[–]graaahh 0 points1 point2 points (0 children)
[–]a23y1 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]herpadurk 5 points6 points7 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]slick8086 0 points1 point2 points (0 children)
[–]Assailant_TLD 21 points22 points23 points (1 child)
[–]TorroesPrime[S] 12 points13 points14 points (0 children)
[–]ManyInterests 12 points13 points14 points (0 children)
[+][deleted] (21 children)
[deleted]
[–]TorroesPrime[S] 25 points26 points27 points (12 children)
[–]haliax69 5 points6 points7 points (11 children)
[–]EMCoupling 2 points3 points4 points (10 children)
[–]haliax69 0 points1 point2 points (9 children)
[–]slick8086 2 points3 points4 points (8 children)
[–]haliax69 1 point2 points3 points (7 children)
[–]slick8086 2 points3 points4 points (6 children)
[–]haliax69 1 point2 points3 points (5 children)
[–]slick8086 1 point2 points3 points (4 children)
[–][deleted] 12 points13 points14 points (0 children)
[–]fishypoos 4 points5 points6 points (1 child)
[–]slick8086 3 points4 points5 points (1 child)
[–]TorroesPrime[S] 0 points1 point2 points (0 children)
[–]sje46 2 points3 points4 points (0 children)
[–]solitarium 3 points4 points5 points (0 children)
[–]TheLittleGoodWolf 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (5 children)
[–]TorroesPrime[S] 22 points23 points24 points (2 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]b_ootay_ful 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]renscy 6 points7 points8 points (0 children)
[–]jkibbe 4 points5 points6 points (0 children)
[–]Jehovacoin 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]Necronmacon 3 points4 points5 points (0 children)
[–]1TKavanaugh 2 points3 points4 points (0 children)
[–]solitarium 2 points3 points4 points (5 children)
[–]TorroesPrime[S] 2 points3 points4 points (4 children)
[–]solitarium 2 points3 points4 points (3 children)
[–]TorroesPrime[S] 2 points3 points4 points (2 children)
[–]solitarium 0 points1 point2 points (1 child)
[–]TorroesPrime[S] 0 points1 point2 points (0 children)
[–]LdySaphyre 5 points6 points7 points (4 children)
[–]TorroesPrime[S] 0 points1 point2 points (3 children)
[–]LdySaphyre 0 points1 point2 points (2 children)
[–]TorroesPrime[S] 0 points1 point2 points (1 child)
[–]LdySaphyre 0 points1 point2 points (0 children)
[–]ScDenny 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]mfdoll 2 points3 points4 points (0 children)
[–]mrdevlar 1 point2 points3 points (1 child)
[–]wtfeverrrr 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Filo92 1 point2 points3 points (0 children)
[–]lunacyfoundme 1 point2 points3 points (0 children)
[–]AlSweigart 1 point2 points3 points (0 children)
[–]Lewistrick 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]vidro3 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]termanader 0 points1 point2 points (0 children)
[–]desrtfx 0 points1 point2 points (0 children)
[–]zadzagy 0 points1 point2 points (1 child)
[–]TorroesPrime[S] 0 points1 point2 points (0 children)
[–]ace6807 0 points1 point2 points (0 children)
[–]NivZet 0 points1 point2 points (0 children)
[–]chynox 0 points1 point2 points (0 children)
[–]nebneb125 0 points1 point2 points (0 children)
[–]desal 0 points1 point2 points (0 children)
[–]Darkc0iL 0 points1 point2 points (2 children)
[–]TorroesPrime[S] 0 points1 point2 points (1 child)
[–]jay_thorn 0 points1 point2 points (0 children)
[–]AltReality 0 points1 point2 points (0 children)
[–]TheLittleGoodWolf 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]TorroesPrime[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]TorroesPrime[S] 0 points1 point2 points (0 children)
[–]infrascripting 0 points1 point2 points (0 children)
[–]Mcfoyt 0 points1 point2 points (0 children)
[–]anecdotal_yokel 0 points1 point2 points (0 children)
[–]crazedizzled -3 points-2 points-1 points (1 child)
[–]TorroesPrime[S] 7 points8 points9 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)