Advertisement
BIOSFERA

Untitled

Oct 19th, 2017
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. local event = require("event")
  2. local component = require("component")
  3. local gpu = component.gpu
  4. event.shouldInterrupt = function() return false end
  5. event.shouldSoftInterrupt = event.shouldInterrupt
  6.  
  7. --------------------------------------------------------------
  8.  
  9. function menu0()
  10. print("\n МАГАЗИН\n")
  11. print("1. Продажа")
  12. print("2. Покупка ")
  13. print("3. Об авторе")
  14. print("4. Оставить отзыв\n")
  15. print("* для навигации в меню введите номер интересующего вас пункта")
  16. local text = tonumber(io.read())
  17. if text == 1 then
  18. sale()
  19. elseif text == 2 then
  20. purchase()
  21. elseif text == 3 then
  22. about()
  23. elseif text == 4 then
  24. zpOtz("No name")
  25. end
  26. end
  27.  
  28. function sale()
  29. print("\nДанная опция в разработке\n")
  30. print("* для навигации в меню введите номер интересующего вас пункта")
  31. local text = tonumber(io.read ())
  32. end
  33.  
  34. function purchase()
  35. print("\nДанная опция в разработке\n")
  36. print("* для навигации в меню введите номер интересующего вас пункта")
  37. local text = tonumber(io.read ())
  38. end
  39.  
  40. function about()
  41. print("\nПрограмма 'Магазин' разработана и набрана на телефоне Nokia 309\nРазработчик - Asior\nИзменять код разрешаю\n")
  42. print("* для навигации в меню введите номер интересующего вас пункта")
  43. local text = tonumber(io.read ())
  44. end
  45.  
  46. function zpOtz(name)
  47. print("\nТут вы можете оставить свой отзыв\nДля сохранения отзыва нажмите Enter")
  48. local text = io.read()
  49. if text ~=""then
  50. local file = io.open("../Otz.txt","a")
  51. print("Идет сохранение вашего отзыва")
  52. print(file:write(name.." > "..text.."\n"))
  53. file:close(file)
  54. end
  55. end
  56.  
  57. gpu.setResolution(40, 40)
  58.  
  59. while true do
  60. menu0()
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement