harphemaen / git Goto Github PK
View Code? Open in Web Editor NEWa inventory for me
a inventory for me
import os
import csv
path = "D:\\01\\"
filelist = os.listdir(path)
rolename = raw_input("please input character name\n")
t_cnt = 0
t_cnt2 = 0
t_cnt3 = 0
t_cnt4 = 0
output = []
for files in filelist:
output.append(files)
print files
#with open("d:\\01\\output.csv","wb") as f:
# writer = csv.writer(f,dialect="excel")
# for x in output:
# writer.writerow([x])
olddir = os.path.join(path,files)
if os.path.isdir(olddir):
continue
oriname = files.split(".")
front = oriname[0]
back = oriname[1]
for x in range(1,13):
comname = rolename + "0" + str(x)
comname2 = rolename + str(x)
if comname == front:
newname = os.path.join(path,"vo_"+rolename+"_home0"+str(x)+"."+back)
os.rename(olddir,newname)
if comname2 == front:
newname = os.path.join(path,"vo_"+rolename+"_home"+str(x)+"."+back)
os.rename(olddir,newname)
for x in range(13,27):
comname = rolename + str(x)
timelist = ['morning01','morning02','noon01','noon02','dusk01','dusk02','night01','night02','midnight01','midnight02','maxlv01','maxlv02','maxlv03','maxlv04']
if comname == front:
newname = os.path.join(path,'vo_' + rolename + '_' + timelist[t_cnt3]+'.'+back)
t_cnt3 += 1
print newname
os.rename(olddir,newname)
for x in range(27,38):
comname = rolename + str(x)
emotionlist = ['normal','sure','negative','question','impatience','joy','decline','sorrow','angry','unhappy','shock']
if comname == front:
newname = os.path.join(path,'vo_'+rolename+'_scenario_'+emotionlist[t_cnt]+'.'+back)
t_cnt += 1
print newname
os.rename(olddir,newname)
for x in range(48,56):
comname = rolename + str(x)
actionlist = ['attack01','attack02','damage01','fever01','victory01','victory02','failure01','continue01']
if comname == front:
newname = os.path.join(path,'vo_'+rolename+'_'+actionlist[t_cnt2]+ '.' +back)
print newname
t_cnt2 += 1
os.rename(olddir,newname)
for x in range(56,59):
comname = rolename + str(x)
alllist = ['title','login01','birthday01']
if comname == front:
newname = os.path.join(path,'vo_'+rolename+'_'+alllist[t_cnt4]+ '.' +back)
print newname
t_cnt4 += 1
os.rename(olddir,newname)
import math
import random
p_atk = float(input("Please input player's attack\n"))
p_hp = float(input("Please input player's hp\n"))
e_atk = float(input("Please input enemy's attack\n"))
e_hp = float(input("Please input enemy's hp\n"))
sim_times = input("Please input simulat times\n")
round = 0
result = []
def getbuff(x):
x *= 1.20
def battle(c):
for x in range(0,c):
pp_hp = p_hp
ee_hp = e_hp
while pp_hp > 0 and ee_hp > 0:
line = random.randint(3,12)
# print "\nline is:" + str(line)
atkbuffdice = random.randint(1,100)
if buffdice >= 60:
atkbuff = 5
else:
atkbuff = 1
ee_hp -= p_atkatkbuffline
# print "enemy's hp is:" + str(ee_hp)
pp_hp -= e_atk
# print "player's hp is:" + str(pp_hp) +"\n"
global round
round += 1
if pp_hp > 0:
print "battle is end"
print " WIN!::: cost " + str(round) + "turn\n"
result.append(str(round))
else:
print "battle is end"
print " lose!::: cost " + str(round) + "turn\n"
result.append("lose")
round = 0
battle(sim_times)
print result
myset = set(result)
for i in myset:
print("%s : %s" %(i,result.count(i)))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.