![]() |
Infinite Loops
Wouln't it be fun to check out how many infinite loops there are? I found... four. The Timeout loop.
if (playerenters||timeout){ //stuff timeout = 1; } the for loop for (i=1;i>0;i++){ //stuff; sleep 1; } the while loop while (1=1){ //stuff sleep 1; } the recursive function loop(); function loop(){ //stuff sleep 1; loop(); } i haven't tested above one =\ |
I know an infinite loop, it's called Graal, when it's running, of course. :p
|
I know another one, its called vendetta. And another one, it's called PKing.
|
Unless i'm mistaken (sorry if I am) sleep isnt a loop but a pause command? Also function(){} isn't a loop either.
|
Use several!!!!11
NPC Code: P.S:There are alot of infinite loop possibilities. |
Destorm, erm... well...
|
Quote:
|
Timeouts aren't really loops per se, nor are recursive functions. And a for loop is basically just an extended while.
|
Basically the only real loops are for and while although timeout can be used as a loop
|
you can have an infinite amount of loops anyway. I don't see the point in this but all you're doing is a creating a conditions that can never be satisfied... and in mathematics there's an unlimited amount of conditions like that.
while (1==1) while (2==2) while (3==3) while (1+1==2) while (1/1==1) while (1^1==1) while (1^3==1) hehe you get the point |
So who would like to slap him/her in the face first?
|
Quote:
|
*raised hand*
|
while (1==1) {
slapeveryone(); sleep .05; } function slapeveryone() { for (i=0;i==i;i++) { slapposter[i%postercount]; } slapeveryone(); } |
for (i=0;i=>2;i--) {
slapposter[i%postercount]; } why all the bells and whistles ;-) |
Quote:
*slaps* *gets slapped* |
id be happy with just sound effects...
if (strequals(#a,faenix)){ while(1==1){ play UBERSLAP.wav; } } oops.. forgive that post i just woke up lol |
Or you could do what they did in the earliest viruses, make something calculate Pi or the squareroot of two. Lovely thing, continued fractions.
|
isnt there an npc on 2k1 that calulates pi?
|
Quote:
|
pi is infinite...
|
Quote:
|
That's right. But would 1 divived by 3 have an infinite complxity or IS it infinite?
|
Quote:
|
Quote:
|
Quote:
|
was there a purpose to this thread at some point?
|
Quote:
|
Quote:
|
*gasps*
if (created) 1=random(0,450); :megaeek: |
*sigh*
I like the square root of 2. It's useful. Irrational numbers... bah they just.... they just aren't rational! |
irrational?? nu nu nu!! what if NASA only used rational numbers?? the hubbletelescope would crash into the earth and the sun would explode and 7-11's worldwide would lock their doors
|
| All times are GMT +2. The time now is 12:25 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.