How can I generalize pendulumManagement() to take as arguments the names of the functions to fire and the boolean to decide on? I'm using java and processing library.
void pendulumManagement()
{
if (pendul) {
singlePendulumManagement();
} else {
dublePendulumManagement();
}
}
It seems that you want to use a flag argument. From that article:
My advice would be to think about that design choice again and reconsider if you actually should do it that way. The article mentioned above has more details about cases like the one that you describe.