Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.white)
- term.clear()
- for i=1,12 do
- paintutils.drawBox(i*3,3,i*3,18,colors.black)
- end
- for i=1,6 do
- paintutils.drawBox(3,i*3,36,i*3,colors.black)
- end
- paintutils.drawFilledBox(40,1,51,19,colors.black)
- paintutils.drawBox(45,4,48,5,colors.red)
- paintutils.drawBox(45,6,48,7,colors.blue)
- paintutils.drawBox(45,8,48,9,colors.yellow)
- paintutils.drawBox(45,10,48,11,colors.purple)
- paintutils.drawBox(45,12,48,13,colors.green)
- paintutils.drawBox(45,14,48,15,colors.orange)
- paintutils.drawBox(45,16,48,17,colors.brown)
- nTOc={1="red",2="blue",3="yellow",4="purple",5="green",6="orange",7="brown"}
- guessedFieldX=4
- while true do
- event,n,x,y=os.pullEvent("mouse_Click")
- if x>44 and x<49 then
- if y=>4 and y<=5 then
- currentColor="red"
- elseif y=>6 and y<=7 then
- currentColor="blue"
- elseif y=>8 and y<=9 then
- currentColor="yellow"
- elseif y=>10 and y<=11 then
- currentColor="purple"
- elseif y=>12 and y<=13 then
- currentColor="green"
- elseif y=>14 and y<=15 then
- currentColor="orange"
- elseif y=>16 and y<=17 then
- currentColor="brown"
- end
- end
- if y>=4 and y<=5 and x<=33 then
- guessedFieldY=4
- paintutils.drawBox(guessedFieldX,guessedFieldY,guessedFieldX+1,guessedFieldY+1,colors[currentColor])
- Field[guessedFieldY]=currentColor
- elseif y>=7 and y<=8 then
- guessedFieldY=7
- paintutils.drawBox(guessedFieldX,guessedFieldY,guessedFieldX+1,guessedFieldY+1,colors[currentColor])
- Field[guessedFieldY]=currentColor
- elseif y>=10 and y<=11 then
- guessedFieldY=10
- paintutils.drawBox(guessedFieldX,guessedFieldY,guessedFieldX+1,guessedFieldY+1,colors[currentColor])
- Field[guessedFieldY]=currentColor
- elseif y>=13 and y<=14 then
- guessedFieldY=13
- paintutils.drawBox(guessedFieldX,guessedFieldY,guessedFieldX+1,guessedFieldY+1,colors[currentColor])
- Field[guessedFieldY]=currentColor
- elseif y>=16 and y<=17 then
- guessedFieldY=16
- paintutils.drawBox(guessedFieldX,guessedFieldY,guessedFieldX+1,guessedFieldY+1,colors[currentColor])
- Field[guessedFieldY]=currentColor
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement