Re: [Tutor] Roman to digital (pseudocode)

2007-03-14 Thread János Juhász
Hi All, > - A dictionary will help you look up values, but not rules. It does > not retain its order and order is essential. Instead, create a tuple > of the roman numerals in ascending order (roman). Create a paired > tuple with the base 10 value (baseten). > Now get an element from the string

Re: [Tutor] Roman to digital (pseudocode)

2007-03-13 Thread Kent Johnson
Bob Gailer wrote: > Deep breath and big step back. > > The problem is not just how to code this in Python, but how to parse a > language (in this case Roman Numbers). > > I have studied formal language theory but am not an expert. So here's my > take on an algorithm that would save a lot o

Re: [Tutor] Roman to digital (pseudocode)

2007-03-13 Thread Kent Johnson
Alan Gilfoy wrote: > This, I heard, is more difficult than digital-to-Roman, since you have > to "read" the subtractive cases, with a smaller numeral placed before > a larger numeral, without simply adding all the numerals' values up > > I'm going to use a raw_input prompt to ask the user whic

Re: [Tutor] Roman to digital (pseudocode)

2007-03-13 Thread Clay Wiedemann
I am new to python and programming, so not sure if I should weigh in here. Nonetheless . . . Creating a dictionary seems fair, but I wonder about using pairs rather than single letters. Roman numerals are constructed from strict rules other than the allowable letter set -- here is the relevant wik

Re: [Tutor] Roman to digital (pseudocode)

2007-03-13 Thread Bob Gailer
Deep breath and big step back. The problem is not just how to code this in Python, but how to parse a language (in this case Roman Numbers). I have studied formal language theory but am not an expert. So here's my take on an algorithm that would save a lot of stress. Create a dictionary w

Re: [Tutor] Roman to digital (pseudocode)

2007-03-08 Thread Adam Bark
On 08/03/07, Alan Gilfoy <[EMAIL PROTECTED]> wrote: This, I heard, is more difficult than digital-to-Roman, since you have to "read" the subtractive cases, with a smaller numeral placed before a larger numeral, without simply adding all the numerals' values up I'm going to use a raw_input promp

[Tutor] Roman to digital (pseudocode)

2007-03-08 Thread Alan Gilfoy
This, I heard, is more difficult than digital-to-Roman, since you have to "read" the subtractive cases, with a smaller numeral placed before a larger numeral, without simply adding all the numerals' values up I'm going to use a raw_input prompt to ask the user which Roman numeral he/she want