in reply to Re^2: Code Golf: Four is magic
in thread Code Golf: Four is magic
That actually has problems with large numbers (> native integer ?) Once it gets over 64 bits on my machine it converts to scientific notation... which throws off the conversion.
Never mind. Broken
Here's my whack at it - 232 strokes
perl -E'@x=split//,"4335443554366887798866555766";$_=<>;chop;print;whi +le($_-4){split//,"99aabb87780";$x=0;$x+=hex(pop)*!!$&+($1&&$x[$1]+7)+ +($2>1?$x[$2+18]+$x[$3]:$x[$2.$3])while s/(.??)(.?)(.)$//;say" is $x." +;print$_=$x}say" is magic."' __END__ 999999999999999999999999999999999 999999999999999999999999999999999 is 231. 231 is 19. 19 is 8. 8 is 5. 5 is 4. 4 is magic.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Code Golf: Four is magic
by duelafn (Parson) on Jul 14, 2010 at 01:50 UTC | |
by Haarg (Priest) on Jul 14, 2010 at 03:04 UTC | |
by duelafn (Parson) on Jul 14, 2010 at 14:09 UTC |
In Section
Meditations