Skip to content

Instantly share code, notes, and snippets.

@hiside0
Last active October 26, 2020 19:31
Show Gist options
  • Save hiside0/024424d49a364ec84181c1e78409b227 to your computer and use it in GitHub Desktop.
Save hiside0/024424d49a364ec84181c1e78409b227 to your computer and use it in GitHub Desktop.
import mltd_calc
from ctypes import *
import numpy as np
import sys
SONG = 167 # 計算したい曲番号
MODE = 5 # 5(MM)のみ対応 (1=2M, 2=2M+, 3=4M, 4=6M, 5=MM, 6=OM)
TRIALS = 100000 # 試行回数
TARGET_NOTE = 0 # [TARGET_NOTE]番目のノーツまで計算する(0:計算しない)
IDEAL = False # 理論値計算するかどうか指定
VERBOSE = True # 曲名とかユニット名とかを表示するかどうか指定
# IDEALとVERBOSEがTrueの場合、タイムラインを表示
TOTAL_APPEAL = 396691
CARD_IDS = np.array([941,974,870,250,746],dtype=c_int32)
SKILL_LVS = np.array([10,10,10,12,10],dtype=c_int32)
# 呼び出し
arrays = mltd_calc.calc_by_card_array(
SONG, MODE, TOTAL_APPEAL, CARD_IDS, SKILL_LVS, TRIALS, TARGET_NOTE, IDEAL,
VERBOSE)
if arrays[0][0] <= 0:
print("実行エラー")
sys.exit()
array_total = [x[0] for x in arrays]
array_before_sa = [x[1] for x in arrays]
array_target_note = [x[2] for x in arrays]
def print_tile(tile):
print(" {:>6}%Tile score:".format(tile),
int(np.percentile(array_total, 100-tile)),
" just before_SA score:",
int(np.percentile(array_before_sa, 100-tile)),
" target_note score:",
int(np.percentile(array_target_note, 100-tile)))
if IDEAL is True:
print(r" ideal score:", int(array_total[0]),
" just before_SA score:", int(array_before_sa[0]))
else:
print("\ntarget note : ",TARGET_NOTE)
if TRIALS >= 10000:
print_tile(0.001)
print_tile(0.01)
print_tile(0.05)
print_tile(0.1)
print_tile(0.5)
if TRIALS >= 1000:
print_tile(1)
print_tile(2)
print_tile(5)
print_tile(50)
if TRIALS == 1:
print(r" total score:",
int(array_total[0]),
" just before_SA score:",
int(array_before_sa[0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment