The mighty Boosh
Well-Known Member
Hey guys
I'm stuck with a few things in Python. Trying to write a shop for a simple game but can't seem to setup my arguments after user has picked an option.
money=5
redshirt=5
greenshirt=7
print (" (1) Red shirt £5 ")
print (" (2) Green shirt £7 ")
user = raw_input ("What whould you like to buy : ")
if user == "1":
This is the part that get me - how do I get it to check money vs cost and either tell the player they can't afford it or add it to thair gear ?
Have done this in batch but something's diffrent in python and shell script.
in batch I'd do this after the user has picked
:REDSHIRT
cls
if %moneys% LSS 5 ( goto SORRY )
set /a redshirt+=1
set /a money-=5
goto SHOP
Thanks and sorry in advance - I'm still new to this and not 100% sure what or how to ask .
I'm stuck with a few things in Python. Trying to write a shop for a simple game but can't seem to setup my arguments after user has picked an option.
money=5
redshirt=5
greenshirt=7
print (" (1) Red shirt £5 ")
print (" (2) Green shirt £7 ")
user = raw_input ("What whould you like to buy : ")
if user == "1":
This is the part that get me - how do I get it to check money vs cost and either tell the player they can't afford it or add it to thair gear ?
Have done this in batch but something's diffrent in python and shell script.
in batch I'd do this after the user has picked
:REDSHIRT
cls
if %moneys% LSS 5 ( goto SORRY )
set /a redshirt+=1
set /a money-=5
goto SHOP
Thanks and sorry in advance - I'm still new to this and not 100% sure what or how to ask .