<div dir="ltr"><div>Take a look at the function put-pinhole, which will allows you to create a version of the rocket image with the "pinhole" at the bottom center of the rocket. If you do that, I think you'll be able to easily create place-image logic for the rocket example that is more to your liking.<br>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 23, 2014 at 1:14 PM, Lawrence J Winkler <span dir="ltr"><<a href="mailto:winkllj@acm.org" target="_blank">winkllj@acm.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span style="border-collapse:separate;text-align:-webkit-auto;text-indent:0px;border-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px"><div style="word-wrap:break-word"><span style="border-collapse:separate;text-indent:0px;border-spacing:0px"><div style="word-wrap:break-word"><div style="line-height:normal;letter-spacing:normal;font-variant:normal;text-transform:none;font-style:normal;font-size:12px;white-space:normal;font-family:Helvetica;font-weight:normal;word-spacing:0px">
<span>I recently starting reading HtDP/2e to evaluate the approach to teaching programming. My motivation, in part, stems from the recent Computer Science Education Week last December, where many were given the opportunity to experience one hour of programming. </span></div>
<div style="line-height:normal;letter-spacing:normal;font-variant:normal;text-transform:none;font-style:normal;font-size:12px;white-space:normal;font-family:Helvetica;font-weight:normal;word-spacing:0px"><span><br></span></div>
<div style="line-height:normal;letter-spacing:normal;font-variant:normal;text-transform:none;font-style:normal;font-size:12px;white-space:normal;font-family:Helvetica;font-weight:normal;word-spacing:0px"><span>I'm interested in reviewing different teaching approaches and processes and I soon came upon your rocket landing demo in the Prologue and felt uncomfortable with the discussion and solution create-rocket-scene.v3. (I haven't read much further than this in any detail, so you may already address this issue later). </span><br>
<br><span>In particular, the solution adjusts the position of the rocket relative to the HEIGHT of the empty-scene and the image-height, whereas I'm much more comfortable with a solution conceptualized differently and independent of size of the scene.</span><br>
<br><span>Where in the function (create-rocket-scene height), height is the position of the center of the image, my solution is that height would be the height of the bottom of the image. Thus, something like the following makes more sense to me. (using BSL) </span><br>
<br><span>(define (place-image-bottom img x y canvas) </span><br><span> (place-image img x (img-center-pos img y) canvas))</span><br><br><span>(define (img-center-pos img vert-pos) (- vert-pos (/ (image-height img) 2)))</span><br>
<br><span>(define (create-rocket-scene.v3 ht)</span><br><span> (if (<= ht 100) (place-image-bottom rocket 50 ht (empty-scene 100 100))</span><br><span> (place-image-bottom rocket 50 100 (empty-scene 100 100))))</span><br>
<br>In any case, it would seem easier for me to motivate this abstraction to new students. <br><br><span>Thanks</span><br><span>-------------------------------</span><br><span>Larry Winkler</span><br><span>5306 Loruth Ter</span><br>
<span>Madison Wisconsin 53711</span><br><span>Mobile: <a href="tel:608-345-0627" value="+16083450627" target="_blank">608-345-0627</a></span><br><span>--------------------------------</span></div></div></span></div></span></div>
</span></div><br><br></div><br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>