Player "0" - Does it make sense?
Re: Player "0" - Does it make sense?
Ah, Kanji (IIRC) - now we can have ~400,000 players referenced with a single character! yay!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Player "0" - Does it make sense?
About stating from 0 in programming:
http://xkcd.com/163/
http://xkcd.com/163/
-insert deep philosophical statement here-
Re: Player "0" - Does it make sense?
<3 xkcd
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Player "0" - Does it make sense?
Sometime, i felt it was necessary to distinguish, "NULL" from "UNKNOWN" to respect the third codd rule. You have another solution ?stiv wrote:A fine example of Stuff You Should Never Do.Code: Select all
for i := 0; i++ < count; { [do Something] }
Heretic 2.3 improver and proud of it.
Re: Player "0" - Does it make sense?
This has nothing to do with null values and everything thing to do with loops and indexing. Try and focus.Sometime, i felt it was necessary to distinguish, "NULL" from "UNKNOWN" to respect the third codd rule.
Yeah, do not do weird stuff like this lest you find yourself hunted for sport by your co-workers in general, and maintenance programmers in particular. If you want the loop to start at one, start it at one and don't be cute. And no side effects, please.You have another solution ?
Re: Player "0" - Does it make sense?
I tend to iterate through lists backwards just because I like the way the code looks:
I should probably invest in some body armour?
Code: Select all
var x= someArray.length;
while (-1<--x) { // "x" marks the spot (:
// do stuff with someArray[x]
}
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
- lav_coyote25
- Professional
- Posts: 3434
- Joined: 08 Aug 2006, 23:18
Re: Player "0" - Does it make sense?
well, from what i have seen here over the last few days, should this topic not be in the lounge? lets face it, its one of those topics where no one can agree, except to disagree. right?
Re: Player "0" - Does it make sense?
Cantankerous bunch we are, we pro'lly don't even agree on that!where no one can agree, except to disagree. right?
Personally, I love software archeology. Always interesting to understand "How did this curious situation come about?"
Re: Player "0" - Does it make sense?
some awesome for loop stuff in javascript: http://javascriptweblog.wordpress.com/2 ... for-loops/
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
- milo christiansen
- Regular
- Posts: 749
- Joined: 02 Jun 2009, 21:23
- Location: Perrinton Michigan
Re: Player "0" - Does it make sense?
"slightly nutty"? Some of the examples are downright insane!In which the use of for-loops will evolve from the familiar to the slightly nutty. The intent is to demonstrate the flexibility of the construct and the power of the language – not to provide best practice templates
Cool, but insane
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
- Demigod Game Ganual
Re: Player "0" - Does it make sense?
Code: Select all
int _ = +-~-~-~-~-~-~-~-~-~-~+ 0;
while (+~-_---~+ 0)
printf("%d\n", _);
Re: Player "0" - Does it make sense?
@Cyp how on earth does that resolve to 9876543210 ?
EDIT: Here's the Javascript equivalent of that code if anyone wants to test it in a browser:
EDIT: Here's the Javascript equivalent of that code if anyone wants to test it in a browser:
Code: Select all
var _ = Number(+-~-~-~-~-~-~-~-~-~-~+ 0);
while (+~-_---~+ 0)
document.write(_);
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
- milo christiansen
- Regular
- Posts: 749
- Joined: 02 Jun 2009, 21:23
- Location: Perrinton Michigan
Re: Player "0" - Does it make sense?
try
Code: Select all
javascript:var _ = Number(+-~-~-~-~-~-~-~-~-~-~+ 0); while (+~-_---~+ 0)document.write(" " + _)
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
- Demigod Game Ganual
- Saberuneko
- Regular
- Posts: 558
- Joined: 15 Jan 2010, 18:20
- Contact:
Re: Player "0" - Does it make sense?
It doesmilo christiansen wrote:It makes perfect sense to a programmer
Re: Player "0" - Does it make sense?
Not always, AFAIK COBOL starts from 1.
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.
Beware! Mad Qt Evangelist.
The time has come, the high time, to destroy hatred in oneself.
Beware! Mad Qt Evangelist.