Re: [Tutor] Python - RPG Combat System

2010-07-31 Thread Steven D'Aprano
On Sun, 1 Aug 2010 10:20:31 am Alan Gauld wrote: > "Jason MacFiggen" wrote > > > and also, what can I do instead of writing print so many times? > > Learn about format strings and use triple quoted strings. *slaps self in head* Doh! How could I have forgotten triple quoted strings? *slinks off

Re: [Tutor] Python - RPG Combat System

2010-07-31 Thread Alan Gauld
"Jason MacFiggen" wrote and also, what can I do instead of writing print so many times? Learn about format strings and use triple quoted strings. else: print "Menu Selections: " print "1 - Attack" print "2 - Defend" print menu1 = """ Me

Re: [Tutor] Python - RPG Combat System

2010-07-31 Thread David Hutto
On Sat, Jul 31, 2010 at 1:51 PM, bob gailer wrote: > On 7/30/2010 10:49 PM, Jason MacFiggen wrote: >> >> what can I do instead of writing print so many times? >> import random >>    my_hp = 50 >>    mo_hp = 50 >>    my_dmg = random.randrange(1, 20) >>    mo_dmg = random.randrange(1, 20) >>    whil

Re: [Tutor] Python - RPG Combat System

2010-07-31 Thread bob gailer
On 7/30/2010 10:49 PM, Jason MacFiggen wrote: what can I do instead of writing print so many times? import random my_hp = 50 mo_hp = 50 my_dmg = random.randrange(1, 20) mo_dmg = random.randrange(1, 20) while True: if mo_hp < 0: print "The Lich King has been

Re: [Tutor] Python - RPG Combat System

2010-07-30 Thread Steven D'Aprano
On Sat, 31 Jul 2010 12:49:36 pm Jason MacFiggen wrote: > I am have trouble figuring out how to make my program stop at 0 hit > points if I run it, it always goes into the negative hitpoints... > > So my question is how do I make this program end at exactly 0 hit > points every time instead of g

Re: [Tutor] Python - RPG Combat System

2010-07-30 Thread David Hutto
On Fri, Jul 30, 2010 at 10:49 PM, Jason MacFiggen wrote: > I am have trouble figuring out how to make my program stop at 0 hit > points if I run it, it always goes into the negative hitpoints... > > So my question is how do I make this program end at exactly 0 hit points > every time instead o

[Tutor] Python - RPG Combat System

2010-07-30 Thread Jason MacFiggen
I am have trouble figuring out how to make my program stop at 0 hit points if I run it, it always goes into the negative hitpoints... So my question is how do I make this program end at exactly 0 hit points every time instead of going over? and also, what can I do instead of writing print so