partial bugfix: make grid consistent
This was satisfying to visually debug.
But now we can again end up with totals over 10 😅
This commit is contained in:
parent
d6b1b38d6a
commit
69b803b9f2
|
@ -1 +1 @@
|
|||
Debug_animation_period = 0.3 -- seconds between animation frames
|
||||
Debug_animation_period = 1 -- seconds between animation frames
|
|
@ -1,7 +1,7 @@
|
|||
on.keychord_press = function(chord, key)
|
||||
print(chord)
|
||||
if chord == 'C-n' then
|
||||
new()
|
||||
animate(new)
|
||||
elseif chord == '`' then
|
||||
if Draw == 'problem' then
|
||||
Draw = 'solution'
|
||||
|
|
|
@ -7,14 +7,19 @@ generate = function()
|
|||
{'', ''},
|
||||
},
|
||||
}
|
||||
Solution = g
|
||||
g.data[1][1] = math.random(1,9)
|
||||
-- loiter()
|
||||
local d11 = g.data[1][1]
|
||||
g.row_totals[1] = math.random(d11+1,10)
|
||||
g.col_totals[1] = math.random(d11+1,10)
|
||||
-- loiter()
|
||||
g.data[1][2] = g.row_totals[1] - d11
|
||||
g.data[2][1] = g.col_totals[1]-d11
|
||||
g.row_totals[2] = math.random(g.data[1][2]+1,10)
|
||||
-- loiter()
|
||||
g.col_totals[2] = math.random(g.data[2][1]+1,10)
|
||||
g.data[2][2] = g.col_totals[2]-g.data[2][1]
|
||||
Solution = g
|
||||
-- loiter()
|
||||
g.data[2][2] = g.col_totals[2]-g.data[1][2]
|
||||
-- loiter()
|
||||
g.row_totals[2] = g.data[2][1] + g.data[2][2]
|
||||
end
|
Loading…
Reference in New Issue