I was thinking about making a Roman-Arabic numeral converter for the TI-84+CSE/CE. I found one at http://www.ticalc.org/archives/files/fileinfo/202/20226.html on ticalc, but I couldn't find one in the archives. Would this be a waste of time, or a valuable addition to the Cemetech archives? I think I already have an idea of how I would do it:
    ▪Display some text about converting stuff at top of screen
    ▪Initially, Roman to Arabic or Arabic to Roman is chosen
    ▪Near the top, I would show Arabic: [stuff] and Roman: [stuff] on two different lines
    ▪Clear allows the user to choose what to convert again/quit.
    ▪I would have selections of characters for Roman to Arabic
    ▪Values would be stored into I, V, X, and so on until the one that is 500 (this will be a learning experience for me too. Smile).

Please reply with feedback! I will make a demo and screenshots.
I know it isn't good form to give code instead of help, but I wrote this two-way converter a while ago, borrowing a code snippet from Ed H. It's not very flashy, but it's functional and very small, so I suggest you use it as the core of your program.


Code:
"IVXLCDM"→Str3
Input Str1
expr("0"+Str1→N
If N
Then      ;Str1 is an Arabic numeral
" "→Str1
For(I,0,log(N
.1int(N→N
10fPart(N→A
While A
.1sum({22,42,74}(A={4,5,9→B
A-1-int(B→A
sub(Str3,2I+5fPart(B)+1,1)+Str1→Str1
End
End
Else        ;Str1 is a Roman numeral
.5seq(inString(Str3,sub(Str1,X,1)),X,1,length(Str1
sum(10^(int(Ans))(.5+fPart(Ans)-2(Ans<ΔList(cumSum(augment(Ans,{0
End
Ans
lirtosiast wrote:
I know it isn't good form to give code instead of help, but I wrote this two-way converter a while ago, borrowing a code snippet from Ed H. It's not very flashy, but it's functional and very small, so I suggest you use it as the core of your program.


Code:
"IVXLCDM"→Str3
Input Str1
expr("0"+Str1→N
If N
Then      ;Str1 is an Arabic numeral
" "→Str1
For(I,0,log(N
.1int(N→N
10fPart(N→A
While A
.1sum({22,42,74}(A={4,5,9→B
A-1-int(B→A
sub(Str3,2I+5fPart(B)+1,1)+Str1→Str1
End
End
Else        ;Str1 is a Roman numeral
.5seq(inString(Str3,sub(Str1,X,1)),X,1,length(Str1
sum(10^(int(Ans))(.5+fPart(Ans)-2(Ans<ΔList(cumSum(augment(Ans,{0
End
Ans


Couldn't one implement the part where you multiply the value by 1000 by adding a line over the top? I'm thinking a program that draws Text() commands slightly over one another so that there is a Minus sign over the letter. I'm probably going to attempt this at some point, but I doubt I'll get to it before someone else.
Since it's Halloween soon, this is kinda relevant:
https://www.cemetech.net/projects/uti/viewtopic.php?p=58792#58792
https://www.cemetech.net/projects/uti/viewtopic.php?p=138098#138098
DJ_O wrote:

Cool!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement