Advertisement
BIOSFERA

Untitled

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