
29 Nov
2009
29 Nov
'09
9:41 a.m.
Hello papa, Sunday, November 29, 2009, 5:11:23 PM, you wrote:
add some IO on top of it, keeping the main code pure. The idea was to write a very simple two-player game, then define some strategies to play it that do not involve IO
ho i could do it: class Strategy state where initState :: state nextMove :: state -> (Move,state) updateState :: (Move,state) -> state where initState gives initial state, nextMove returns move and updated internal state updateState updates state with opponent's move then you can develop any IO front-end that runs two strategies each against other -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com