Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help me with my rpg prg. stats don't show up for thief.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
magicman




PostPosted: Thu Apr 15, 2004 2:15 pm   Post subject: Help me with my rpg prg. stats don't show up for thief.

hey. I need help with some things with my prg. When I try to select Thief as a rank it starts the game with out showing the thiefs stats. please help!!!
code:

var rank : string
var abilities : string
var name : string
var strength : int := 1
var health : int := 100
var Def : int := 1
var agility : int := 1
var coins : int := 10
var direction : string
var answer : string


put "WELCOME TO FINAL FANTASY- THE FINAL BATTLE!!!"
delay (2500)
cls
put "Whats your name?"
get name
put "What rank do you want?"
put "Soldier"
put "Wizard"
put "Thief "
get rank
%The Soldiers Abilities.
if rank = "soldier" then
    put "Your abilities are,"
    put ""
    put "Rage."
    put "Super Attack."
    put "Heal."
    put ""
    put "Your strength is, ", strength + 3
    put "Your defence is, ", Def + 2
    put "Your agility is, ", agility + 1
    put "Your Health is, ", health
elsif


%The Wizards Abilities.
 rank = "wizard" then
    put "Your abilities are,"
    put ""
    put "Fire."
    put "Lighting."
    put "Ice."
    put "Heal."
    put ""
    put "Your strength is, ", strength + 1
    put "Your defence is, ", Def + 1
    put "Your agility is, ", agility + 2
    put "Your Health is, ", health
elsif

%The Thief's Abilities.
 rank = "Thief " then
    put "Your abilities are,"
    put ""
    put "Steal Wepon."
    put "Assassination."
    put ""
    put "Your strength is, ", strength
    put "Your defence is, ", Def
    put "Your agility is, ", agility + 4
    put "Your Health is, ", health
end if
 put "Hit any key to start the game..."
 
     var ch : string (1)
     getch (ch)

put "You are now entering the final battle. Have fun!"
    delay (4000)
cls
put skip
put "*************************************************"
put "*************************************************"
put "*************************************************"
put skip
put "*************************************************"
put "*************************************************"
put "*************************************************"
put skip
put "Wake up stranger."
put "Hey, what's your name??"
put "My name is ", name, "."
put skip
    delay (1000)
put "Your health is," ,health
put "Well lets get started with your journey."
put "Do you want to go North, East, South or West??"
get direction
if direction ="east" then
put"You see a bar in the distance. Do you want to go there??"
get answer
end if
if answer ="yes" then
put"You go into the bar and you see an elf. The elf asks you, ''Do you want a drink yong adventurer?''"
get answer
end if
if answer="yes" then
put"That will be 5 coins, thank you. You now have,",coins-5," coins left."
end if

thanks for the help. Very Happy
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Apr 15, 2004 3:12 pm   Post subject: (No subject)

look closely at the elsif statement that brings us into the thiefs stats:

code:

elsif rank = "Thief " then


looking closer

code:

"Thief "


looking EVEN CLOSER!!

code:

 "

that was supposed to be a space followed by a quote.

just get rid of that space, and it works fine.
recneps




PostPosted: Thu Apr 15, 2004 3:19 pm   Post subject: (No subject)

and maybe you should make it "thief" or "Thief" or "THIEF" so its easier for people to type.
Cervantes




PostPosted: Thu Apr 15, 2004 7:04 pm   Post subject: (No subject)

or learn to use index by reading Asian's Tutorial.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: