Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove duplicated code #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions holdem_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,6 @@ def error_check_arguments(args):
all_cards.extend(args.board)
error_check_cards(all_cards)

# Error check the command line arguments
def error_check_arguments(args):
# Check that the number of Monte Carlo simulations is a positive number
if args.n <= 0:
print "Number of Monte Carlo simulations must be positive."
exit()
# Check that we can open the specified input file
if args.input:
file_name = args.input
try:
input_file = open(file_name, 'r')
input_file.close()
except IOError:
print "Error opening file " + file_name
exit()
# Check to make sure all cards are of a valid format
all_cards = list(args.cards)
if args.board:
all_cards.extend(args.board)
error_check_cards(all_cards)

# Checking that the hole cards + board are formatted properly and unique
def error_check_cards(all_cards):
card_re = re.compile('[AKQJT98765432][scdh]')
Expand Down