Sie sind vermutlich noch nicht im Forum angemeldet - Klicken Sie hier um sich kostenlos anzumelden Impressum 
Sie können sich hier anmelden
Dieses Thema hat 1 Antworten
und wurde 464 mal aufgerufen
 Taberna
Raman Offline




Beiträge: 167

18.09.2020 20:57
#1 Scrabble with Roman numerals Zitat · Antworten

Exotic dictionary - Scrabble with Roman numerals

Exotic dictionary - Scrabble with Roman numerals


2 points: M ×20, C ×20, X ×20
3 points: I ×19
5 points: D ×7, L ×7, V ×7

That is ideally played with 7 tiles in rack for obtaining within best results, but players can change this number freely enough depending upon their own wishes and depending upon their own tastes.





Usage: python roman.py > roman.dic (Python 2.7)

roman.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
def Roman(n):
cRomanString = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
cRomanValue = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
x = 0
result = ''
while n > 0:
if n / cRomanValue[x] >= 1:
result += cRomanString[x]
n -= cRomanValue[x]
else:
x += 1
return result
print "[Header]"
print "Version=100000"
print "Author=Raman Viswanathan <raman22feb1988@gmail.com>"
print "StandardCategory=Roman Numerals"
print "Licence=GNU General Public License, v3"
print "Comment=This dictionary contains all Roman Numerals from 1 to 3999"
print "[Replace]"
print "[Categories]"
print "[Words]"
for i in range(1, 4000):
print Roman(i) + "=" + str(i)
 


Bussinchen Offline




Beiträge: 90

19.09.2020 04:17
#2 RE: Scrabble with Roman numerals Zitat · Antworten

Wow! Cool!

 Sprung  
Xobor Forum Software von Xobor.de
Einfach ein Forum erstellen
Datenschutz