Code: Select all
#include once "getinput.bas"
#include once "randomizednumbers.bas"
dim shared h2 as cmd_type
dim s as integer
dim r as integer
dim shared as integer maxhp,currenthp,doghp
maxhp=20
currenthp=20
doghp=10
print "To kill something type the word kill, followed by a space, and then the thing you want to kill"
area:
print "A fierce dog rushes at you"
h2=getcmd(">")
select case h2.cmd
case "kill"
select case h2.what1
case "dog"
s=Int(Rnd(1)*2) 'returns either a 0 or 1'
if s=0 then
print "The dog misses you": goto dog
else
print "The dog hits you, minus 3 hp.": currenthp=-3: print "HP= ": print currenthp
end if
if currenthp<=0 then
print "You die": goto room
else: goto dog
end if
end select
dog:
r=Int (Rnd(1)*2)
if r=0 then
print "You miss the dog": goto area
else
print "You hit the dog, minus 7 hp.": doghp=-7: print "Dog HP= "
print doghp
end if
if doghp<=0 then
goto room
else: goto area
end if
goto area
end select
room:
print "Wazzup"