Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("miletokm ", "feettokg ","calendar ","notice ", "string")--Список функций
- local function miletokm()--мили в километры
- print ("Введите кол-во миль")
- local mtk = io.read()
- print (mtk, "mile = ", mtk * 1.61, "km")
- end
- local function feettokg()--футы
- print ("Введите кол-во футов")
- local ptk = io.read()
- print (ptk, "feets =", ptk * 0.45, "kg")
- end
- local function calendar()--календарь
- io.write ("Дата: ")
- local var = os.date()
- print (var)
- end
- local function notice()--уведомление
- print ("Введите кол-во секунд")
- local t = tonumber(io.read())
- local n = io.read()
- os.sleep(t)
- print (n)
- end
- local function string()--строка
- add1 = io.read()
- s1 = tonumber(io.read())
- add2 = io.read()
- s2 = tonumber (io.read())
- add3 = io.read()
- s3 = tonumber (io.read())
- add4 = io.read()
- s4 = tonumber (io.read())
- add5 = io.read()
- s5 = tonumber (io.read())
- while true do--Печатаем рекламу в бесконечном цикле, который можно остановить только ошибкой
- print (add1)
- os.sleep(s1)
- print (add2)
- os.sleep(s2)
- print (add3)
- os.sleep(s3)
- print (add4)
- os.sleep(s4)
- print (add5)
- os.sleep(s5)
- end
- end
- local exit=false
- while not exit do
- local control = io.read()--Здесь вас спрашивают, какаю функцию вы хотите использовать
- if control == "miletokm" then miletokm()
- elseif control == "feettokg" then feettokg()
- elseif control == "calendar" then calendar()
- elseif control == "notice" then notice()
- elseif control == "stop" then exit = true
- elseif control == "string" then string()
- elseif control == "help" then print ("miletokm ", "feettokg ","calendar ","notice ", "string")--Список функций
- else print ("Такой функции не найдено")
- end
- end
Add Comment
Please, Sign In to add comment