<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>In this program, a world is just an interval. </div><div><br></div><div>All of those w s could be replaced with ivl s, because a world is an interval, and the value of the parameter will always be an interval. </div><div><br></div><div>However, (I’m guessing) using world or w makes it clear that the functions are meant to be used with big-bang. </div><div><br></div><div>They could’ve also named the struct world instead of interval, but interval is a better name because its a lot more descriptive of what it represents. </div><br><div><div>On Jun 30, 2014, at 11:43 AM, Steve Graham <<a href="mailto:jsgrahamus@yahoo.com">jsgrahamus@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"><div style="" class="">In Guess My Number I see the following definitions:</div><div style="" class=""><br style="" class=""></div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">(define (smaller w)<br style="" class=""> (interval (interval-small w)<br style="" class=""> (max (interval-small w) (sub1 (guess w)))))<br style="" class="">(define (bigger w)<br style="" class=""> (interval (min (interval-big w) (add1 (guess w)))<br style="" class=""> (interval-big w)))<br style="" class="">(define (guess w)<br style="" class=""> (quotient (+ (interval-small w) (interval-big w)) 2))<br style="" class="">(define (render w)<br style="" class=""> (overlay (text (number->string (guess w)) SIZE COLOR) MT-SC))<br style="" class="">(define (render-last-scene w)<br style="" class=""> (overlay (text "End" SIZE COLOR) MT-SC))<br style="" class="">(define (single? w)<br style="" class=""> (= (interval-small w) (interval-big w)))</div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Why is w (which is world?) included as a parameter? For instance in guess, it seems the only thing needed to
calculate it is access to the values of interval.</div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Steve<br style="" class=""></div><div class="" style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br style="" class=""></div></div></div>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>