Compare commits
2 Commits
54664d823a
...
54193eca80
Author | SHA1 | Date | |
---|---|---|---|
54193eca80 | |||
9e7481f75b |
2
.gitignore
vendored
2
.gitignore
vendored
@ -46,3 +46,5 @@ luac.out
|
||||
|
||||
|
||||
# End of https://www.gitignore.io/api/lua
|
||||
|
||||
build/
|
||||
|
14
Makefile
Normal file
14
Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
.PHONY: run
|
||||
run:
|
||||
@love .
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
@zip -9 -r /tmp/Sudoku.love . -x '*.git*'
|
||||
@mkdir -p build
|
||||
@mv /tmp/Sudoku.love build
|
||||
@cat static-binaries/love-arm64 build/Sudoku.love > build/sudoku-arm64
|
||||
@chmod +x build/sudoku-arm64
|
||||
@cat static-binaries/love-amd64 build/Sudoku.love > build/sudoku-amd64
|
||||
@chmod +x build/sudoku-amd64
|
||||
|
8
main.lua
8
main.lua
@ -1,4 +1,4 @@
|
||||
sudoku = require "sudoku.sudoku"
|
||||
sudoku = require "sudoku"
|
||||
uiUtils = require "ui.utils"
|
||||
config = require "config"
|
||||
SudokuCanvas = require "ui.sudokucanvas"
|
||||
@ -7,12 +7,16 @@ board = {}
|
||||
|
||||
function love.load()
|
||||
love.window.setTitle("Sudoku!")
|
||||
love.window.fullscreen = true
|
||||
|
||||
love.window.setMode(0, 0)
|
||||
love.mouse.setGrabbed(false)
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
math.randomseed(os.time())
|
||||
board = sudoku.loadBoard(config.board.filePath)
|
||||
local width, height = love.graphics.getDimensions()
|
||||
-- local width, height = love.graphics.getDimensions()
|
||||
local width, height = love.window.getDesktopDimensions()
|
||||
love.window.setMode(width, height, {fullscreen = true})
|
||||
sudokuCanvas = SudokuCanvas:new(500, 50, height/1.1, config.SudokuCanvas)
|
||||
sudokuCanvas:setBoard(board[1])
|
||||
myFont = love.graphics.newFont(24)
|
||||
|
BIN
static-binaries/love-amd64
Executable file
BIN
static-binaries/love-amd64
Executable file
Binary file not shown.
BIN
static-binaries/love-arm64
Executable file
BIN
static-binaries/love-arm64
Executable file
Binary file not shown.
@ -55,7 +55,7 @@ function loadBoard(fn)
|
||||
local boards = {}
|
||||
local r = 0
|
||||
local board = {}
|
||||
for line in io.lines(fn) do
|
||||
for line in love.filesystem.lines(fn) do
|
||||
if line:gsub("%s+", "") == "" then
|
||||
table.insert(boards, board)
|
||||
board = {}
|
Loading…
Reference in New Issue
Block a user