-
Notifications
You must be signed in to change notification settings - Fork 7
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 #94 from evanofslack/result
Return results from game and simulation
- Loading branch information
Showing
10 changed files
with
313 additions
and
89 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,16 +1,23 @@ | ||
""" | ||
Play a game through the terminal. Either by yourself, with another human, or against a bot. | ||
Play a game through the terminal. | ||
Either by yourself, with another human, or against a bot. | ||
""" | ||
|
||
from pyminion.bots.examples import BigMoney | ||
from pyminion.expansions.base import base_set | ||
from pyminion.expansions.base import artisan, bandit, base_set, witch | ||
from pyminion.game import Game | ||
from pyminion.players import Human | ||
|
||
human = Human(player_id="Human") | ||
bot = BigMoney(player_id="Bot 1") | ||
bm = BigMoney(player_id="Big Money") | ||
|
||
game = Game(players=[human, bot], expansions=[base_set]) | ||
game = Game( | ||
players=[human, bm], | ||
expansions=[base_set], | ||
kingdom_cards=[artisan, bandit, witch], # specific cards to add to the kingdom | ||
random_order=True, # players start in random order | ||
) | ||
|
||
if __name__ == "__main__": | ||
game.play() | ||
result = game.play() |
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,10 @@ | ||
__version__ = "0.2.2" | ||
__author__ = "Evan Slack" | ||
|
||
|
||
# INITIALIZE LOGGER | ||
|
||
import logging | ||
|
||
# initalize logger with no handler. | ||
# handlers are added in the `Game` init | ||
logger = logging.getLogger() | ||
logger.setLevel(logging.DEBUG) | ||
|
||
# Create handler | ||
c_handler = logging.StreamHandler() | ||
c_handler.setLevel(logging.DEBUG) | ||
|
||
# Create formatter and add to handler | ||
c_format = logging.Formatter("%(message)s") | ||
c_handler.setFormatter(c_format) | ||
|
||
# Add handler to the logger | ||
logger.addHandler(c_handler) | ||
logger.setLevel((logging.INFO)) | ||
logger.addHandler(logging.NullHandler()) |
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
Oops, something went wrong.