logs/hcl_0613014.log

Jun 13 20:09:43 EDT 2001

Hail.prb

Code/Notes Sp # Utterance
T 2 Go ahead and read the web pages. A "done" button will appear when you've viewed all the pages.
S 5 The ground state is 4 2 1 4 2 1 ... ?
T 6 yep.
T 10 Ok let's do an example together.
T 11 If we start with 6 what comes next?
S 12 3
T 13 Good. After that?
S 14 10
T 15 Right. next?
S 16 5
T 17 Cool... can you enter the rest?
S 18 16
S 19 8
S 20 25
T 21 whoops!
T 22 after 8?
S 23 4
S 24 2
T 25 good. Any more?
S 26 1
T 27 then we're in the what state?
S 28 ground state
T 29 good job.
T 30 Would you like to do another example or move on?
S 31 move on. I know that 8 is even.
T 32 Ok sounds good.
T 33 Suppose you were writing a program to do hailstone sequences. What would the first step be?
S 36 decide if the first number is odd or even
T 37 we will need to do that you're right but what number?
S 38 get a number from the user first
T 39 That's right. I'm going to create a tile for that.
T 40 (tile created) get a number from the user first
S 43 (tile placed)
T 44 alright! Now we'll go to odd or even. Which one do you like best?
T 45 (we can't do both at once unfortunately)
S 46 even
T 47 Ok so can you phrase it as a program step?
S 48 determine if number is even
T 49 just a slight modification of your phrase but basically the same thing.
T 50 (tile created) if number is even
S 52 (tile placed)
T 53 Great. What do we do in this case?
S 54 divide number by 2
T 55 (tile created) divide number by 2
S 57 (tile placed)
T 58 as you probably know we need an "else" tile...
T 59 (tile created) else
S 61 (tile placed)
T 62 What step do we do in the else?
S 63 multiply number by 3 and add 1
T 64 (tile created) multiply number by 3 and add 1
S 66 (tile placed)
T 67 Just checking... the "else" part covers what case (of the number)?
S 68 oddness
T 69 great!
T 70 Ok so let's take a look at what we have.
T 71 Does this code segment generate an entire hailstone series?
S 72 no it just considers one number and produces another
T 73 That's right! So what modification do we need to make?
S 74 we need a loop to calculate the next numbers in the series until we reach the ground state
T 75 Yep. Let's focus on the loop condition for a moment... when do we stop?
S 76 when we see the 4 2 1 pattern
T 77 Just a side note we can't get to 2 or 1 unless we pass by 4 first. Do you see that?
S 78 yes. so we're just on the lookout for 4.
T 79 bingo. Of course a dumb user could enter 2 or 1 to start but we'll not consider that.
T 80 Can you rephrase "until we reach the ground state" with a little more specificity?
S 81 stop when number is equal to 4
T 82 I'll rephrase it just a tad but it is still totally correct!
T 83 (tile created) end loop when number is equal to 4
T 85 so this goes at the BOTTOM of your loop.
S 86 (tile placed)
T 87 Now we have to think about where the loop will start. Any ideas?
S 88 above the if statement after we get the initial value for number
T 89 good. We certainly don't want to ask the user for a new value every single time through
T 90 (tile created) start the loop
S 92 (tile placed)
T 95 Here's the tile you'll have to do some moving around.
S 97 (tile placed)
T 98 good! I was just about to ask you to line that up.
T 99 So we now have a program that will create hailstone sequences.
T 100 What should we tackle next?
S 101 how many number there are in the sequence
T 102 good idea. How should we proceed with that?
S 103 keep a counter inside the loop and add 1 to it each time through
T 104 right on. Let's break it apart. To keep a counter we have to start it off somehow.
S 105 counter begins at 0
T 106 (tile created) counter begins at 0
S 108 (tile placed)
T 109 that's also referred to as "initializing" the counter FYI
T 110 Then what do we do inside the loop? to the counter?
S 111 add 1 to the counter could go anywhere inside the loop
T 112 almost... it can't go inside the if or the else
S 113 I mean either before or after the conditional statement
T 114 Good sorry I was too quick there.
T 115 we usually say "increment" to mean "adding one". Here's the tile. Go nuts.
T 116 (tile created) increment counter
S 118 (tile placed)
T 119 looking good!
T 120 What is left to do with this counter?
S 121 report to the user how many numbers it counted
T 122 (tile created) report to the user how many numbers it counted
S 124 (tile placed)
T 125 cool. Let's do a little rearrangement before going on...
T 126 the increment tile is inside the loop so it should probably be moved over a tad
S 128 (tile placed)
T 129 nice. It is not in the else so we line it up with the else
T 130 Then the "report" tile happens at the same level (immediately after) the loop so it should probably be lined up with the end loop tile.
S 132 (tile placed)
T 133 Looking good. This alignment will be important for the last stage of the tutoring session.
T 134 So what's left to do now? Anything?
S 135 determine which number was the largest in the sequence
T 136 right. This is a little more involved than the counter.
T 137 Like the counter we need to start it off somehow.
S 138 we need a variable to hold the largest number so far. can set it equal to the first number to start out
T 139 that's right. the "so far" part is key to getting it to work.
T 140 Can you reprhase that "set it equal to" part for a tile?
S 141 initialize largest number so far to number user entered
T 142 (tile created) initialize largest number so far to number user entered
S 144 (tile placed)
T 149 good job!
T 150 ok two things left to do with the largest-so-far variable.
T 151 ideas?
S 152 inside the loop before the if-statement we need to check if number is larger than largest-so-far
T 153 GREAT!
T 154 (tile created) if number is larger than largest-so-far
S 156 (tile placed)
T 180 then what do we do if that turns out to be true?
S 181 set largest-so-far equal to number
T 182 (tile created) set largest-so-far equal to number
S 184 (tile placed)
T 188 one last thing to do!
S 189 we don't need an else...
T 190 What would we do in it?
S 191 nothing
T 192 So we can leave it out altogether but that was a good thing to wonder about.
T 193 Essentially we only care when the current value is a new largest number.
T 194 Ok one last step.
S 195 output largest-so-far
T 196 (tile created) output largest-so-far
S 198 (tile placed)
T 199 that's it! You've got all the steps. Nicely done.
T 200 Can you move that lower block up then we'll move on the final stage?
S 204 (tile placed)
T 206 The screen is about to change we are going to try and pick out sub-problems of our solution.
T 207
T 208 These sub-problems will represent programming goals.
T 209
T 211 I'm going to select a subset of tiles. See if you can summarize what they do as a unit.
T 219 try to ignore the grey tiles and tell me what the highlighted ones accomplish.
T 220 do you understand my question ok?
S 221 yes just thinking.
T 222 sorry.
S 223 The user enters a number. If it's even the number is doubled; if it's odd it is tripled + 1. this pattern repeats until the number is 4.
S 224 so this subset hammers out the hailstone series
T 225 that's right. The highlighted tiles represent a good first programming goal. Write a program that can do the highlighted steps.
T 226 Exactly!
T 227 Go ahead and type "write a program to hammer out a hailstone sequence" in the PDP Stage title box then hit submit.
T 229 Great. Now if you look at that that is the first program you will write. Just ignore the questions until later stages.
T 230 Now we need to pick a feature to add. Which one would be easiest do you think?
S 231 counting how many numbers are in the sequence
T 232 I agree totally. So now click on all the counter-related tiles..
T 236 Fantastic. So type something like "add a counter" in the title box and click submit.
T 238 We've only got one stage left to do what?
S 239 to recognize and report the largest value in the series
T 240 yep! I'll take care of highlighting the remaining tiles you go ahead and enter the final PDP stage title.