- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
If pasting 4096 zeroes in your source file is easier than using a for loop or constructor the perpetrator better be a Vi or Emacs user. Then again, that somebody might be paid by SBOC.
Admin
TRWTF is the use of both
string
andString
.There, much better.
EDIT: Added the zeros that had been deliberately removed by Remy.
Admin
if you're looking to golf, python is even better.
Admin
TRRWTF is not making it a const.
:trolleybus:
INB4 You can't do
const var
Admin
TRRRWTF is forgetting the variable name
Admin
You can't prove anything.
Admin
Admin
Admin
you copied that one from teh article.
and it is significanl;ty less WTFY than my suggestion
Admin
No I didn't. I didn't read that far into the article. :P
Plus, mine uses var. ;)
Admin
AH! so you did read the article!
Admin
After you accused me.
Admin
:factory:s are a :barrier: to :statue_of_liberty:
Admin
All of those uses of var weren't quite convenient enough.
This is a much more convenient use of
var
Admin
Also,
I beg to differ. [image] Completely irrefutable evidence. You think you could get away with such :hanzo: edits? <INB4 someone screenshots one of my posts before I edit all the tyops out>
Admin
:wtf:y enough for you? I even made mine into a function able to produce the variable output sizes, with a misleading input variable name!
Admin
Such paltry screenshots are easy to fake.
[image]See?
Looks like you INB4d the wrong thing. ;)
Admin
i can use devtools too.
[image]Admin
Needs more LINQ.
Admin
i like the typo there.
shouldn't that be kilobytes as you're only multiplying by 1024?
Admin
That's mine, and fully intentional.
Admin
HTH, HAND etc...
Admin
[image]
Admin
Perl
Admin
TRWTF is that the original string seems to be 4081 bytes and not 4096 bytes?
Admin
Amazing is that in such a short article Remy still manages to get 2 Html comments. Remy, was it zero number 1234 or 666? I couldn't quite be sure which..and of course I have to ask is that numbered from "000000000000000000000000000000000000000000000000000000000000000000000000000000000...."
Admin
Alice also gets a zero:
Admin
TRWTF is making a change like this likely to cause breakage when the new string is a different length than the old one...
Admin
He did the Easter egg wrong, though, because he didn't make it hard enough to find. He should have deleted a zero, then copied one of the other zeros, pasting the copy in the wrong place, then dared people to find all three problems. That would have been a proper three Easter egg problem.
Admin
That's boring though, a real master of mischief would put an uppercase 'O' in there.
Filed under: Better commit it under somebody else's name though
Admin
I only made it 4082 '0's
Admin
I would do it like this.
Admin
LOL...use back ticks.
Admin
I broke it with editing.
Admin
I hate you.
Admin
TRRRRWTF is a variable named
s
Admin
Admin
Obviously, we could omit the String constructor altogether to optimize for speed:
(As no compiler would ever be able to detect that the arguments of the constructor are constants)
Or, as 4096 is a power of 2, we can use
return Range(0, n).AsEnumerable().Distinct().Aggregate<int, string, string>("", (string x, int y, string z) => x + z, (string x) => x.ToString());Admin
It was a Unary program that moves the pointer to the right and does nothing else. Okay then.
Admin
Only 4081 characters, yes. The number of bytes depends.
Admin
No, this is the new Zero:
http://vignette2.wikia.nocookie.net/ninehourspersonsdoors/images/c/cc/Zero-Escape-3-Ann-Init-600x300.jpg
Admin
Aaaagh! The capitalized string! Don't you people ever consider that someone might want to use aString class from a different namespace some day? All of you are writing awful unmaintainable code!
Admin
It just crossed my mind that magic numbers are evil™.
So we should use something like this:
Admin
I hope this was intentional.
Admin
so it doesn't matter how many zeros you ask for
repeatedZeroString()
will always give you 4K.BRILLANT!
Admin
Justified by that nobody would be so stupid to assign a constant with 4096 in its name anything else than 4096.
Admin
is that better? :tropical_fish:
Admin
TRWTF is nobody being afraid WHY there is a 4K '0'-filled string in the first place...
Admin
it's more we're afraid of the answer to that question.
Admin
I'm sure it makes sense in context.