I see that some Matthew gave you a fish and William sketched how Matthew may 
have caught the fish.  Here is a fishing net

  
http://www.ccs.neu.edu/home/matthias/HtDP2e/part_four.html#%28part._ch~3asimu%29
 <http://www.ccs.neu.edu/home/matthias/HtDP2e/part_four.html#(part._ch~3asimu)>

It comes with instructions on how to fish. 






> On Apr 15, 2017, at 10:16 AM, Angus <[email protected]> wrote:
> 
> I have a function that can return either false or a node.  I have to check 
> four permutations:
> 
> both nodes false,
> left node false, 
> right node valid, left node false
> both node valid
> 
> I am doing it using cond like this:
> 
> (define (lines t)
>  (cond [(and (false? (node-l t)) (false? (node-r t))) <<do no children 
> thing>>]  ;; if no children
>        [(and (false? (node-l t)) (not (node-r t)))  <<left child only>>]  ;; 
> if left child only
>        [(and (node-l t) (false? (node-r t))) <<right child only>> ]  ;; if 
> right child only
>        [else <<both children>> ]))  ;; if both children
> 
> 
> the first cond line using and and false? works ok and the last cond line 
> using else works ok.  But how do I check for the middle two occurrences?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to