|
|
|
| Non-WTF Job: Interface Designer/Front-end Developer at Naviance (DC) |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Next » |
|
Of course, the answer is: i++++++++++++++++++++++; [:P] |
Although, I should have used prefix notation... |
|
duh ... all you need is a recursive function, XML, and javascript and you are off and running !
|
|
More readable:
for (int j = 0; j < 11; j++) i++; |
|
WTF, of course you've got to use a loop, yes? And, I'd do it in Java
int j=0; for (int i=0; i<11; i++) { j++; } or better yet int j=0; for (int i=0; i<11; i=i+1) { j = j +1; } but personally, I'd use int j; . . . j +=11; but what do I know, I just been doing this stuff since Moses. - Mac |
|
Ha, ha! That's not more readable at all. Somehow my post got garbbled.
|
|
I know. You need to put it in a while loop!
while (i < (i+11)) { i++; } |
How about assembly, it workes better than javascript! Something to the effect of this, it has been awhile!
pusha mov ax, i mov bx, Bh add ax, bx mov i, ax popa
|
|
You guys call yourselves programmers? The way to do this is ++i; ++i; ++i; ++i; ++i; ++i; ++i; ++i; ++i; ++i; ++i; |
|
i beg to differ you should just overload the ++ operator
public static Complex operator ++(Complex c1) { return new Complex(c1 += 11); } |
|
How can you read that?!?! It has to be all on one LINE!!!
++i;++i;++i;++i;++i;++i;++i;++i;++i;++i;++i; |
|
for (; i < 11 ; ++i );
|
|
I can just see it now! int toAdd = 5; LMFAO! That was hilarious! |
why not mix it up a little ++i;i++;++i;i++;++i;i++;++i;i++;++i;i++;++i; |
|
c'mon...use OO, it's simpler:
private void button1_Click(object sender, System.EventArgs e) { Incrementer i = new Incrementer(0); i.OnTooFar += new Incrementer.TooFarHandler(number_OnTooFar); i = IncrementBy11(i); MessageBox.Show(i.Value.ToString()); } private bool _isTooFar = false; public Incrementer IncrementBy11(Incrementer number) { while(!_isTooFar) { number.Value++; } return number; } public class Incrementer { private int _value; public Incrementer(int value) { _value = value; } public int Value { get {return _value;} set { _value = value; OnTooFar(new TooFarArgs(_value)); } } public event TooFarHandler OnTooFar; public delegate void TooFarHandler(TooFarArgs args); public class TooFarArgs { public int HowMuch = 0; public TooFarArgs(int howMuch) { HowMuch = howMuch; } } } private void number_OnTooFar(FP.Member.TestApp.SqlBuilder.Incrementer.TooFarArgs args) { _isTooFar = args.HowMuch > 10; } |
|
For such exotic applications of the increment operator you will actually have to do it a little something like this: using System; namespace W.T.F Of course, if Nathan wants to increment by twelve we have to come up with a completely different beast... [8-|] [:P] |
Even without the forum software mangling the post this is my favorite. FYI this is how it really reads:
(reposted from firefox, becuase the forum software is too stupid to strip unnecessary HTML from the post when within a preformatted text block, and too stupid to allow an IE user the pleasure of the HTML button that the firefox version inexplicably has.) |
too funny I like the loop, let the compiler unroll that baby! and self documenting too! |
|
Um, won't i always be less than i + 11 if you keep incrementing it?
|
|
I'd say you definitely need a function for that, something like public int incrementBy11(ref int j) { for (int i=0; i<11; i++) { j++; } return j; }
in turn you simply [;)] use
int k=0; . . incrementBy11(ref k); nice! |
|
Everyone's missing the point... this guy doesn't just want any plain old incrementer. He wants one that goes to eleven!
|
and that is why I like it [;)] (steps away and starts grumbling something about forum software, again...) |
|
while(i++<11) { }
|
|
He's probably looking for
i += 11; |
|
Oh, you want to do it again? No problem, just add a new event handler:
private void number_OnTooFarAgain(FP.Member.TestApp.SqlBuilder.Incrementer.TooFarArgs args) { _isTooFar = args.HowMuch > 21; } |
You're right! I know how to fix it. int j = 0; while (i < (i+11)) { i++; j++; if (j == 11) { break; } } |
I'll leave it as an exercise to the reader to implement MyInt.ToString()... [:$] |
Winner! ROFLMAO |
|
Aw, now you've gone ahead and ruined the surprise. :)
|
|
Ok, this one truly hurts my eyes above all else, gawd 2 integers to increment one around what is already a worthless loop.....heck why don't we put this in VB.NET, and declare them all as objects too :-p while we have unlimited memory to spare...
|
|
template< class T > int main(int argc, char* argv[]) |
|
// increment by eleven
while(i != i + 11) { i++; } |
Save trees! Use less space! while(i++ < i + 11) {} [6] |
At which point does Natan realise he's asked a stupid question? How can people like this sleep at night calling themselves programmers? These, and many more question on WWTF news at 9 |
|
Hahahaha ... these are great!!
|
|
I was waiting for someone to make that joke. :)
|
|
I think a case statement will be the most efficient, unfortunately you can only increment positive numbers.
void add11(int* i) { if (*i > 11) { int j = *i -11; add11(&j); *i = 11 + j; } else { switch (*i) { case 0: *i = 11; break; case 1: *i = 12; break; case 2: *i = 13; break; case 3: *i = 14; break; case 4: *i = 15; break; case 5: *i = 16; break; case 6: *i = 17; break; case 7: *i = 18; break; case 8: *i = 19; break; case 9: *i = 20; break; case 10: *i = 21; break; case 11: *i = 22; break; /* DON'T WANT THIS TO HAPPEN */ default: exit(); } } } |
Damn it, I forgot this ain't Slashdot and this board doesn't thread the messages for you, so I didn't quote. Everyone ignore the idiot in the corner... |
|
Many people here are making the same WTFs! Look at this one closely. i will never be equal to i+11!
|
Sorry, forgot to quote the one I was talking about. |
|
So, is lamecoder the only one here besides me who got the Spinal Tap reference?
|
Not necessarily. Eventaully, i will overflow (if I have too much [B] :P) and then it will be significantly more that i+11 - to be exact, if it's a signed 32-bit int, i will be 2147483637 and i+11 will be -2147483638. Of course, there might be slightly easier, faster and clearer ways of setting i to 2147483637, but that would hardly be in the spirit of this WTF, would it? :-) |
|
I personally like this one:
i++; ++i; i++; ++i; i++; ++i; i++; ++i; i++; --i; i--; i++; i++; ++i; ++i; |
|
++++++++++++i++++++++++++++;
|
|
Damn you and your crazy posting interface, that "[B]" was meant to be the glass of beer from the smilies :-/
|
|
Yes! Good spinal Tap reference! I also love the "incrementor" class library, that will be really handy. Also, it's pretty funny how a few posts in this thread are people who don't get the joke(s).... |
|
What amazes me is the number of people here who are posting code that
would just set i to 11, rather than to i + 11, or is that just another deliberate wtf? |
OMFG!!! stop it! you're killing me!! hahahahaha! |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Next » |