Could you post the error message?

Ara






Fatti non foste per viver come bruti, ma per seguir virtute e canoscenza
- Dante Alighieri

You were not made to live like brutes, but to pursue virtue and
knowledge


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of . ,
Sent: Friday, May 20, 2005 5:56 AM
To: tutor@python.org
Subject: [Tutor] RPG game.


I'm trying to make an RPG game which is only consisted of texts. But, it

doesn't work!

thanks.

------------------------------------------------------------------------
-------------------------------------------------------------------
import random

print \
      """Warrior - damage: 10~60
      Archer - damage: 0~100
      HP of Player: 100
      HP of the monster: 300"""

wp = raw_input("\n\nSelect between warrior and Archer ")

mob = 300
hit = 0
hp = 100
run = ""

while True:
    while (mob > 0):
        hit += 1
        mob = mob - dmg
        hp = hp - atk

        if (hp < 0):
            print "\nYour", wp, "has died by the monster(", mob, "hp)"
            break

        elif wp == "warrior":
            dmg = random.randrange(50) + 10
            atk = random.randrange(10)

        elif wp == "archer":
            dmg = random.randrange(100)
            atk - random.randrage(5)

        print "\n", hit, "hits"
        print "HP of", wp,":", hp,"/100"
        print "HP of the monster:", mob,"/300"

    print "\nYou defeated the monster by", hit,"hits,", dmg,"damage"

        run = raw_input("\n\nrun or exit ")

        if run == "exit":
            break

        elif run == "run":
            continue
        else:
            raw_input("\nError")
            break
------------------------------------------------------------------------
-------------------------------------------------------------------

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to