/usr/share/doc/racket/teachpack/draw.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>1.7 Simple Drawing: "draw.rkt"</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-style: italic">How to Design Programs</span> Teachpacks</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="htdp.html" class="tocviewselflink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP Teachpacks</a></td></tr><tr><td align="right">2 </td><td><a href="2htdp2htdp.html" class="tocviewlink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP/<span class="mywbr"> </span>2e Teachpacks</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>1 </td><td><a href="htdp.html" class="tocviewlink" data-pltdoc="x">Ht<span class="mywbr"> </span>DP Teachpacks</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.1 </td><td><a href="image.html" class="tocviewlink" data-pltdoc="x">Manipulating Images:<span class="mywbr"> </span> <span class="stt">"image.rkt"</span><a name="(idx._(gentag._0._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.2 </td><td><a href="world.html" class="tocviewlink" data-pltdoc="x">Simulations and Animations:<span class="mywbr"> </span> <span class="stt">"world.rkt"</span><a name="(idx._(gentag._1._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.3 </td><td><a href="convert.html" class="tocviewlink" data-pltdoc="x">Converting Temperatures:<span class="mywbr"> </span> <span class="stt">"convert.rkt"</span><a name="(idx._(gentag._2._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.4 </td><td><a href="guess.html" class="tocviewlink" data-pltdoc="x">Guessing Numbers:<span class="mywbr"> </span> <span class="stt">"guess.rkt"</span><a name="(idx._(gentag._3._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.5 </td><td><a href="master.html" class="tocviewlink" data-pltdoc="x">Master<span class="mywbr"> </span>Minding:<span class="mywbr"> </span> <span class="stt">"master.rkt"</span><a name="(idx._(gentag._4._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.6 </td><td><a href="master-play.html" class="tocviewlink" data-pltdoc="x">Playing Master<span class="mywbr"> </span>Mind:<span class="mywbr"> </span> <span class="stt">"master-<wbr></wbr>play.rkt"</span><a name="(idx._(gentag._5._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Simple Drawing:<span class="mywbr"> </span> <span class="stt">"draw.rkt"</span><a name="(idx._(gentag._6._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.8 </td><td><a href="hangman.html" class="tocviewlink" data-pltdoc="x">Hangman:<span class="mywbr"> </span> <span class="stt">"hangman.rkt"</span><a name="(idx._(gentag._7._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.9 </td><td><a href="hangman-play.html" class="tocviewlink" data-pltdoc="x">Playing Hangman:<span class="mywbr"> </span> <span class="stt">"hangman-<wbr></wbr>play.rkt"</span><a name="(idx._(gentag._8._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.10 </td><td><a href="arrow.html" class="tocviewlink" data-pltdoc="x">Managing Control Arrows:<span class="mywbr"> </span> <span class="stt">"arrow.rkt"</span><a name="(idx._(gentag._9._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.11 </td><td><a href="docs.html" class="tocviewlink" data-pltdoc="x">Manipulating Simple HTML Documents:<span class="mywbr"> </span> <span class="stt">"docs.rkt"</span><a name="(idx._(gentag._10._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.12 </td><td><a href="dir.html" class="tocviewlink" data-pltdoc="x">Working with Files and Directories:<span class="mywbr"> </span> <span class="stt">"dir.rkt"</span><a name="(idx._(gentag._11._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.13 </td><td><a href="graphing.html" class="tocviewlink" data-pltdoc="x">Graphing Functions:<span class="mywbr"> </span> <span class="stt">"graphing.rkt"</span><a name="(idx._(gentag._12._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.14 </td><td><a href="gui.html" class="tocviewlink" data-pltdoc="x">Simple Graphical User Interfaces:<span class="mywbr"> </span> <span class="stt">"gui.rkt"</span><a name="(idx._(gentag._13._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.15 </td><td><a href="arrow-gui.html" class="tocviewlink" data-pltdoc="x">An Arrow GUI:<span class="mywbr"> </span> <span class="stt">"arrow-<wbr></wbr>gui.rkt"</span><a name="(idx._(gentag._14._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.16 </td><td><a href="elevator.html" class="tocviewlink" data-pltdoc="x">Controlling an Elevator:<span class="mywbr"> </span> <span class="stt">"elevator.rkt"</span><a name="(idx._(gentag._15._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.17 </td><td><a href="lkup-gui.html" class="tocviewlink" data-pltdoc="x">Lookup GUI:<span class="mywbr"> </span> <span class="stt">"lkup-<wbr></wbr>gui.rkt"</span><a name="(idx._(gentag._16._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.18 </td><td><a href="guess-gui.html" class="tocviewlink" data-pltdoc="x">Guess GUI:<span class="mywbr"> </span> <span class="stt">"guess-<wbr></wbr>gui.rkt"</span><a name="(idx._(gentag._17._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.19 </td><td><a href="show-queen.html" class="tocviewlink" data-pltdoc="x">Queens:<span class="mywbr"> </span> <span class="stt">"show-<wbr></wbr>queen.rkt"</span><a name="(idx._(gentag._18._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr><tr><td align="right">1.20 </td><td><a href="matrix.html" class="tocviewlink" data-pltdoc="x">Matrix Functions:<span class="mywbr"> </span> <span class="stt">"matrix.rkt"</span><a name="(idx._(gentag._19._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>1.7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Simple Drawing:<span class="mywbr"> </span> <span class="stt">"draw.rkt"</span><a name="(idx._(gentag._6._(lib._teachpack/teachpack..scrbl)))"></a></a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">1.7.1 </td><td><a href="#%28part._drawing%29" class="tocviewlink" data-pltdoc="x">Drawing on a Canvas</a></td></tr><tr><td align="right">1.7.2 </td><td><a href="#%28part._interaction%29" class="tocviewlink" data-pltdoc="x">Interactions with Canvas</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">1.7.1<tt> </tt></span><a href="#%28part._drawing%29" class="tocsubseclink" data-pltdoc="x">Drawing on a Canvas</a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._start%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">start</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._start%2Fcartesian-plane%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">start/<span class="mywbr"> </span>cartesian-<wbr></wbr>plane</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._stop%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">stop</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-circle%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">draw-<wbr></wbr>circle</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-disk%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">draw-<wbr></wbr>solid-<wbr></wbr>disk</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-rect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">draw-<wbr></wbr>solid-<wbr></wbr>rect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-line%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">draw-<wbr></wbr>solid-<wbr></wbr>line</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">draw-<wbr></wbr>solid-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._sleep-for-a-while%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">sleep-<wbr></wbr>for-<wbr></wbr>a-<wbr></wbr>while</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-circle%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>circle</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-disk%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>solid-<wbr></wbr>disk</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-rect%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>solid-<wbr></wbr>rect</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-line%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>solid-<wbr></wbr>line</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-string%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>solid-<wbr></wbr>string</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-all%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">clear-<wbr></wbr>all</span></span></a></td></tr><tr><td><span class="tocsublinknumber">1.7.2<tt> </tt></span><a href="#%28part._interaction%29" class="tocsubseclink" data-pltdoc="x">Interactions with Canvas</a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._wait-for-mouse-click%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">wait-<wbr></wbr>for-<wbr></wbr>mouse-<wbr></wbr>click</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._get-key-event%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">get-<wbr></wbr>key-<wbr></wbr>event</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._big-bang%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">big-<wbr></wbr>bang</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._on-key-event%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">on-<wbr></wbr>key-<wbr></wbr>event</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._on-tick-event%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">on-<wbr></wbr>tick-<wbr></wbr>event</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._end-of-time%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">end-<wbr></wbr>of-<wbr></wbr>time</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="master-play.html" title="backward to "1.6 Playing MasterMind: "master-play.rkt""" data-pltdoc="x">← prev</a> <a href="htdp.html" title="up to "1 HtDP Teachpacks"" data-pltdoc="x">up</a> <a href="hangman.html" title="forward to "1.8 Hangman: "hangman.rkt""" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "teachpack/teachpack.scrbl")" x-part-tag=""draw"">1.7<tt> </tt><a name="(part._draw)"></a><a name="(mod-path._htdp/draw)"></a>Simple Drawing: <span class="stt">"draw.rkt"</span><a name="(idx._(gentag._6._(lib._teachpack/teachpack..scrbl)))"></a></h4><p><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=htdp-langs&rel=beginner.html%23%2528form._%2528%2528lib._lang%252Fhtdp-beginner..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">htdp/draw</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">htdp-lib</span></span></td></tr></table></p><p>The teachpack provides two sets of functions: one for drawing into a canvas
and one for reacting to canvas events.</p><blockquote><p><span style="background-color: yellow"><span style="font-weight: bold">NOTE:</span></span> This library is deprecated; use <a href="2htdpimage.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">2htdp/image</span></a> (probably in conjunction with <a href="2htdpuniverse.html" class="RktModLink" data-pltdoc="x"><span class="RktSym">2htdp/universe</span></a>), instead. You may continue to use the library for solving exercises
from <span style="font-style: italic">How To Design Programs, First Edition</span> but do consider
switching to <a href="http://www.ccs.neu.edu/home/matthias/HtDP2e/">How To Design Programs, Second Edition</a> instead.</p></blockquote><h5 x-source-module="(lib "teachpack/teachpack.scrbl")" x-part-tag=""drawing"">1.7.1<tt> </tt><a name="(part._drawing)"></a>Drawing on a Canvas</h5><p><a name="(tech._drawcolor)"></a><span style="font-style: italic">DrawColor</span>: <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._and%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">and/c</a></span><span class="stt"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._one-of%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">one-of/c</a></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">white</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">yellow</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">red</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">blue</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">green</span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">black</span><span class="RktPn">)</span><span class="RktPn">)</span>
These six colors are definitely provided. If you want other colors,
guess! For example, <span class="RktVal">'</span><span class="RktVal">orange</span> works, but <span class="RktVal">'</span><span class="RktVal">mauve</span>
doesn’t. If you apply the function to a symbol that it doesn’t recognize as
a color, it raises an error.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._start))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._start%29%29" class="RktValDef RktValLink" data-pltdoc="x">start</a></span></span><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span><span class="RktVar">height</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Opens a
<span class="RktVar">width</span> x <span class="RktVar">height</span> canvas.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._start/cartesian-plane))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._start%2Fcartesian-plane%29%29" class="RktValDef RktValLink" data-pltdoc="x">start/cartesian-plane</a></span></span><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span><span class="RktVar">height</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Opens a <span class="RktVar">width</span> x <span class="RktVar">height</span> canvas and draws a Cartesian
plane.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._stop))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._stop%29%29" class="RktValDef RktValLink" data-pltdoc="x">stop</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Closes the canvas.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._draw-circle))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-circle%29%29" class="RktValDef RktValLink" data-pltdoc="x">draw-circle</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">Draws a <span class="RktVar">c</span> circle at <span class="RktVar">p</span> with radius <span class="RktVar">r</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._draw-solid-disk))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-disk%29%29" class="RktValDef RktValLink" data-pltdoc="x">draw-solid-disk</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">Draws a <span class="RktVar">c</span> disk at <span class="RktVar">p</span> with radius <span class="RktVar">r</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._draw-solid-rect))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-rect%29%29" class="RktValDef RktValLink" data-pltdoc="x">draw-solid-rect</a></span></span><span class="hspace"> </span><span class="RktVar">ul</span><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">ul</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">Draws a <span class="RktVar">width</span> x <span class="RktVar">height</span>, <span class="RktVar">c</span> rectangle with the
upper-left corner at <span class="RktVar">ul</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._draw-solid-line))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-line%29%29" class="RktValDef RktValLink" data-pltdoc="x">draw-solid-line</a></span></span><span class="hspace"> </span><span class="RktVar">strt</span><span class="hspace"> </span><span class="RktVar">end</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">strt</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">Draws a <span class="RktVar">c</span> line from <span class="RktVar">strt</span> to <span class="RktVar">end</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._draw-solid-string))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._draw-solid-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">draw-solid-string</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Draws <span class="RktVar">s</span> at <span class="RktVar">p</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._sleep-for-a-while))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._sleep-for-a-while%29%29" class="RktValDef RktValLink" data-pltdoc="x">sleep-for-a-while</a></span></span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Suspends evaluation for <span class="RktVar">s</span> seconds.</div></p><p>The teachpack also provides <span class="RktSym">clear-</span> functions for each
<span class="RktSym">draw-</span> function:</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-circle))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-circle%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-circle</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">clears a <span class="RktVar">c</span> circle at <span class="RktVar">p</span> with radius <span class="RktVar">r</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-solid-disk))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-disk%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-solid-disk</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">r</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">clears a <span class="RktVar">c</span> disk at <span class="RktVar">p</span> with radius <span class="RktVar">r</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-solid-rect))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-rect%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-solid-rect</a></span></span><span class="hspace"> </span><span class="RktVar">ul</span><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">ul</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">width</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">height</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">clears a <span class="RktVar">width</span> x <span class="RktVar">height</span>, <span class="RktVar">c</span> rectangle with the
upper-left corner at <span class="RktVar">ul</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-solid-line))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-line%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-solid-line</a></span></span><span class="hspace"> </span><span class="RktVar">strt</span><span class="hspace"> </span><span class="RktVar">end</span><span class="hspace"> </span><span class="RktVar">c</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">strt</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">c</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawcolor%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawColor</span></a></td></tr></table></blockquote></div><div class="SIntrapara">clears a <span class="RktVar">c</span> line from <span class="RktVar">strt</span> to <span class="RktVar">end</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-solid-string))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-solid-string%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-solid-string</a></span></span><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span><span class="RktVar">s</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">p</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym">posn?</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">s</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">clears <span class="RktVar">s</span> at <span class="RktVar">p</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._clear-all))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._clear-all%29%29" class="RktValDef RktValLink" data-pltdoc="x">clear-all</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">clears the entire screen.</div></p><h5 x-source-module="(lib "teachpack/teachpack.scrbl")" x-part-tag=""interaction"">1.7.2<tt> </tt><a name="(part._interaction)"></a>Interactions with Canvas</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._wait-for-mouse-click))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._wait-for-mouse-click%29%29" class="RktValDef RktValLink" data-pltdoc="x">wait-for-mouse-click</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym">posn?</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Waits for the user to click on the mouse, within the canvas.</div></p><p><div class="SIntrapara"><a name="(tech._drawkeyevent)"></a><span style="font-style: italic">DrawKeyEvent</span>: <span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="stt"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=characters.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._char%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">char?</a></span><span class="stt"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="RktPn">)</span> A
<a href="#%28tech._drawkeyevent%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawKeyEvent</span></a> represents keyboard events:
</div><div class="SIntrapara"><ul><li><p><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=characters.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._char%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">char?</a></span>, if the user pressed an alphanumeric key;</p></li><li><p><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span>, if the user pressed, for example, an arror key:
<span class="RktVal">'</span><span class="RktVal">up</span> <span class="RktVal">'</span><span class="RktVal">down</span> <span class="RktVal">'</span><span class="RktVal">left</span> <span class="RktVal">'</span><span class="RktVal">right</span></p></li></ul></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._get-key-event))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._get-key-event%29%29" class="RktValDef RktValLink" data-pltdoc="x">get-key-event</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._false%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false</a></span><span class="hspace"> </span><a href="#%28tech._drawkeyevent%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawKeyEvent</span></a><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Checks whether the
user has pressed a key within the window; <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._false%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false</a></span> if not.</div></p><p><a name="(tech._drawworld)"></a><span style="font-style: italic">DrawWorld</span>: For proper interactions, using the teachpack
requires that you provide a data definition for <a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a> . In
principle, there are no constraints on this data definition. You can even
keep it implicit, even if this violates the Design Recipe.</p><p>The following functions allow programs to react to events from the canvas.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._big-bang))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._big-bang%29%29" class="RktValDef RktValLink" data-pltdoc="x">big-bang</a></span></span><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span><span class="RktVar">w</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">n</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">w</span><span class="hspace"> </span>:<span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a></td></tr></table></blockquote></div><div class="SIntrapara">Starts the clock, one tick every
<span class="RktVar">n</span> (fractal) seconds; <span class="RktVar">w</span> becomes the first “current” world.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._on-key-event))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._on-key-event%29%29" class="RktValDef RktValLink" data-pltdoc="x">on-key-event</a></span></span><span class="hspace"> </span><span class="RktVar">change</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">change</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><a href="#%28tech._drawkeyevent%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawKeyEvent</span></a><span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a><span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Adds <span class="RktVar">change</span> to the world. The function reacts to keyboard
events and creates a new <a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._on-tick-event))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._on-tick-event%29%29" class="RktValDef RktValLink" data-pltdoc="x">on-tick-event</a></span></span><span class="hspace"> </span><span class="RktVar">tock</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528lib._racket%252Fbool..rkt%2529._true%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">true</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">tock</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=function-contracts.html%23%2528form._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._-%7E3e%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a><span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Adds <span class="RktVar">tock</span>
to the world. The function reacts to clock tick events, creating a new
current world.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._htdp/big-draw..rkt)._end-of-time))"></a><span title="Provided from: htdp/draw | Package: htdp-lib"><span class="RktSym"><a href="#%28def._%28%28lib._htdp%2Fbig-draw..rkt%29._end-of-time%29%29" class="RktValDef RktValLink" data-pltdoc="x">end-of-time</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><a href="#%28tech._drawworld%29" class="techoutside" data-pltdoc="x"><span class="techinside">DrawWorld</span></a></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">Stops the world; returns the current world.</div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="master-play.html" title="backward to "1.6 Playing MasterMind: "master-play.rkt""" data-pltdoc="x">← prev</a> <a href="htdp.html" title="up to "1 HtDP Teachpacks"" data-pltdoc="x">up</a> <a href="hangman.html" title="forward to "1.8 Hangman: "hangman.rkt""" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|