For some reason the moron that wrote the engine has a convention of using returns instead of breaks...and since the function is a boolean, I thought it easier to just follow that instead of setting a flag and returning the appropriate boolean from inside the switch. I put an update function outside of the switch, and the code never saw it because of the returns inside of the switch.
Not every language capable of having a function is a 'functional' language. C++ is procedural with OOP features. If you want to learn a great functional language, I can let you borrow the Scheme "MIT" book.
I think you might be missing some code in there... were there unprintables?
Reply
Reply
boolean function OnKey
{
switch (key)
{
case:
return true
case:
x+=2;
return true
}
a(x)
return false;
}
See the response to arichi as to why it is set up that way.
Reply
For some reason the moron that wrote the engine has a convention of using returns instead of breaks...and since the function is a boolean, I thought it easier to just follow that instead of setting a flag and returning the appropriate boolean from inside the switch. I put an update function outside of the switch, and the code never saw it because of the returns inside of the switch.
Reply
I think you might be missing some code in there... were there unprintables?
Reply
Leave a comment