Add a real model

This commit is contained in:
Barak Michener 2015-06-19 18:50:19 -04:00
parent 12316a9238
commit 8b7cab4c59
7 changed files with 432 additions and 10 deletions

9
tim.py
View file

@ -6,6 +6,7 @@ import json
from colorama import Fore, Style
from models.default_model import DefaultModel
from models.data_model import DataModel
from game_evaluator import DeceptionGame, AvalonGame
@ -99,7 +100,7 @@ def main():
if command == "newgame":
nplayers = raw_input("How many players? ")
game = DeceptionGame(
AvalonGame(int(nplayers)), DefaultModel)
AvalonGame(int(nplayers)), DataModel)
namemap = {}
elif command == "load":
if len(command_list) < 2:
@ -124,12 +125,14 @@ def main():
print "%d: %s" % (i, display_statement(statement, namemap))
continue
elif command == "vote":
proposer = int(raw_input("Proposer? ").strip())
input = raw_input("Team? ").strip()
team = [int(x) for x in input]
votes = [int(x) for x in raw_input("Votes? ").strip()]
round = int(raw_input("Round? ").strip())
fail_req = int(raw_input("# Fails Required? ").strip())
game.do_vote(team, votes, fail_req, round)
voten = int(raw_input("Vote Number? ").strip())
fail_req = game.get_fail_req(round)
game.do_vote(team, votes, fail_req, round, voten, proposer)
game.trace = {}
continue