| hobbs | integral: mischan again ;) |
| LeoNerd | I can never spell it |
| hobbs | The Sieve of erxz_paste! |
| integral | hobbs: No, the conversation had moved on there, and I didn't want to waste my golfing |
| mauke | eratosthenes? |
| hobbs | ah |
| integral | LeoNerd: yes, it's a bit like Eratosthenes' Sieve |
| Ani-_ | You call that golfing?! Such a long thing? :) |
| LeoNerd | That's the one |
| integral | TBH I think that's the best pattern for the code. I'd like to see a infinite stream haskell/lisp version though Ani-_: That's the smallest I can get for that particular algorithm eval: for(1..32){$..=($_%3?'':F).($_%5?'':b);print$.||$_} |
| buubot | integral: 1 2 F F Fb FbF FbF FbF FbFF FbFFb FbFFb FbFFbF FbFFbF FbFFbF FbFFbFFb FbFFbFFb FbFFbFFb FbFFbFFbF FbFFbFFbF FbFFbFFbFb FbFFbFFbFbF FbFFbFFbFbF FbFFbFFbFbF FbFFbFFbFbFF FbFFbFFbFbFFb FbFFbFFb |
| integral | darn. silly me. |
| mauke | integral: you can save two chars by removing quotes |
| integral | mauke: where? |
| mauke | $_[$_*3]=F etc |
| integral | eval: for(1..32){$.=($_%3?'':F).($_%5?'':b);print$.||$_} |
| buubot | integral: 1 2 F 4 b F 7 8 F b 11 F 13 14 Fb 16 17 F 19 b F 22 23 F b 26 F 28 29 Fb 31 32 |
| integral | mauke: woops, I did that to my other one, but not that. that's my shortest :-( |
| alecs | hi there does anyone some good perl tutorials? does anyone knows some good perl tutorials? |
| hobbs | perlbot tutorial |
| perlbot | http://perlmonks.org/index.pl?node=Tutorials | http://perl.com/cs/user/query/q/6?id_topic=74 | http://learn.perl.org/ | http://books.perl.org/onlinebooks | http://perl-begin.berlios.de/tutorials/ | http://learn.perl.org/library/beginning_perl/ |
| sal|work | anyone know a oneliner that only prints the last line of a file? |
| Ani-_ | tail -n1 |
| mauke | eval: for(1..32){print"F"x!!($_%3).b x!!($_%5)||$_} |
| buubot | mauke: Fb Fb b Fb F b Fb Fb b F Fb b Fb Fb 15 Fb Fb b Fb F b Fb Fb b F Fb b Fb Fb 30 Fb Fb |
| sal|work | well, I need to s/last line// |
| mauke | :( |
| hobbs | perl -ne 'print if eof' |
| integral | eval: @a=('','',F)x5;@b=(('')x4,'b')x3;print+($a[$_&15].$b[$_&15])||$_ for 1..32 |
| buubot | integral: 1 F 3 b F 6 7 F b 10 F 12 13 Fb 15 16 17 F 19 b F 22 23 F b 26 F 28 29 Fb 31 32 |
| integral | empty strings are too long. |
| mauke | eval: for(1..32){print"F"x!($_%3).b x!($_%5)||$_} |
| buubot | mauke: 1 2 F 4 b F 7 8 F b 11 F 13 14 Fb 16 17 F 19 b F 22 23 F b 26 F 28 29 Fb 31 32 |
| mauke | eval: print"F"x!($_%3).b x!($_%5)||$_ for 1..32 |
| buubot | mauke: 1 2 F 4 b F 7 8 F b 11 F 13 14 Fb 16 17 F 19 b F 22 23 F b 26 F 28 29 Fb 31 32 |