Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c=peripheral.wrap("top")
- difficulty=20
- Mode={"+","-","*","/"}
- while true do
- i1=math.random(1,difficulty)
- i2=math.random(1,difficulty)
- mode=math.random(1,4)
- c.say(tostring(i1)..Mode[mode]..tostring(i2))
- if mode==1 then res=i1+i2 end
- if mode==2 then res=i1-i2 end
- if mode==3 then res=i1*i2 end
- if mode==4 then res=math.floor(i1/i2*100)/100
- e,player,message = os.pullEvent("chat")
- while message~=tostring(res) do
- print(player..message)
- e,player,message = os.pullEvent("chat")
- end
- c.say(player.." du hast recht!")
- sleep(1)
- end
Add Comment
Please, Sign In to add comment