125 characters, or 123 if you eliminate that last line break. Looks remarkably like some of the other submissions here, but I didn't cheat and look at anyone else's solutions first - guess there just aren't many ways to do this while keeping it short.@d=split//,'4335443554366887798866555766';$n=int<STDIN>;while($n!=4){p +rint"$n is ";$n=$n<20?$d[$n]:$d[$n/10+18]+($n%10==0?0:$d[$n%10]);prin +t"$n.\n";}print"4 is magic.\n";
In reply to Re: Code Golf: Four is magic
by TedPride
in thread Code Golf: Four is magic
by deMize
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |