01-10-2008, 12:32 PM
Everyone says Dev's/Gm's are lazy, don't do nuttin, etc. Well I am here to prove you wrong. I spent 6 hours with a half as hard programming system then what the gm's use, just to finally perfect this simple script with no bugs.
I seriously spent 6 hours on this. Code has to be perfect. I drank 4 cups of coffee, ate 5 burritos, and smoked a pack of cigarettes.......
This was my first attempt at programming a basic program, with Python, ever. I've only been studying Python for.. 3 days now? Its fairly easy to learn, but a damn cranky ***** if you're not careful.
I hope this program will inspire the other community members to delve into programming.
I seriously spent 6 hours on this. Code has to be perfect. I drank 4 cups of coffee, ate 5 burritos, and smoked a pack of cigarettes.......
Code:
#Practicing Variables, If structures, while structures, Import structures
#Author: Lucas John Hoage
#Version 1.0 Open Beta
#Copyright: None/Open Source
#Time spent: 6 Hours
#Time Start: 11:30 P.M. Eastern Time Zone
#Time Finish: 5:23 A.M. Eastern Time Zone
####################################Instructions#####################################
#In order to use/view/edit this code, you must have Python 2.5.1 installed on your computer. This is for windows users. If -
#the installation asks you to update anything, press ignore, its a retard. Once installed go to Python, Python IDLE (GUI), then -
#when it loads, go to file, New window, in the new window, copy and paste this text into it. save as anything, BUT make sure it -
#ends with .py Example: Practice.py, then save as python file py, pyw, txt. After that, go back to the IDLE (GUI) and -
#hit file, open, and open the file you saved. Now, have fun and enjoy. Do not feel hesitant about editing the script, its a -
#good way to learn. Trust me, this shit took 6 ****ing hours. This is merely the beginning of Python programming. Enjoy ^_^
#Note: All keywords close in " marks, are case sensitive and are coded to continue the program.
#Questions? Comments? email them to [email][email protected][/email]
import sys
Prize1 = 1
Prize2 = 2
Selection1 = raw_input
Pr1 = True
shop = True
shieldM = True
sword = 250
shield = 250
storeM = True
store = raw_input
buy = True
checkoutS = True
checkoutSW = True
while Pr1:
Selection1 = int(raw_input("Please choose a reward 1 or 2.\n"))
if Selection1 == 1:
gold = 500
print "You receive 500 gold!\n"
Pr1 = False
elif Selection1 == 2:
print "I am sorry, but you do not have any gold to visit the 'store'!\n"
gold = '0'
print "You receive nothing!!!! Try again.\n"
elif Selection1 != Prize1 and Prize2:
print "That is not an option, try again.\n"
while storeM:
shop = str(raw_input("Do you wish to use the 'store'.\n"))
if shop == 'store':
print "Welcome to my store, please take a look around.\n"
storeM = False
else:
print "I don't understand what you want.\n"
while shieldM:
store = str(raw_input("I have a 'sword' and \
a 'shield' for sale! Which would you like to 'buy' some sir?\n"))
if store == 'buy':
shieldM = False
else:
print "I do not understand what you want.\n"
while checkoutS:
if gold > 0 or 'shield' or 'sword':
buy = str(raw_input("Care to buy anything else?\n"))
if buy == 'shield' and gold >= shield:
print "Let me get that real quick...\n"
print "*You have received a shield!*\n"
gold = (gold - shield)
print "You now have ", gold, "gold left!\n"
if buy == 'sword' and gold >= sword:
print "Let me get that real quick...\n"
print "*You have received a sword!*\n"
gold = (gold - sword)
print "You now have ", gold, "gold left!\n"
elif gold == 0:
checkoutS = False
while checkoutSW:
if gold == 0:
print "I am sorry, but you have ", gold, "gold left. It is not enough to buy any item here! Come back when you have money sir!\n"
checkoutSW = False
SystemExit
This was my first attempt at programming a basic program, with Python, ever. I've only been studying Python for.. 3 days now? Its fairly easy to learn, but a damn cranky ***** if you're not careful.
I hope this program will inspire the other community members to delve into programming.