sk8nbail Posted October 25, 2007 Share Posted October 25, 2007 For my Intro. to Computer Sciences class, we had to write a program that we/others would use for our midterm project. Being into Runescape, I decided to write a Mining Calculator from scratch. Its still very basic, and roughly coded in my opinion but it works. I think I will write a calculator for all the other skills and then try and work on a GUI version of them later down the road. Heres the code for the program: # Runescape Mining Calculator # Coded by Dan Collins # October 23rd 2007 def main(): print "This program allows the user to enter his current experience," print "desired level, and the ore he will be mining to calculate how" print "many ores he would have to mine to reach that desired level." print # This is a python dictonary used for storing the # levels and the corresponding experience points levelexp = { 1 : 0, 2 : 83, 3 : 174, 4 : 276, 5 : 388, 6 : 512, 7 : 650, \ 8 : 801, 9 : 969, 10 : 1154, 11 : 1358, 12 : 1584, 13 : 1833, \ 14 : 2107, 15 : 2411, 16 : 2746, 17 : 3115, 18 : 3523, 19 : 3973, \ 20 : 4470, 21 : 5018, 22 : 5624, 23 : 6291, 24 : 7028, 25: 7842, \ 26 : 8740, 27 : 9730, 28 : 10824, 29 : 12031, 30 : 13363, 31 : 14833, \ 32 : 16456, 33 : 18247, 34 : 20224, 35 : 22406, 36 : 24815, \ 37 : 27473, 38 : 30408, 39 : 33648, 40 : 37224, 41 : 41171, \ 42 : 45529, 43 : 50339, 44 : 55649, 45 : 61512, 46 : 67893, \ 47 : 75127, 48 : 83014, 49 : 91721, 50 : 101333, 51 : 111945, \ 52 : 123660, 53 : 136594, 54 : 150872, 55 : 166636, 56 : 184040, \ 57 : 203254, 58 : 224466, 59 : 247886, 60 : 273742, 61 : 302288, \ 62 : 333804, 63 : 368599, 64 : 407015, 65 : 449428, 66 : 496254, \ 67 : 547953, 68 : 605032, 69 : 668051, 70 : 737627, 71 : 814445, \ 72 : 899257, 73 : 992895, 74 : 1096278, 75 : 1210421, 76 : 1336443, \ 77 : 1475581, 78 : 1629200, 79 : 1798808, 80 : 1986068, 81 : 2192818, \ 82 : 2421087, 83 : 2673114, 84 : 2951373, 85 : 3258594, 86 : 3597792, \ 87 : 3972294, 88 : 4385776, 89 : 4842295, 90 : 5346332, 91 : 5902831, \ 92 : 6517253, 93 : 7195629, 94 : 7944614, 95 : 8771558, 96 : 9684577, \ 97 : 10692629, 98 : 11805606, 99 : 13034431 } # This is a python dictonary used for storing the # names of the ores and the experience they give oreexp = { 'Rune Essence' : 5, 'Clay' : 5, 'Copper' : 17.5, 'Tin' : 17.5, 'Blurite' : 17.5, \ 'Limestone' : 26.5, 'Iron' : 35, 'Silver' : 40, 'Coal' : 50, 'Gold' : 65, \ 'Mithril' : 80, 'Adamant' : 95, 'Runite' : 125} # Prompts user for his/her current mining experience, # desired level, and ore intended to mine currentxp = input("Please enter your current experience: ") targetlvl = input("Please enter the desired level you are aiming to reach: ") oremining = raw_input("Please enter the ore you wish to mine to that level: ") # Formulas for getting the experience points until target level # and ores until target level exptillvl = levelexp.get(targetlvl) - currentxp orestillvl = round((levelexp.get(targetlvl) - currentxp) / oreexp.get(oremining)) print "You have", exptillvl, "experience left to level", targetlvl, "and", orestillvl, oremining, "ores left to reach that level." main() NOTE: the last print statement appears to be on 2 lines but in the editor its actually written on two. Also the dictionaries look a little weird in the format of the post :( Feel free to make any suggestions on how to make it work more efficiently. You can reach me on here or my email ([email protected]). Looking to make easy cash? CashCrate owns, its how i pay for members on runescape. Click http://cashcrate.com/452881 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now