<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello,<div><br></div><div>I was just playing with the turtle module, and thought it was an interesting way to augment the introduction to python (I teach college students, who haven't had any programming).  It's a great way to introduce functions, for-loops, and general program structures.</div><div><br></div><div>After a bit of playing, I realized that I couldn't think of many examples which use turtle with conditional structures (if- and while- statements), or functions that return values, as opposed to "procedures" like:</div><div><br></div><div>def square(length):</div><div>    forward(length)</div><div>    right(90)</div><div><div>    forward(length)</div><div>    right(90)</div><div><div>    forward(length)</div><div>    right(90)</div><div><div>    forward(length)</div><div>    right(90)</div><div><br></div></div></div><div><br></div><div>If-statements could possibly be used with some sort of random behavior (if rand()<0.5 ...).  Are there any other situations, using turtle, that these structures would be natural? </div><div><br></div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>thanks,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>Brian Blais</div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Monaco; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>-- </div><div>Brian Blais</div><div><a href="mailto:bblais@bryant.edu">bblais@bryant.edu</a></div><div><a href="http://web.bryant.edu/~bblais">http://web.bryant.edu/~bblais</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span> </div><br></div></body></html>