바로 아래 포스팅한 python 시뮬레이션 코드입니다.
아이템의 스펙을 그대로 따르려고 노력했구요...
그림 그리기는 matplotlib(http://matplotlib.sourceforge.net)를 사용했습니다.
초간단코드이므로, 설명은 없습니다... ㅋㅎ
이 코드에 대한 개요와 결과를 보시려면, 아래 글을 참조하세요.
[WOW] 다크문 진노카드 치명타율 실험 (시뮬레이션)
--- 여기서부터 코드입니다 ---
from pylab import *
def getCriticalStrikeRate( default_critical_strike_percent ):
nAttCount=0
nCriCount=0
pCri = default_critical_strike_percent
while( nAttCount < 10000 ):
if (rand()*10000)%100 <= pCri:
nCriCount+=1
pCri = default_critical_strike_percent
else:
pCri += 17/22.1
nAttCount+=1
return nCriCount/100
if __name__ == "__main__":
x = arange( 0, 50, 0.1 )
Z = x
y=[]
for ax in x:
y.append( getCriticalStrikeRate( ax ) )
plot(x,y, color='red',lw=1)
plot(x,Z, color='green',lw=2)
xlabel('Before')
ylabel('After')
show()
태그 : python, matplotlib
아이템의 스펙을 그대로 따르려고 노력했구요...
그림 그리기는 matplotlib(http://matplotlib.sourceforge.net)를 사용했습니다.
초간단코드이므로, 설명은 없습니다... ㅋㅎ
이 코드에 대한 개요와 결과를 보시려면, 아래 글을 참조하세요.
[WOW] 다크문 진노카드 치명타율 실험 (시뮬레이션)
--- 여기서부터 코드입니다 ---
from pylab import *
def getCriticalStrikeRate( default_critical_strike_percent ):
nAttCount=0
nCriCount=0
pCri = default_critical_strike_percent
while( nAttCount < 10000 ):
if (rand()*10000)%100 <= pCri:
nCriCount+=1
pCri = default_critical_strike_percent
else:
pCri += 17/22.1
nAttCount+=1
return nCriCount/100
if __name__ == "__main__":
x = arange( 0, 50, 0.1 )
Z = x
y=[]
for ax in x:
y.append( getCriticalStrikeRate( ax ) )
plot(x,y, color='red',lw=1)
plot(x,Z, color='green',lw=2)
xlabel('Before')
ylabel('After')
show()
태그 : python, matplotlib