import random
from collections import defaultdict
history = []
last_seen_4 = 0
last_seen_5 = 0
last_roll_not_feature = True
def get5star():
#if the last 5 star is not promo, get promo
global last_roll_not_feature
if last_roll_not_feature:
last_roll_not_feature = False
return "featured"
if random.random() < 0.5:
last_roll_not_feature = False
return "featured"
else:
last_roll_not_feature = True
return "non-featured"
def gacha():
global last_seen_5
global last_seen_4
GACHA = random.random()
if GACHA <= 0.006 or last_seen_5 == 89:
last_seen_5 = 0
last_seen_4 = 0
return get5star()
elif GACHA <= 0.057 or last_seen_4 == 9:
last_seen_4 = 0
last_seen_5 += 1
return "some 4 star character"
else:
last_seen_5 +=1
last_seen_4 +=1
return "nice 3 star sword"
history_5_star = defaultdict(int)
history_total = []
for i in range(10000):
history = []
total_pull = 0
featured_count = 0
while(featured_count < 7):
PULL = gacha()
total_pull += 1
history += [PULL]
if PULL == "featured":
featured_count += 1
history_total += [total_pull]
print("Average pulls required for C6 featured 5 star" ,sum(history_total)/len(history_total))
Replies to C6 Limited 5* Character 
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}