Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: 99 bottles, 2 linesby jepri (Parson) |
on Nov 28, 2000 at 13:40 UTC ( [id://43638]=note: print w/replies, xml ) | Need Help?? |
You are a most remarkable programmer, chipmunk. I just spent four and a half hours working on this one instead of my essay and still didn't get anywhere. Here's my best:
but the output isn't as nice as yours.
I had this great idea using quines and self-modifying code, but I was beaten by s///. The idea was to find every number in the program and decrement it by one with s/\d{2}/$1--/g but $1 is read only so I couldn't (my lesson for today). Oh well. The following code actually works.
____________________
In Section
Code Catacombs
|
|