3 ms·
Pokemon rules would probably be wonderfully modeled as ADTs. Every "modifier" could be in a big sum type and then you would just express all your rules explicit
by whateveracct 12y ago
Pokemon rules would probably be wonderfully modeled as ADTs. Every "modifier" could be in a big sum type and then you would just express all your rules explicitly in terms of the current modifiers in play along with pokemon stats, type, and moves. In the end you have a function State -> Move -> State. You would take inputs, and apply them with the current state to get the new state. You would encode all your rules in this transition function.