Skip to content

Commit

Permalink
Small visual fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralt98 committed Jun 2, 2019
1 parent 7dc2744 commit 4d15159
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
26 changes: 13 additions & 13 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@

def print_poker():
print()
print('-----------------------------------------TEXAS-HOLDEM-POKER------------------------------------------------')
print('---------TEXAS-HOLDEM-POKER--------')
print()
print('Main player cards: ' + str(game.get_main_player_cards()))
print('Table open cards: ' + str(game.get_table_open_cards()))
print('Hand Rank => Your Rank: ' + str(game.recognize_hand_ranking()) + ', ' + str(
hand_ranking_names[game.recognize_hand_ranking()]).upper() + ' !')
print('Your pre flop rank (1 is best and 10 is worst): ' + str(game.pre_flop_hand_analyze()))
print('------------------------------------OPPONENT-POSSIBILITIES-------------------------------------------------')
print('------OPPONENT-POSSIBILITIES-------')
game.get_hand_ranking_counts()
print('-----------------------------------------------------------------------------------------------------------')
print('-----------------------------------')


def print_clear():
for i in range(30):
print('\n')
def new_print():
print()
print('###################################')
print('############# NEXT ################')
print('###################################')


class ImageMapper(object):
Expand Down Expand Up @@ -107,30 +109,29 @@ def image_click(self, event):
return
self.selected_cards.append(hit)
if len(self.selected_cards) == 2:
print_clear()
new_print()
game.distribute_cards(self.selected_cards)
print_poker()
self.msg_text.set('{} selected.'.format('Cards {}'.format(self.selected_cards)))
print_poker()
if game.pre_flop_hand_analyze() < 8:
print('Good pre flop hand. You should play!')
else:
print('Not a good idea to play with this pre flop hand. Bluff or fold!')
elif len(self.selected_cards) == 5:
print_clear()
new_print()
game.flop_cards(self.selected_cards[2], self.selected_cards[3], self.selected_cards[4])
self.msg_text.set('{} selected.'.format('Cards {}'.format(self.selected_cards)))
print_poker()
game.get_main_player_hand_ranking_probability(2)
elif len(self.selected_cards) == 6:
print_clear()
new_print()
game.flop_cards(self.selected_cards[2], self.selected_cards[3],
self.selected_cards[4], self.selected_cards[5])
self.msg_text.set('{} selected.'.format('Cards {}'.format(self.selected_cards)))
print_poker()
game.get_main_player_hand_ranking_probability(1)
elif len(self.selected_cards) == 7:
print_clear()
new_print()
game.flop_cards(self.selected_cards[2], self.selected_cards[3],
self.selected_cards[4], self.selected_cards[5], self.selected_cards[6])
self.msg_text.set('{} selected.'.format('Cards {}'.format(self.selected_cards)))
Expand Down Expand Up @@ -161,15 +162,14 @@ def start_new_round(self):
self.selected_cards = []
self.canvas_burned_rectangles = []
self.burned_cards = []
print_clear()
new_print()


# Diamonds ('D'), Clubs ('C') Kreuz, Hearts ('H'), Spades ('S') Piek
# Jack ('J'), Queen ('Q'), King ('K'), Ass ('A')
# TODO ('SUIT', 'ICON')
# game.distribute_cards([('C', 'J'), ('D', '10')])
# game.flop_cards(('D', '8'), ('S', 'K'), ('H', 'A'), ('D', 'Q'))
# print_poker()
# This creates the main window of an application
root = Tk()
app = Window(root)
Expand Down
4 changes: 1 addition & 3 deletions resources/possibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def get_main_player_hand_ranking_probability(self, count):

self.max_possibilities = i

print(
'--------------------------------------MAIN-PLAYER-CHANCE-TO-GET'
'--------------------------------------------')
print('-----MAIN-PLAYER-CHANCE-TO-GET-----')
royal_flush_possiblity = self.calculate_possibility(self.royal_flushs)
straight_flush_possiblity = self.calculate_possibility(self.straight_flushs)
four_of_a_kind_possiblity = self.calculate_possibility(self.four_of_a_kinds)
Expand Down

0 comments on commit 4d15159

Please sign in to comment.