Syntactic Confectionery Delight | |
PerlMonks |
Re: What do you write when learning a new language?by starX (Chaplain) |
on Jun 04, 2008 at 16:03 UTC ( [id://690171]=note: print w/replies, xml ) | Need Help?? |
I write a Fibonacci sequence generator for much the same reasons: straightforward math, predictable output, and it requires looping. When it comes time to learn subroutines, I expand it to use a recursive approach to determining if the number is even or odd.
This likewise has the benefit of being expandable to include some simple input, whether it be on the command line or otherwise. Here's what it would look like if I were writing it in Perl...
--starX
In Section
Meditations
|
|