Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Roman Numerals
Last updated at 9:58 pm UTC on 3 November 2020
This page contains information about Roman Numerals and their
implementation and use in Squeak.

Uses:

A ChangeSet implementing the encoding process was sent to the Squeak mailing list on 20 May 2000 for Squeak 2.8a by Andreas Kuckartz. Within 24 hours Stefan Matthias Aust refactored this contribution mercilessly and added the inverse method (the following task therefore is already obsolete:-). See Integer>>romanString and String>>romanNumber. The methods have been made part of the image later.


 WatchMorph new openInHand.
 WatchMorph new toggleRoman color: Color lightBlue ;openInHand
WatchMorph_with_and_without_Roman_numerals.png


 s := TranscriptStream new openLabel: 'Roman numerals'.
 1 to: 100 do: [:n | s model show: n printString.
	             s model show: ', ' .
	             s model show:  n  n printStringRoman.
                    s model cr]


1, I
2, II
3, III
4, IV
5, V
6, VI
7, VII
8, VIII
9, IX
10, X
11, XI
12, XII
13, XIII
14, XIV
15, XV
16, XVI
17, XVII
18, XVIII
19, XIX
20, XX
21, XXI
22, XXII
23, XXIII
24, XXIV
25, XXV
26, XXVI
27, XXVII
28, XXVIII
29, XXIX
30, XXX
31, XXXI
32, XXXII
33, XXXIII
34, XXXIV
35, XXXV
36, XXXVI
37, XXXVII
38, XXXVIII
39, XXXIX
40, XL
41, XLI
42, XLII
43, XLIII
44, XLIV
45, XLV
46, XLVI
47, XLVII
48, XLVIII
49, XLIX
50, L
51, LI
52, LII
53, LIII
54, LIV
55, LV
56, LVI
57, LVII
58, LVIII
59, LIX
60, LX
61, LXI
62, LXII
63, LXIII
64, LXIV
65, LXV
66, LXVI
67, LXVII
68, LXVIII
69, LXIX
70, LXX
71, LXXI
72, LXXII
73, LXXIII
74, LXXIV
75, LXXV
76, LXXVI
77, LXXVII
78, LXXVIII
79, LXXIX
80, LXXX
81, LXXXI
82, LXXXII
83, LXXXIII
84, LXXXIV
85, LXXXV
86, LXXXVI
87, LXXXVII
88, LXXXVIII
89, LXXXIX
90, XC
91, XCI
92, XCII
93, XCIII
94, XCIV
95, XCV
96, XCVI
97, XCVII
98, XCVIII
99, XCIX
100, C





Here is another task:

"Devise an algorithm to decode roman numerals. (Hardly anybody gets it, but when somebody does, I say O.K., this person knows how to program.)"

("Managers Interview Questions and the Reasoning Behind Them" http://www.sdmagazine.com/mgrquest.htm)

References


Everyone "knows" that you should write a decimal to Roman number converter using a table. What happens if you try it test-first?
[Using C++]
http://www.differentpla.net/~roger/devel/xp/test_first/

ROMAN NUMERALS AND DATES
http://www.deadline.demon.co.uk/roman/front.htm

ROMAN NUMERAL AND DATE CONVERSION WITH ROMAN CALCULATOR & ROMAN NUMERALS TEST
[The JavaScript code in this page was the basis for
the implementation in Smalltalk]
http://www.guernsey.net/~sgibbs/roman.html

Roman Numerals
http://www.mcn.net/~jimloy/roman0.html
Page created by Andreas Kuckartz

1-Numeration.ppt
History of numbers - tallies, Aegyptian numbers, Roman Numerals, Hindu-Arabic Numerals, Mesopotamian number system based on 60