Tag Info

New answers tagged


How a bout a rules mechanism? Define a class(or a struct or whatever) that defines a rule: class Rule { bool weCanDoAutoWithdrawX; bool weCanDoAutoWithdrawY; bool WeHaveDeficitOfX; bool WeHaveDeficitOfY; ... } Now, create a list of Rules, and fill it with Rule objects that represent the rules you described in the question. When you ...


As I don't see any language specified, use 'switch'. -Or if using C, you can make a function that handles each account type, then make a list of function pointers. typedef void (*Account)(uint32_t aParameter); static const Account[] = { mondoBurger, goodBurger }; -If using C++, JavaScript or any other OOP language, you could make an object that handles ...

Top 50 recent answers are included