25 lines
527 B
Plaintext
25 lines
527 B
Plaintext
factorWords = {}
|
|
|
|
maxNr = val(input("Max number? "))
|
|
|
|
while true
|
|
factorInput = input("Factor? ")
|
|
if factorInput == "" then break
|
|
// Split input
|
|
parts = factorInput.split(" ")
|
|
factor = val(parts[0])
|
|
word = parts[1]
|
|
// Assign factor/word
|
|
factorWords[factor] = word
|
|
end while
|
|
|
|
for nr in range(1,maxNr)
|
|
matchingWords = ""
|
|
for factor in factorWords.indexes
|
|
if nr % factor == 0 then
|
|
matchingWords = matchingWords + factorWords[factor]
|
|
end if
|
|
end for
|
|
if matchingWords then print matchingWords else print nr
|
|
end for
|