Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- spanish numbers thing (i take spanish ok?)
- local tens = {"","","treinta","cuarenta","cincuenta","sesenta","setenta","ochenta","noventa","cien"}
- local ones = {" y uno"," y dos"," y tres"," y cuatro"," y cinco"," y sies"," y siete"," y ocho"," y nueve"}
- -- first 1-20
- print("1 | uno")
- print("2 | dos")
- print("3 | tres")
- print("4 | cuatro")
- print("5 | cinco")
- print("6 | sies")
- print("7 | siente")
- print("8 | ocho")
- print("9 | nueve")
- print("10 | diez")
- print("11 | once")
- print("12 | doce")
- print("13 | trece")
- print("14 | catorce")
- print("15 | quince")
- print("16 | dieciséis")
- print("17 | diecisiete")
- print("18 | dieciocho")
- print("19 | diecinueve")
- print("20 | veinte")
- print("21 | veintiuno")
- print("22 | veintidós")
- print("23 | veintitrés")
- print("24 | veinticuatro")
- print("25 | veinticinco")
- print("26 | veintiséis")
- print("27 | veintisiete")
- print("28 | veintiocho")
- print("29 | veintinueve")
- function numstr(x)
- return tostring(x)
- end
- function seperate(x)
- x = tostring(x)
- x = string.sub(x,1,1)
- return tonumber(x)
- end
- function seperatet(x)
- x = tostring(x)
- x = string.sub(x,2,2)
- return tonumber(x)
- end
- local number = 30
- while number ~= 100 do
- if string.sub(numstr(number),2,2) == "0" then
- print(number.." | "..tens[seperate(number)])
- number = number + 1
- else
- print(number.." | "..tens[seperate(number)]..ones[seperatet(number)])
- number = number + 1
- end
- end
- print("100 | cien")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement