First Python Script: Roman Numbers

Tim Roberts timr at probo.com
Sat Apr 14 02:04:23 EDT 2001


Mark Pilgrim <f8dy at diveintopython.org> wrote:

>Jim Dennis jimd at vega.starshine.org wrote:
>
>> Way back when I was taking classes
>> at a community college and learning Pascal, I got an assignment to
>> convert numbers to roman numeral strings.  After tangling with the
>> various rules for a bit, I realized that I could actually eliminate
>> most of the conditionals by using a more elegant list of tokens.
>
>An excellent idea.  I too have a small set of programs that I re-implement
>in every new language.  I like this one; I'll add it to my list.

A hundred years ago, when I took Theory of Computation at Oregon State, I
did a roman numeral-to-decimal translator in a state/tape-based Turing
machine simulator.  It requires an impressive number of states to do that
translation...
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list