Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component") local gpu = component.gpu local pull_e = require('event').pull local W, H = gpu.getResolution() local math = require("math") local redstone = component.redstone local sides = require("sides")
- function menu() gpu.setBackground(0x000000) gpu.setForeground(0x2F4F4F) gpu.fill(1,1,W,H," ") gpu.fill(1,1,1,H,"|") gpu.fill(2,1,1,H,"|") gpu.fill(W,1,W,H,"|") gpu.fill(W-1,1,W,H,"|") gpu.fill(1,1,W,1,"=") gpu.fill(1,H,W,H,"=") gpu.fill(35,1,2,H,"|") gpu.setForeground(0x4169E1) gpu.set(3,2,"что бы начать игру, нажми старт") gpu.set(3,4,"Выпало 3 одинаковых, ты выйграл")gpu.set(3,6,"Если нет одинаковых, ты проиграл") end
- function one(x,y) gpu.setBackground(0x4169E1) gpu.set(x+2,y," ") gpu.fill(x,y+1,5,1," ") gpu.fill(x+3,y,2,6," ") gpu.setBackground(0x000000) end
- function two(x,y) gpu.setBackground(0x800080) gpu.set(x,y+1," ") gpu.fill(x+1,y,4,1," ") gpu.set(x+4,y+1," ") gpu.set(x+3,y+2," ") gpu.set(x+2,y+3," ") gpu.set(x+1,y+4," ") gpu.fill(x,y+5,5,1," ") gpu.setBackground(0x000000) end
- function three(x,y) gpu.setBackground(0x008000) gpu.set(x,y+1," ") gpu.fill(x+1,y,3,1," ") gpu.set(x+4,y+1," ") gpu.fill(x+3,y+2,1,2," ") gpu.set(x+4,y+4," ") gpu.fill(x+1,y+5,3,1," ") gpu.set(x,y+4," ") gpu.setBackground(0x000000) end
- function four(x,y) gpu.setBackground(0x808000) gpu.fill(x,y,1,3," ") gpu.fill(x,y+2,5,1," ") gpu.fill(x+4,y,1,6," ") gpu.setBackground(0x000000) end
- function five(x,y) gpu.setBackground(0x00FFFF) gpu.fill(x,y,5,1," ") gpu.fill(x,y,1,3," ") gpu.fill(x,y+2,4,1," ") gpu.fill(x+4,y+3,1,2," ") gpu.fill(x,y+5,4,1," ") gpu.setBackground(0x000000) end
- function six(x,y) gpu.setBackground(0xFF0000) gpu.fill(x+1,y,4,1," ") gpu.fill(x,y+1,1,4," ") gpu.fill(x+1,y+5,3,1," ") gpu.fill(x+1,y+2,3,1," ") gpu.fill(x+4,y+3,1,2," ") gpu.setBackground(0x000000) end
- function seven(x,y) gpu.setBackground(0xFFFF00) gpu.fill(x,y,5,1," ") gpu.fill(x+4,y,1,3," ") gpu.set(x+3,y+3," ") gpu.set(x+2,y+4," ") gpu.set(x+1,y+5," ") gpu.setBackground(0x000000) end
- function ramka(x,y) gpu.setBackground(0x2F4F4F) gpu.fill(x,y,10,1," ") gpu.fill(x+9,y,1,10," ") gpu.fill(x,y,1,10," ") gpu.fill(x,y+9,10,1," ") gpu.setBackground(0x000000) end
- function start() gpu.setBackground(0x2F4F4F) gpu.fill(4,25,29,3," ") gpu.set(16,26,"СТАРТ") gpu.setBackground(0x000000) end
- function menu1() gpu.fill(1,1,W,H," ") gpu.setBackground(0x2F4F4F) gpu.fill(49,24,54,3," ") gpu.setForeground(0x4169E1) gpu.set(50,25,"Для того что бы начать игру положи 1$ в приобретатель") gpu.setForeground(0xFFFFFF) gpu.setBackground(0x000000) end
- menu1()
- while true do
- if redstone.getInput(sides.north) > 0 then gpu.fill(1,1,W,H," ")
- menu()
- start()
- ramka(50,14) ramka(80,14) ramka(110,14)
- gpu.setForeground(0x800080) gpu.set(50,10,"список призов: нано-шлем, нано-поножи, нано-ботинки, улучшенный нано-жилет, джетпак, энергетический кристалл") gpu.set(50,12,"материя, иридий, ускоритель") local tevent = {pull_e('touch')}
- if tevent[3] > 3 and tevent[3] < 33 and tevent[4] > 24 and tevent[4] < 29 then
- for i = 1,10 do local random = math.random(8) if random == 1 then gpu.fill(51,15,8,8," ") one(52,16) end if random == 2 then gpu.fill(51,15,8,8," ") two(52,16) end if random == 3 then gpu.fill(51,15,8,8," ") three(52,16) end if random == 4 then gpu.fill(51,15,8,8," ") four(52,16) end if random == 5 then gpu.fill(51,15,8,8," ") five(52,16) end if random == 6 then gpu.fill(51,15,8,8," ") six(52,16) end if random == 7 then gpu.fill(51,15,8,8," ") seven(52,16) end os.sleep(0.2) end local first = random
- for i = 1,10 do local random = math.random(8) if random == 1 then gpu.fill(81,15,8,8," ") one(82,16) end if random == 2 then gpu.fill(81,15,8,8," ") two(82,16) end if random == 3 then gpu.fill(81,15,8,8," ") three(82,16) end if random == 4 then gpu.fill(81,15,8,8," ") four(82,16) end if random == 5 then gpu.fill(81,15,8,8," ") five(82,16) end if random == 6 then gpu.fill(81,15,8,8," ") six(82,16) end if random == 7 then gpu.fill(81,15,8,8," ") seven(82,16) end os.sleep(0.2) end local second = random
- for i = 1,10 do local random = math.random(8) if random == 1 then gpu.fill(111,15,8,8," ") one(112,16) end if random == 2 then gpu.fill(111,15,8,8," ") two(112,16) end if random == 3 then gpu.fill(111,15,8,8," ") three(112,16) end if random == 4 then gpu.fill(111,15,8,8," ") four(112,16) end if random == 5 then gpu.fill(111,15,8,8," ") five(112,16) end if random == 6 then gpu.fill(111,15,8,8," ") six(112,16) end if random == 7 then gpu.fill(111,15,8,8," ") seven(112,16) end os.sleep(0.2) end local three = random
- end
- if first == second and second == three then redstone.setOutput(sides.top,16) redstone.setOutput(sides.top,0) end os.sleep(3) menu1()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement