Module:Sandbox/bfggf/sometest explained

cookies = 0term.clearcursorh = falseclr = 0costcl = 12rafir = truewhile true doterm.setBackgroundColor(colors.black)term.setCursorPos(1,9)print("Cookies: "..cookies.."")paintutils.drawPixel(23,9, colors.green)event, button, x, y = os.pullEventif cookies

30 and cursorh

false thenpaintutils.drawPixel(51, 1, colors.white)cursorh = trueelseif event

"mouse_click" and cursorh

true and x

51 and y

1 and cookies > 14 thencpx = math.random(22,24)cpy = math.random(8,10)paintutils.drawPixel(cpx, cpy, colors.white)if rafir

false thenclr = clr / 2elseclr = clr + 10rafir = falseendcostcl = costcl + 3cookies = cookies - costcl elseif event

"mouse_click" and x

23 and y

9 thencookies = cookies + 1endend