This repository has been archived by the owner on Jun 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from nebbles/game-engine
Game engine
- Loading branch information
Showing
10 changed files
with
1,532 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Reference: sunfish by thomasahle: | ||
https://github.com/thomasahle/sunfish |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
class Print: # Debug window giving information about the program and user state | ||
purple = '\033[95m' | ||
cyan = '\033[96m' | ||
darkcyan = '\033[36m' | ||
blue = '\033[94m' | ||
green = '\033[92m' | ||
yellow = '\033[93m' | ||
red = '\033[91m' | ||
bold = '\033[1m' | ||
underline = '\033[4m' | ||
end = '\033[0m' | ||
|
||
@staticmethod | ||
def clear_screen(): # Defines how to clear screen based on platform OS | ||
import os | ||
import platform | ||
current_platform = platform.system() | ||
if current_platform == 'Windows': | ||
os.system('cls') | ||
elif current_platform == 'Darwin': | ||
os.system('clear') | ||
else: | ||
print("\n" * 100) | ||
|
||
@staticmethod | ||
def warning(msg): | ||
print(Print.bold + Print.yellow + "Warning: " + Print.end | ||
+ Print.yellow + msg + Print.end) | ||
|
||
@staticmethod | ||
def danger(msg): | ||
print(Print.bold + Print.red + "DANGER: " + Print.end | ||
+ Print.red + msg + Print.end) | ||
|
||
@staticmethod | ||
def success(msg): | ||
print(Print.bold + Print.green + "Success: " + Print.end | ||
+ Print.green + msg + Print.end) | ||
|
||
@staticmethod | ||
def message(msg): | ||
print(Print.bold + Print.blue + "Message: " + Print.end | ||
+ Print.blue + msg + Print.end) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from chess.console_print import Print | ||
|
||
Print.warning("This is my warning message") | ||
Print.danger("This is my danger message") | ||
Print.success("This is my success message!") | ||
Print.message("This is my normal message") |