The Original Gay Porn Community - Free Gay Movies and Photos, Gay Porn Site Reviews and Adult Gay Forums

  • Welcome To Just Us Boys - The World's Largest Gay Message Board Community

    In order to comply with recent US Supreme Court rulings regarding adult content, we will be making changes in the future to require that you log into your account to view adult content on the site.
    If you do not have an account, please register.
    REGISTER HERE - 100% FREE / We Will Never Sell Your Info

    PLEASE READ: To register, turn off your VPN (iPhone users- disable iCloud); you can re-enable the VPN after registration. You must maintain an active email address on your account: disposable email addresses cannot be used to register.

Because I am both bored and a geek:

winterknight

Pure in Heart
Joined
Sep 17, 2005
Posts
7,493
Reaction score
1
Points
0
Location
Suffolk
Website
www.goldeneyes.org.uk
Those of you who have access to it (and if you don't know that you have, chances are that you haven't) type the following into a shell and watch what it does:

Code:
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++$_'

Major kudos to anyone who can explain how it works WITHOUT looking it up.
 
this is the shortest algorithm for it ever.

ok it isn't, it needs perl :P

i don't even care about trying to figure what exactly it is doing. perl was created just for obfuscated programming freaks ;)
 
Okay, how are you getting separate lines on that? It's all one line.

and the -wle are options to the interpreter, it shouldn't be parsing them as part of the script.

Looks like the quoting in your terminal has gone screwey to me.
 
i wanna do it, but i dont even know where to put that
 
It counts, yes. And it will go on counting until you tell it to stop.

But it doesn't print every number it counts to.

The ones it does all have something in common.
 
Something else that's geeky, copy & paste this into the address bar of this page (not a new blank tab) and press return:

Code:
javascript:L=document.images[0]; O=L.offsetTop;L.style.position='relative'; L.style.zIndex=(h=L.height>>1); d=new Date().valueOf();  P=L.parentNode;for(i=0;i<8;i++ )P.innerHTML+='<div style="position:absolute; left:0;border:2px '+ (k='rgb('+ Math.round( 128+127*Math.cos(d-4 )) +','+ Math.round(128+127*Math.cos(d-2)) +','+ Math.round(128+127*Math.cos(d+=.2)) +')') +' outset;border-width:2px 0; width:100%;height:8px; background:'+k +'"></div>'; H=P.getElementsByTagName('div'); t=setInterval(' t+=.05;for(i=0;i<H.length;i++){ a=t+i/3;H[i].style.top=(O+h*(1+1.1*Math.sin(a)))+"px"; H[i].style.height= Math.round((H[i].style.zIndex=Math.round( h*(1+Math.cos(a) )))/16+4) +"px"}',20);void(0)
 
Well winterknight, by observing the first no's generated, using a video capture prog as it was so fast, and the fact that the no's get further apart and take longer to calculate and are all odd and my processor started to work harder I am guessing it is a prime number generator, am I close? God I must be bored!!
 
ok ok, could someone PLEASE tell me how to put it into a shell. I am sure i have one. lol
 
Working out what it's doing is easy.

Working out how is much harder.

Ok, I admit it, you are the Geek incarnate! Talk me through it if you can be bothered with us mere curious mortals. I thought I did well to work out what it was doing from the results but I am always open to explanations from a human be he Geek or not. I could do the search thing but would rather have it explained interactively. *tentative (*8*)*
 
Back
Top