HVO2GCUOHSC6ZILSEEFY57KYQU4QQIMO5JF3HM32SOC4CYJWQI5QC
check_status = function()
for y=1,2 do
for x=1,2 do
if Problem.data[y][x] == '' then
return ''
elseif Problem.data[y][x] ~= Solution.data[y][x] then
return 'no'
end
end
end
return 'yes'
end
draw_status = function()
local w = App.width('check')
local x = Safe_width-w-20
local y = 50+love.graphics.getFont():getHeight()+150
button(Buttons, 'check', {x=x, y=y, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
icon = function(p)
App.color{r=0, g=0, b=0}
love.graphics.print('check', p.x+5, p.y+5)
end,
onpress1 = function()
Status = check_status()
end,
})
x = Safe_width-260
y = y+120
love.graphics.rectangle('line', x,y, 250,love.graphics.getFont():getHeight()+20)
if Status == 'yes' then
App.color{r=0, g=0.6, b=0}
love.graphics.print('yes!', x+10, y+10)
elseif Status == 'no' then
App.color{r=1, g=0, b=0}
love.graphics.print('sorry', x+10, y+10)
end
end
draw_next_button = function()
local w = App.width('next')
button(Buttons, 'next', {x=Safe_width-w-20, y=50, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
icon = function(p)
App.color{r=0, g=0, b=0}
love.graphics.print('next', p.x+5, p.y+5)
end,
onpress1 = function()
animate(new)
end,
})
end
-- Is the answer correct?
Status = '' -- incomplete. Can also be 'yes' or 'no'
local w = App.width('next')
button(Buttons, 'next', {x=Safe_width-w-20, y=50, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
icon = function(p)
App.color{r=0, g=0, b=0}
love.graphics.print('next', p.x+5, p.y+5)
end,
onpress1 = function()
animate(new)
end,
})
draw_next_button()
draw_status()