fixed 2 bugs in last round!
This commit is contained in:
		@@ -3,19 +3,23 @@
 | 
			
		||||
{% block content %}
 | 
			
		||||
 | 
			
		||||
        <div class="content">
 | 
			
		||||
            <h1><span class="font-semi-bold">Gambling Foo</span> <span class="smaller">A RESTful gaming service</span></h1>
 | 
			
		||||
            <h1><span class="font-semi-bold">Cowiz Gambling Den</span> <span class="smaller">A RESTful gaming service</span></h1>
 | 
			
		||||
            <p class="lead">
 | 
			
		||||
                Play a nice game of cards?<br>
 | 
			
		||||
                Play a nice game of cards!<br>
 | 
			
		||||
                <br>
 | 
			
		||||
                <strong>Endpoints</strong>
 | 
			
		||||
            <ul>
 | 
			
		||||
                <li>
 | 
			
		||||
                    <strong>Shuffle Card Deck</strong><br>
 | 
			
		||||
                    <a href="/api/shuffle">GET /api/shuffle</a>
 | 
			
		||||
                    <strong>Players</strong><br>
 | 
			
		||||
                    <a href="/player/0">Player 1</a>
 | 
			
		||||
                    <a href="/player/1">Player 2</a>
 | 
			
		||||
                    <a href="/player/2">Player 3</a>
 | 
			
		||||
                    <a href="/player/3">Player 4</a>
 | 
			
		||||
                    <a href="/player/4">Player 5</a>
 | 
			
		||||
                    <a href="/player/5">Player 6</a>
 | 
			
		||||
                </li>
 | 
			
		||||
                <li>
 | 
			
		||||
                    <strong>Movies by director</strong><br>
 | 
			
		||||
                    <a href="/api/director/cameron">GET /api/director/{director_name}</a>
 | 
			
		||||
                Spam Bacon Sausage + Spam
 | 
			
		||||
                </li>
 | 
			
		||||
<!--
 | 
			
		||||
                <li>
 | 
			
		||||
@@ -39,7 +43,6 @@
 | 
			
		||||
            </p>
 | 
			
		||||
 | 
			
		||||
            <p class="disclaimer">
 | 
			
		||||
                Spam Bacon Sausage + Spam
 | 
			
		||||
                Spam Spam Spam Spam Spam
 | 
			
		||||
                  Spam Baked Beans Spam
 | 
			
		||||
                  Spam Spam + Spam
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,7 @@
 | 
			
		||||
                <div>{% block content %}{% endblock %}</div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
<!--
 | 
			
		||||
        <div class="row">
 | 
			
		||||
            <div class="links">
 | 
			
		||||
                <ul>
 | 
			
		||||
@@ -51,6 +52,7 @@
 | 
			
		||||
                Copyright © Talk Python Training
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
-->
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ def show(req, resp, player: str):
 | 
			
		||||
 | 
			
		||||
    #active_player = the_game.active_player
 | 
			
		||||
    prev_player = the_game.get_prev_player()
 | 
			
		||||
    if tcard.value == 'Z' and tcolor == '-':
 | 
			
		||||
    if tcard and tcard.value == 'Z' and tcolor == '-':
 | 
			
		||||
        choose_trump_color = True
 | 
			
		||||
    else:
 | 
			
		||||
        choose_trump_color = False
 | 
			
		||||
 
 | 
			
		||||
@@ -130,7 +130,7 @@ class WizGame:
 | 
			
		||||
        high_player, high_card = cards[0]
 | 
			
		||||
 | 
			
		||||
        for player, card in cards[1:]:
 | 
			
		||||
            if get_higher_card(high_card, card, self.trump_card.color):
 | 
			
		||||
            if get_higher_card(high_card, card, self.trump_card.color if self.trump_card else '-'):
 | 
			
		||||
                high_card = card
 | 
			
		||||
                high_player = player
 | 
			
		||||
        return high_player, high_card
 | 
			
		||||
@@ -198,6 +198,6 @@ class WizGame:
 | 
			
		||||
            return self.start_player-1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
p = ["p1", "p2", "p3", "p4"]
 | 
			
		||||
p = ["Astrid", "Stephan", "Patrice", "struppi"]
 | 
			
		||||
the_game = WizGame(p)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user