yshelper 가챠 시뮬은 이상하게 값이 높게 나오는 것 같아서 못믿겠고 이미 어느정도 뽑아서 스택 쌓인 경우를 고려하지 못해서 유사품으로 하나 만들었는데 코딩 맞게 한건지 모르겠어서 확인 필요함


기본적으로 캐뽑 목표치 돌리고 무뽑 돌리는 방식임


언어는 파이썬이고 주석은 나름 열심히 적었는데 이상하다 싶으면 말해주셈


------------------------------------------------------------------------------------



import random


table_ch = []

table_wp = []


for i in range(72): #캐릭뽑 확률 테이블 작성

    table_ch.append(0.6)

for i in range(17): #캐릭뽑 확업 반영

    table_ch.append(6.6 + (6 * i))

for i in range(61): #무뽑 확률테이블 작성

    table_wp.append(0.7)

for i in range(15): #무뽑 확업 반영

    table_wp.append(7.7 + (7 * i))


def pull_sim(ch_target, wp_target, pull_num, ch_stack, wp_stack, ch_guarantee, wp_guarantee): 

#반복시행 위한 함수화, 각각 캐릭 목표치, 무기 목표치, 인연 개수, 캐뽑 스택, 무뽑 스택, 캐뽑 반천, 무뽑 반천

    result_ch = 0 # 최종 캐릭뽑 결과

    result_wp = 0 # 최종무뽑결과

    pitty_ch = ch_guarantee # 캐릭 픽똟 반영용

    pitty_wp = wp_guarantee # 무뽑 픽뚫 반영용

    orbit_wp = 0 # 무뽑 궤도


    pull = pull_num

    pull_left = pull

    #캐릭뽑

    current_pitty = ch_stack #기존에 미리 뽑아서 쌓은 스택

    for i in range(pull):

        if result_ch == ch_target: # 이미 요구치 충족했으면 탈출

            break

        pull_left -= 1

        if 100 * random.random() < table_ch[current_pitty]: # 일단 5성이 뜸

            if random.random() >= 0.5 and pitty_ch == 0: #반천에서 픽뚫

                pitty_ch += 1 #확천 만들기

                current_pitty=  0

            else:#반천에서 성공 혹은 확천

                result_ch+=1

                pitty_ch = 0 #반천으로

                current_pitty = 0 

        else:

            current_pitty += 1

       

    pull_left_left = pull_left #캐릭뽑 후 남은 인연 개수 확인


    #무뽑

    current_pitty = wp_stack #기존에 미리 뽑아서 쌓은 스택

    for i in range(pull_left):

        if result_wp == wp_target:# 이미 요구치 충족했으면 탈출

            break

        pull_left_left -= 1

        if 100 * random.random() < table_wp[current_pitty]:# 일단 5성이 뜸

            

            fix = random.random()#픽뚫 여부 판정용

            

            if orbit_wp < 2: #궤도 확정 안남

                if pitty_wp == 0: # 완전 픽뚫 가능

                    if fix >= 0.75: #완전히 픽뚫(늑말 등)

                        pitty_wp += 1 #완전 픽뚫이니 다음 5성은 확업

                        orbit_wp += 1 #궤도도 하나 올려주기

                        current_pitty = 0 #5성 나왔으니 참조할 테이블 위치는 수정

                    elif fix >= 0.375: #딴 확업 무기

                        pitty_wp = 0

                        orbit_wp += 1

                        current_pitty = 0


                    else: #성공

                        result_wp += 1 # 무뽑 결과에 +1

                        pitty_wp = 0

                        orbit_wp = 0 #성공했으니 궤도 초기화

                        current_pitty = 0

                else: # 확업 무기중에서만 나옴

                    if fix >= 0.5: # 딴 확업 무기

                        pitty_wp=  0

                        orbit_wp += 1

                        current_pitty = 0

                    else: #성공

                        result_wp += 1

                        pitty_wp = 0

                        orbit_wp = 0

                        current_pitty = 0

            else: #궤도 2여서 확정 전무

                result_wp += 1

                pitty_wp = 0

                orbit_wp = 0

                current_pitty = 0

        else:

            current_pitty += 1


        

    return([pull_left_left, result_ch, result_wp])# 남은 인연, 캐릭 뽑은 양, 무기 뽑은 양 리스트로 반환


time=int(input('enter number of pull'))#인연 개수

c_goal=int(input('enter number of ch goal'))#캐릭 목표

w_goal=int(input('enter number of wp goal'))#무기 목표

ch_stacked=int(input('enter number of ch stack'))#캐릭뽑 스택

wp_stacked=int(input('enter number of wp stack'))#무뽑 스택

ch_g=int(input('enter number of ch : guarantee-no=0, yes=1'))#캐릭뽑 반천 여부

wp_g=int(input('enter number of wp : guarantee-no=0, yes=1'))#무뽑 반천 여부


counter = 0 #성공한 경우의 수

for i in range(100000):#10만번 돌림

    result = pull_sim(c_goal, w_goal, time, ch_stacked, wp_stacked, ch_g, wp_g)

    if result[1] == c_goal and result[2] == w_goal: # 목표치 도달했는지 비교

        counter += 1

print(100 * counter / 100000)#결과는 %로 나옴