Talk:Appearance rates: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle No edit summary |
imported>Bale No edit summary |
||
Line 22: | Line 22: | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
--[[User:StDoodle|StDoodle (#1059825)]] 15:58, 6 May 2010 (UTC) | --[[User:StDoodle|StDoodle (#1059825)]] 15:58, 6 May 2010 (UTC) | ||
No? I tested for mob == $monster[none] and I tested for freq > 0. Those are different variables. --[[User:Bale|Bale]] 21:27, 6 May 2010 (UTC) |
Latest revision as of 21:27, 6 May 2010
StDoodle, regarding our recent discussion regarding the switch statement: How's this for a nice use of it to increase code readability? Incidentally, there was a bug in the original code -- it didn't pick out bosses. --Bale 05:00, 6 May 2010 (UTC)
It still doesn't clarify that one can use completely "unrelated" variables in the individual case statements. Ie, you could do the following (if I'm not mistaken):
int a;
//stuff may happen to a
boolean [string] blah;
//blah may get populated
foreach x in blah {
switch {
case x == "hello":
print("kitty");
break;
case a > 9000:
print("spare me the memes");
break;
//etc.
}
}
--StDoodle (#1059825) 15:58, 6 May 2010 (UTC)
No? I tested for mob == $monster[none] and I tested for freq > 0. Those are different variables. --Bale 21:27, 6 May 2010 (UTC)