[Seaside] Design Question of a very small game

Yar Hwee Boon hboon at motionobj.com
Thu Oct 21 12:22:36 CEST 2004


On Wed, 20 Oct 2004 22:05:52 +0200, Alexandre Bergel <bergel at iam.unibe.ch>  
wrote:

> Hi!
>
> I would like to know a bit your opinion about the code I just wrote.
> It consist in a very small game: the computer choose randomly a number  
> between 0 and 100, and the user has to guess it. For each answer, the  
> computer says: 'too litle' or 'too big'.
>
> It is composed of 5 classes with a couple of method for each of them.
> Do you have a better design for this simple game ?

Try the attached. Note that you are not supposed to send #call: in  
#renderContentOn:. You should only do this in WATask>>go and callbacks.  
BTW, isn't this a Tomcat JSP example? I supposed this is a matter of  
preference.. but I think the naming conventions in Smalltalk and Java  
tends to be rather verbose (at least for me), "nbTry" just looks weird :)

-- 
Regards
HweeBoon
MotionObj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SimpleGame2.1.cs
Type: application/octet-stream
Size: 1620 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20041021/4928128d/SimpleGame2.1.obj


More information about the Seaside mailing list