<br><br><div class="gmail_quote">On Thu, Jan 6, 2011 at 1:06 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Start reading HtDP/2e @ <a href="http://www.ccs.neu.edu/home/matthias/HtDP2e/" target="_blank">http://www.ccs.neu.edu/home/matthias/HtDP2e/</a><br>
<br>
It uses strings, which may be more familiar to you and which accommodate a bit more variety.<br>
<br>
Then switch back to HtDP/1e.<br>
<div><div></div><div class="h5"><br>
<br>
On Jan 5, 2011, at 7:18 AM, Sayth Renshaw wrote:<br>
<br>
><br>
> Can someone expand on the syntax for symbols? I can develop the check-guess game simply without symbols but cannot with symbols.<br>
> Trying many versions of the symbol syntax but with no success.<br>
><br>
> This the example for symbols, but how can I test conditions with a symbol?<br>
> (define (reply s)<br>
> (cond<br>
> [(symbol=? s 'GoodMorning) 'Hi]<br>
><br>
> [(<br>
> symbol=? s 'HowAreYou?) 'Fine]<br>
><br>
> [(<br>
> symbol=? s 'GoodAfternoon) 'INeedANap]<br>
><br>
> [(<br>
> symbol=? s 'GoodEvening) 'BoyAmITired]))<br>
><br>
> ;function check-guess<br>
> ;given number evaluate to one of three answers<br>
> ;number -> number -> string<br>
><br>
> tested without symbols and got it working so was trying to emulate this with symbols<br>
><br>
> (define (check-guess guess target)<br>
> (cond<br>
> [(< guess target) "Too Small"]<br>
> [(= guess target) "Perfect"]<br>
> [(> guess target) "Too large"]<br>
><br>
><br>
><br>
> ;(define (check-guess guess target)<br>
> ; (cond<br>
> ; [(symbol=? 'guess (< guess target) 'Too small)]<br>
> ; [(symbol=? 'guess (= guess target) 'Perfect)]<br>
> ; [(symbol=? 'guess (> guess target) 'Too Large)]))<br>
><br>
> ;(define (check-guess guess target)<br>
> ; (cond<br>
> ; [(symbol=? (< guess target) 'True 'Too Small)]<br>
> ; [(symbol=? (= guess target) 'True 'Perfect)]<br>
> ; [(symbol=? (> guess target) 'True 'Too Large)]))<br>
><br>
> ;(define (check-guess guess target)<br>
> ; (= s( < guess target))<br>
> ; (= s( = guess target))<br>
> ; (= s( > guess target))<br>
> ; (cond<br>
> ; [(symbol= s 'true 'Too Small)]<br>
> ; [(symbol= s 'true 'Perfect)]<br>
> ; [(symbol= s 'true 'Too Large)]))<br>
><br>
> ;(define (check-guess guess target)<br>
> ; [(symbol=? guess (< target guess) "Too small")]<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
<br>
</div></div></blockquote></div><br>Thanks getting some coffee into a checking it out now. Thanks for the tips.<br>