Earlier quoted context omitted.
> Does everyone really need to know about recursion? Recursion is taught in gym class through the game of dodgeball. Consider the following C-like pseudocode: void throw(int *ball, int hits) { if (hits The question then becomes, do people need to learn specific computer languages, or is teaching the underlying concepts in abstract ways enough?
Edit: I began writing this before a different post appeared with the same point. Alas! I'm sorry to be a jerk, but I found your code pretty tough to decipher. Here's my thought process: NUMBER_OF_PLAYERS could be, say, 6. the caller calls: throw(ball, 0); 0 So, what is ball? It's either an integer and you're just passing its address around for no particular reason, or it's an integer array and you're using angle() to…
From a code maintainability point of view, yes. I would never write code like this for a real application. However, for analogizing the game in code, I have to strongly disagree.
Ball is not a list of players. It is, just as in the game, a pointer to a location in space. Players may or may not occupy that space. If the player does, a hit occurs. The hit test is based on the intersection of the location in space and the occupation of that space.
I chose to represent my code in a C-like manner because it makes that spacial representation easy to write. People are not thinking about the game in terms of lists and objects, that I am sure.