OK, not much a question about the game itself, but this is the first place I've seen this and I can't stop thinking about it (example from TerranTreats.as):
var newSkin:String = "tan";
if(rand(6) == 0) newSkin = "fair";
else if(rand(5) == 0) newSkin = "pale";
else if(rand(4) == 0) newSkin = "olive";
else if(rand(3) == 0) newSkin = "dark";
else if(rand(2) == 0) newSkin = "ebony";
I'd expect a switch or this instead:
var r:int = random(6);
if(r == 0) newSkin = "fair";
else if(r == 1) newSkin = "pale";
else if(r == 2) newSkin = "olive";
else if(r == 3) newSkin = "dark";
else if(r == 4) newSkin = "ebony";
It's like "Did we roll a 6 on that D6? No? Then roll a D5 to see if we get a 5"
Is that an Actionscript convention, something for not keeping temp vars maybe? A funny thing that got started as a curiosity? Or is there no significance?
Took me a good twenty minutes to realize it did add up to the same odds, so if the purpose was to generate WTFs then it is successful
var newSkin:String = "tan";
if(rand(6) == 0) newSkin = "fair";
else if(rand(5) == 0) newSkin = "pale";
else if(rand(4) == 0) newSkin = "olive";
else if(rand(3) == 0) newSkin = "dark";
else if(rand(2) == 0) newSkin = "ebony";
I'd expect a switch or this instead:
var r:int = random(6);
if(r == 0) newSkin = "fair";
else if(r == 1) newSkin = "pale";
else if(r == 2) newSkin = "olive";
else if(r == 3) newSkin = "dark";
else if(r == 4) newSkin = "ebony";
It's like "Did we roll a 6 on that D6? No? Then roll a D5 to see if we get a 5"
Is that an Actionscript convention, something for not keeping temp vars maybe? A funny thing that got started as a curiosity? Or is there no significance?
Took me a good twenty minutes to realize it did add up to the same odds, so if the purpose was to generate WTFs then it is successful