Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
[oneliners] prime genrator in 34 bytes
Simon Strandgaard
3/24/2005 2:55:00 AM
The previous record seen on
http://rubygarden.org/ruby...
seems to to have been 46 bytes (its unclear who the author was).
JIX proposed this 34 bytes long solution.
i=l=1;(l%i+=1)>i-2&&p(i)while l*=i
Congratulations Jix, it was entertaining me and flgr.
I proposed a 40 bytes solution that isn't endless:
l=1;2.upto(1000){|i|p i if l%i>i-2;l*=i}
--
Simon Strandgaard
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
[oneliners] prime genrator in 34 bytes
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password