Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int meat_remaining;
- int turn_counter;
- int total_turns_sans;
- int total_turns_with;
- int rround(float butts){
- float remain = butts%1;
- if(remain * 100 <= random(100)){
- return floor(butts);
- }
- else{
- return floor(butts+1);
- }
- }
- void simulate_nuns(float meat_boner, int times){
- total_turns_sans = 0;
- total_turns_with = 0;
- //nuns without singing along.
- for i from 1 to times{
- meat_remaining = 100000;
- turn_counter = 0;
- //continue until 1-2 monsters' worth of meat left.
- while(meat_remaining > floor(1200*(1+meat_boner))){
- turn_counter++;
- meat_remaining -= rround((800 + random(201) + random(201))*(1+meat_boner));
- }
- //if we can't guarantee being done in 1 turn, add 2 turns.
- if(meat_remaining > floor(800*(1+meat_boner))){
- turn_counter++;
- turn_counter++;
- }
- else{
- turn_counter++;
- }
- total_turns_sans += turn_counter;
- /*
- if(i%50000 == 0){
- print("simulations+=50k.");
- }
- */
- }
- //nuns with singing along.
- for i from 1 to times{
- meat_remaining = 100000;
- turn_counter = 0;
- //continue until 1-2 monsters' worth of meat left.
- while(meat_remaining > floor(1230*(1+meat_boner))){
- turn_counter++;
- meat_remaining -= rround((820 + random(201) + random(201) + random(11))*(meat_boner+1));
- }
- //if we can't guarantee being done in 1 turn, add 2 turns.
- if(meat_remaining > floor(820*(1+meat_boner))){
- turn_counter++;
- turn_counter++;
- }
- else{
- turn_counter++;
- }
- total_turns_with += turn_counter;
- /*
- if(i%50000 == 0){
- print("simulations+=50k.");
- }
- */
- }
- float EV_sans = (total_turns_sans.to_float()) / (times.to_float());
- float EV_with = (total_turns_with.to_float()) / (times.to_float());
- print("EV with singing and +"+((meat_boner-1)*100)+"% meat: "+EV_with.to_string());
- print("EV sans singing and +"+((meat_boner-1)*100)+"% meat: "+EV_sans.to_string());
- print((EV_sans-EV_with).to_string()+"turns saved by singing with +"+((meat_boner-1)*100)+"% meat");
- }
- for j from 1 to 20{
- simulate_nuns((1+j.to_float()*0.5),100000);
- }
Advertisement
Add Comment
Please, Sign In to add comment