#!/usr/bin/env python # by Wuqensta @ Egypt ... math based on ObiSizer.ods. import sys,math
# Set the values below to whatever amount you have of the said material. have = { 'bricks': 0, 'boards': 0, 'canvas': 0, 'small emeralds': 0, 'leather': 0, 'cactus sap': 0, 'sulphur': 0, }
def calcObiStuff(cb=0): """ Calculate required/still needed amounts of materials for an obelisk. Negative numbers (or zero) in the result dict mean surplus of the said material. Any positive number indicates that that much more of the said material is needed. """ if type(cb) != type(1): raise "TypeError...",cb
cb2 = cb*cb r = { 'bricks':2.*cb2 + 19.*cb, 'boards':math.floor((1./5)*cb2 + 2.*cb), 'canvas':math.floor((1./100)*cb2 + (1./5)*cb) +1, 'small emeralds':math.floor((1./502)*cb2 + (1./10)*cb), 'leather':math.ceil((1./16)*cb2 + (13./80)*cb), 'cactus sap':math.ceil((111./5000)*cb2 + 2.*cb), 'sulphur':math.floor((1./50)*cb2 + (1./20)*cb), }
for x in r: r[x] = int(r[x] - have[x]) return r
if __name__=='__main__': r = calcObiStuff(int(sys.argv[1])) for x in r: print '%15s %s' % (x,r[x])
Name | Creator | Date | Size | Description |
---|---|---|---|---|
ObiSizer.ods | Wuqensta | February 8, 2006 7:51 am | 6933 | OpenOffice 2.x spreadsheet for Obelisk requirements math. |
obicalc.py | Wuqensta | April 21, 2006 1:38 pm | 1084 | Python script to calculate requirements and such for an obelisk... |