-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainGame.py
28 lines (23 loc) · 867 Bytes
/
MainGame.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
from abc import ABC
import logging
class WoG(ABC):
FORMAT = '%(message)s'
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M')
# define a Handler which writes INFO messages or higher to the sys.stderr
console = logging.StreamHandler()
console.setLevel(logging.INFO)
def __init__(self, difficulty):
self.Difficulty = difficulty
self.play()
def play(self):
self.generate()
self.get_input_from_user()
return self.compare_results()
class Scores:
def add_score(self):
self.scores_file = open("Scores.txt", "a")
self.points_of_winning = (self.Difficulty*3)+5
self.scores_file.write(f"\n{str(self.points_of_winning)}")
self.scores_file.close()