-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d74da7
commit f4ca4ed
Showing
8 changed files
with
128 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
class FancyPrint: | ||
#HEADER = '\033[95m' | ||
#OKBLUE = '\033[94m' | ||
#UNDERLINE = '\033[4m' | ||
# declare needed ANSI escape sequences for colorful output to console | ||
__BLUE = '\033[94m' | ||
__RED = '\033[91m' | ||
__YELLOW = '\033[93m' | ||
__END = '\033[0m' | ||
|
||
def __init__(self) -> None: | ||
# declare needed ANSI escape sequences for colorful output to console | ||
self.__RED = '\033[91m' | ||
self.__YELLOW = '\033[93m' | ||
self.__BLUE = '\033[94m' | ||
self.__BOLD = '\033[1m' | ||
self.__END = '\033[0m' | ||
# string "message" will be displayed in the corresponding color | ||
# when highlighting a single character, "line_end" can be modified so that no line break is added after the message | ||
def blue(self, message: str, line_end: str) -> None: | ||
print(type(self).__BLUE + message + type(self).__END, end=line_end) | ||
|
||
def red(self, message, line_end='\n') -> None: | ||
print(self.__RED + message + self.__END, end=line_end) | ||
def red(self, message: str, line_end: str) -> None: | ||
print(type(self).__RED + message + type(self).__END, end=line_end) | ||
|
||
def blue(self, message, line_end='\n') -> None: | ||
print(self.__BLUE + message + self.__END, end=line_end) | ||
|
||
def yellow(self, message, line_end='\n') -> None: | ||
print(self.__YELLOW + message + self.__END, end=line_end) # TODO: bold? | ||
def yellow(self, message: str, line_end: str) -> None: | ||
print(type(self).__YELLOW + message + type(self).__END, end=line_end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from game import Game | ||
|
||
if __name__ == "__main__": | ||
# main.py simply instantiates an Game object which will take care of the further game process | ||
Game() |
Oops, something went wrong.