geekcomputers / geekcomputers/Python
Error with Blackjack_game
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 35.4k
- Forks
- 12.9k
- Ø Merge
- 2 Std. 37 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
blackjack.py:
On line 89, the datatype for the user input is a string which doesn't match up with the datatype for the if statement condition on line 90. Since the else statement is automatically executed, the player stays even if wanting to play their hand. A quick fix would be to change line 89 to:
k = int(input('Want to hit or stay?\n Press 1 for hit and 0 for stay '))
blackjack_rr.py:
The total amount of chips the player has doesn't carry over to the next game. A quick fix would be to move line 184 to right before the while statement:
#GAMEPLAY
player_chips = Chips()
while True:
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Untersuche die Eingabeverarbeitung um Zeile 89 in blackjack.py und die Initialisierung von player_chips um Zeile 184 in blackjack_rr.py. Führe beide blackjack-Beispiele manuell aus, um zu bestätigen, dass die Eingabe für hit/stay funktioniert und der Chip-Gesamtstand des Spielers über mehrere Spiele hinweg erhalten bleibt. Erledigt ist die Aufgabe, wenn beide gemeldeten Verhaltensweisen korrigiert sind, ohne den Spielfluss zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- game-dev
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100