[OT] Block challenge

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[OT] Block challenge

Francisco Garau-2
There is a missing line that makes the below evaluate to true. Can you spot it?

[  
| pointClass setX setY squared   |
pointClass  :=
[ | x y  |  
setX := [ :aNumber | x := aNumber ].
setY := [ :aNumber | y := aNumber ]. 
squared := [ (x * x) + (y * y) ]. 
#end. 
].
setX value: 3. 
setY value: 4. 
squared value. 
] value = 25 
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Block challenge

Ben Coman
Francisco Garau wrote:

> There is a missing line to make the below example evaluate to true. Can you spot
> it?
>
> [
> | pointClass setX setY squared   |
> pointClass  :=
> [ | x y  |
> setX := [ :aNumber | x := aNumber ].
> setY := [ :aNumber | y := aNumber ].
> squared := [ (x * x) + (y * y) ].
> #end.
> ].
> setX value: 3.
> setY value: 4.
> squared value.
> ] value = 25
>
>  
pointClass value

cheers -ben