News for hackers. Stuff that matters.
Re:Admitting that Functional Programming Can Be Awkward by stcredzero on Tuesday June 16, 2009 @11:43AM (#660357)
An arcade game should be organized using a game loop. Just make the game loop update the state of the entire game world each frame. This makes it relatively easy to write most of the game in a functional fashion. (You may have to have n "phases" in your game loop. Movement phase, collision resolution phase, etc.)

The OP is accustomed to thinking only in terms of mutating state. He can't get away from it. He wouldn't have had all of these problems if he'd just done ye olde AI class with turn-based board game project in Lisp. (With a prof who set a coding standard for pure functional Lisp.)

Re:Admitting that Functional Programming Can Be Awkward by copenja on Tuesday June 16, 2009 @12:41PM (#660471)
This same guy also wrote an article describing the exact same functional style game loop that you are describing:

http://prog21.dadgum.com/23.html

Re:Admitting that Functional Programming Can Be Awkward by stcredzero on Tuesday June 16, 2009 @02:27PM (#660622)
I stand corrected. He knows his stuff already. I'll reread his OP.
Re:Admitting that Functional Programming Can Be Awkward by didroe on Tuesday June 16, 2009 @12:08PM (#660404)
How do you solve the problems he mentioned in his followup post? He seems to be saying that there are a lot of people going on about how easy it is but no examples beyond simple games.