Hi,<br><br>I&#39;ve had a go at making a robot battle game in Haskell (a robocode clone), I was using Yampa for both the robots and the game logic - however using Yampa for the game logic presented a number of problems, mostly in ensuring every single piece of data &quot;emitted&quot; from the game logic portion was evaluated. 
<br><br>I had a fair amount of work done, and it was shaping up nicely, but it needed simplification, trying to add in too many extras such as physical simulation of collisions etc. turned it into a bit of a monster when the core design needed some work!
<br><br><a href="http://saulzar.orcon.net.nz/robots2.jpg" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://saulzar.orcon.net.nz/robots2.jpg</a><br><br>I&#39;d definitely like to give it another go, this time without Yampa for game logic - though it seems fantastic for the user robot code, perhaps it needn&#39;t be compulsory - interested users could always use Yampa if they desired.
<br><br><br><br>Oliver Batchelor<br><br><br><div><span class="gmail_quote">On 7/16/07, <b class="gmail_sendername">apfelmus</b> &lt;<a href="mailto:apfelmus@quantentunnel.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
apfelmus@quantentunnel.de</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hugh Perkins wrote:<br>&gt; Had an idea: a real shootout game for Haskell.<br>&gt;<br>&gt; scripts &quot;fight&quot; in an arena for a second or so, and the results are
<br>&gt; published to the website<br><br>Sounds great :)<br><br>There are lots of &quot;robot battle&quot; games out there, like<br><br>&nbsp;&nbsp;<a href="http://realtimebattle.sourceforge.net/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://realtimebattle.sourceforge.net/
</a><br>&nbsp;&nbsp;<a href="http://robocode.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://robocode.sourceforge.net</a><br><br>but none in Haskell, of course. I think there&#39;s a classic predecessor to
<br>those but I don&#39;t know exactly.<br><br>&gt; Each turn is represented by a function something like:
<br>&gt;<br>&gt; doturn :: String -&gt; [[GridValue]] -&gt; (Action,String)<br><br>The explicit state can be dispensed with by introducing a stream type<br><br>&nbsp;&nbsp;data Robot = Robot (BattleField -&gt; (Action, Robot)<br><br>

&nbsp;&nbsp;type BattleField = [[GridValue]]<br><br>This way, the program is entirely free in how to choose its state<br>representation. You can turn any&nbsp;&nbsp;doturn - based program into a<br>stream-based one<br><br>&nbsp;&nbsp;toRobot :: String -&gt; (BattleField -&gt; String -&gt; (Action,String))
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt; Robot<br>&nbsp;&nbsp;toRobot s doturn = Robot $ \arena -&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; let (action, s&#39;) = doturn bf s in (action, toRobot s&#39; doturn)<br><br>The drawback is that it&#39;s no longer possible to save a snapshot of each
<br>program&#39;s state to disk and resume the fight later.<br><br>Regards,<br>apfelmus<br><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Haskell-Cafe@haskell.org
</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div>
<br>