Yes, I have the same strcuture:sje wrote:Here is some sample code; Symbolic's move maker routine. Notice how null moves are handled without fuss.
Code: Select all
// 1. code before
if (not null move) {
// 2. code to play a real move
}
// 3. code after
But notice how your code in (2) uses 5 indentation levels! Some people consider this a criminal offense... I don't, although I try as much as reasonably practical to obey to the rule of thumb from Linus Torvalds: no more than 3. Often trying to obey to that rule has meant rewriting the code in a clearer way and breaking it down in small helper functions (and we know that it's better to have lots of small functions rather than few big ones). Again, it's a rule of thumb, nothing should be set in stone (I violate it quite often too).
