Well, the obvious thing to do is not to have separate classes for each side. Instead have one class, and have one instance per side. Probably have each controller decide what to do, or perhaps even better, have a single controller that delegates to the appropriate instance depending on whose turn it is (and orchestrates the transition from setup to play). That way you won&#39;t be duplicating functionality, or spreading around logic about the flow of the stages of the game.<br>
<br><div class="gmail_quote">On Mon, May 26, 2008 at 6:21 PM, peter h meadows &lt;<a href="mailto:phm@sdf.lonestar.org">phm@sdf.lonestar.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi. I wondered if anyone could take a look at my code and answer some questions. I&#39;m trying to write a program that lets people play Arimaa (Arimaa is a board game that can be played with a standard chess set. You can find the rules at <a href="http://arimaa.com" target="_blank">arimaa.com</a> but you won&#39;t need to know how to play to understand my code)<br>

<br>
My code is on squeaksource: <a href="http://www.squeaksource.com/Arimaa.html" target="_blank">http://www.squeaksource.com/Arimaa.html</a><br>
<br>
I run it by: ArimaaGameZone new openInWindow .<br>
<br>
Click on the last two rows to position white pieces, then press the send button. Then click on the first two rows to position the black pieces. The move logic is not yet implemented, but I&#39;m sure you get the idea of what I want to do.<br>

<br>
I&#39;ve tried to use a MVC design where ArimaaBoardMorph is the View, ArimaaBoard is the Model and ArimaaEventHandler is the controller.<br>
<br>
So I have a different class to handle gold setup, silver setup, gold move and silver move (in arimaa we have gold/silver instead of black/white). All inherited from the ArimaaEventHandler. The board morph sends a message to the controller and depending on which controller is set you get different behaviour.<br>

<br>
Is this the best way to do what I want? I think it&#39;s probably wrong that when I switch between controllers I have to copy the variables that contain the model and the view. How should it be done with good smalltalk style? Is there a simpler way? Is it right to use inheritance as I have done?<br>

<br>
Any comments on other aspects are most welcome, but my main question is; have I done the MVC thing right? Don&#39;t be afraid to say it&#39;s all wrong, this is my first project and I don&#39;t mind rewriting the whole thing from scratch.<br>

<br>
I realise helping me with this may take some of your time, and I am very grateful for any response. I hope I will stick with squeak and one day do something useful for the community.<br>
<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>