わかりました、ほとんど作成しましたが、まだいくつかの問題があります。
[更新] 情報に従って更新したところ、さらにいくつかの問題が発生しました。
import random
print '|'*20
print '='*20
print 'Instruction'
print 'Enter high, low or quit!'
print 'Press enter without any input too see instruction'
print '='*20
print "="*5+'GAME START'+"="*5
print '='*20
print ''
card = [2,3,4,5,6,7,8,9,10]
choice = ' '
i=0
first = 1
while choice != 'quit':
card1, card2 = random.sample(card, 2)
showCard = [card1, card2]
startCard = card1
if choice == 'high':
if card1 > card2:
print ''
print str(card1) + ' first card1'
print str(card2) + ' first card2'
print ''
print 'wrong'
print ''
print 'Dealer Second card: '+str(card2)
print '-'*20
i=i+1
elif card1 <= card2:
print ''
print str(card1) + ' second card1'
print str(card2) + ' second card2'
print ''
print 'correct'
print ''
print 'Dealer Second card: '+str(card2)
print '-'*20
i=i+1
else:
print 'Dealer First card: '+str(card1)
elif choice == 'low':
if card1 > card2:
print 'wrong - testing 3'
print 'Next card: '+str(card2)
print '-'*20
else:
print 'correct - testing 4'
print 'Next card: '+str(card2)
print '-'*20
elif choice != 'high' or 'low' or 'info':
print 'Enter high or low only'
print 'First card 2: '+str(startCard)
choice = raw_input("Enter: ")
print i
print 'END'
出力:
====================
=====GAME START=====
====================
Enter high or low only
First card 2: 7
Enter: high
7 second card1
10 second card2
correct
Dealer Second card: 10
---------------------
First card2: 3
Enter: high
6 first card1
5 first card2
wrong
Dealer Second card: 5
問題: 2 番目のループで、'Enter: high' ユーザー入力の前に '6 first card1' を設定するにはどうすればよいですか? (「First card2: 3」を「6 first card1」に差し替え)
PS: 低入力はまだ作成中のため、最初に高入力を使用します。
ありがとう