This repository has been archived by the owner on Apr 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
86 lines (82 loc) · 1.82 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
--require("sudoku")
require("./lua/sudoku")
Debug = true
-------------
--Love Load--
-------------
function love.load()
--love.graphics.setWireframe(Debug)
Narray = {
love.graphics.newImage("Images/0.bmp"),
love.graphics.newImage("Images/1.bmp"),
love.graphics.newImage("Images/2.bmp"),
love.graphics.newImage("Images/3.bmp"),
love.graphics.newImage("Images/4.bmp"),
love.graphics.newImage("Images/5.bmp"),
love.graphics.newImage("Images/6.bmp"),
love.graphics.newImage("Images/7.bmp"),
love.graphics.newImage("Images/8.bmp"),
love.graphics.newImage("Images/9.bmp")}
CurrentS = sudoku.init()
AnswerS = sudoku.init()
----[[
CurrentS = {
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,9}}
--]]
love.graphics.setNewFont(16)
--love.graphics.setColor(0,0,0)
love.graphics.setBackgroundColor(0,0,0)
GDT = 0
DT = 0
Count = 0
Message = ""
sudoku.test()
print(package.path)
end
---------------
--Love Update--
---------------
function love.update(dt)
--love.timer.sleep(1)
--love.timer.getTime
DT = DT + dt
GDT = GDT + dt
if DT > 1 then
DT = 0
Count = Count + 1
end
CurrentS = sudoku.randomOne(CurrentS)
end
--Key pressed
function love.keypressed(keycode)
if keycode then love.event.quit()
end
end
-------------
--Love Draw--
-------------
function love.draw()
sudoku.draw()
if Debug then DebugDraw()
end
end
---------
--Debug--
---------
function DebugDraw()
love.graphics.setColor(0,255,0)
love.graphics.print("Hey".." "..Count.." "..GDT.." "..DT,0,450)
love.graphics.print(Message,0,500)
love.graphics.setColor(255,255,255)
end
function love.quit()
print("Thanks for playing! Come back soon! "..GDT)
end