Posted by King_Critter on Sat 14th Nov 09:51
download | new post | report as spam
- #! /usr/bin/env python
- import random
- print "Welcome to this awesome hand of blackjack!"
- print "Place your bets and get on with it!"
- #cash = 100
- #placebet = input("Place yer bet!)"
- #dealer goes
- card1 = random.randint(1,10)
- card2 = random.randint(1,10)
- aitotal = card1 + card2
- #player goes
- card1 = random.randint(1,10)
- card2 = random.randint(1,10)
- total = card1 + card2
- switch = 1
- while switch == 1:
- print total
- choice = raw_input("Hit or pass? ")
- if choice == "hit":
- newcard = random.randint(1,10)
- total += newcard
- elif choice == "pass":
- switch = 0
- print "Passed."
- else:
- print "Unknown command, please don't mind the 8-legged furry critter on your shoulder.\nLeft shoulder, that is."
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily
.After submitting an amendment, you'll be able to view the differences between the old and new posts easily
