-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
63 lines (44 loc) · 1.26 KB
/
main.py
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
###############################################################################
# Synesthetic Sudoku
#
# Author: Michael Carter
# mjcarter@ualberta.ca
# February/March 2020
#
#
###############################################################################
import pygame as pg
from pygame.locals import *
from uagame import Window
from grapheme import Grapheme
from sudoku import Sudoku
# import config
### PARAMETERS ###
## PARAMETERS ##
WINDOW_SIZE = (800, 600)
DEFAULT_FONT_COLOR = "black"
DEFAULT_FONT_SIZE = 18
DEFAULT_FONT_NAME = "Arial"
BG_COLOR = "white"
def main():
## SET VARIABLES ##
try:
# Launch Game:
window = create_window()
game = Sudoku(window, 9)
except Exception as e:
print(e.args, e.with_traceback)
def create_window():
# Create a window for the game and open it.
window = Window("Sudoku", WINDOW_SIZE[0], WINDOW_SIZE[1])
window.clear()
window.update()
return window
def reset_window_defaults(window):
# returns the window's colors, fonts, etc. to their defaults
window.set_bg_color(BG_COLOR)
window.set_font_color(DEFAULT_FONT_COLOR)
window.set_font_size(DEFAULT_FONT_SIZE)
window.set_font_name(DEFAULT_FONT_NAME)
if __name__ == "__main__":
main()