News for hackers. Stuff that matters.
Re:Player of Games by LeifCarrotson on Wednesday December 08, 2021 @02:43PM (#29489452)
> What tripped me up every time is that most board games have a lot of "if this happens, there is this specific rule that applies". Even relatively simple games (like Homeworlds) are pretty hard to nail down perfectly due to all the special cases.

The key is to build a data-driven state machine, rather than writing logic with a bunch of 'if' statements.

Re:Player of Games by mathgladiator on Wednesday December 08, 2021 @06:44PM (#29492096)
You are correct, but some games can yield exceptionally complicated state machines.

I designed a language for solving this: http://www.adama-lang.org/

I get all the benefits of a data driven state machine with the simplicity of a language that supports asynchronously asking users for updates.

Re:Player of Games by fho on Wednesday December 08, 2021 @04:19PM (#29490665)
I am "camp Haskell", so my approach was pretty much data-driven. But what is a state machine if not a big nest of if-else statements? :-)