On Mon, Apr 29, 2013 at 6:43 PM, MRAB wrote:
> By the way, there's a bug in 'choosecave': what happens if the user
> enters, say, '3'?
Then they lose. :-)
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 29 Apr 2013 17:22:28 -0700, eschneider92 wrote:
> How do I make the following program repeat twice instead of asking
> whether the player wants to play again?
You change something in the folowing two lines:
playagain='yes'
while playagain=='yes':
What you change and how you change it is
On 30/04/2013 01:22, eschneide...@comcast.net wrote:
How do I make the following program repeat twice instead of asking whether the
player wants to play again?
import random
import time
def intro():
print('You spot 2 caves in the distance.')
print ('You near 2 cave entrances..')
On 04/29/2013 08:22 PM, eschneide...@comcast.net wrote:
How do I make the following program repeat twice instead of asking whether the
player wants to play again?
Turn it into a function call, and call that function twice from
top-level. Or, more generally,
for i in range(2):
doit()
How do I make the following program repeat twice instead of asking whether the
player wants to play again?
import random
import time
def intro():
print('You spot 2 caves in the distance.')
print ('You near 2 cave entrances..')
time.sleep(1)
print('You proceed even nearer...')