Muni Rehearsals

advanced
sigonasr2, Sig, Sigo 4 years ago committed by GitHub
parent 02adc61f87
commit ced5b311cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      muni.js

@ -5,9 +5,9 @@ const MAXSTEPS= 10000
} }
function test(){ function test(){
var start = Math.abs(Number(document.getElementById("starting").value)) var start = Math.abs(Math.max(0,Number(document.getElementById("starting").value)))
var end = Math.abs(Number(document.getElementById("ending").value)) var end = Math.abs(Math.max(0,Number(document.getElementById("ending").value)))
var maxscore = Math.abs(Number(document.getElementById("maxscore").value)) var maxscore = Math.abs(Math.max(0,Number(document.getElementById("maxscore").value)))
var bonus = Number(document.getElementById("team").value) var bonus = Number(document.getElementById("team").value)
var type = (document.getElementById("Bingo").checked?"Bingo": var type = (document.getElementById("Bingo").checked?"Bingo":
document.getElementById("Poker").checked?"Poker/Raid": document.getElementById("Poker").checked?"Poker/Raid":
@ -164,7 +164,7 @@ const MAXSTEPS= 10000
if (end-start>(10+Math.round(tbonus*10))+10) { if (end-start>(10+Math.round(tbonus*10))+10) {
var gain=(10+Math.round(tbonus*10)) var gain=(10+Math.round(tbonus*10))
start+=gain start+=gain
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n"
return true return true
} else } else
if (end-start>=20) { if (end-start>=20) {
@ -226,6 +226,7 @@ const MAXSTEPS= 10000
else { else {
var result=true var result=true
while (start!=end) { while (start!=end) {
if (maxscore>0) {
if (flexible) { if (flexible) {
for (var j=bonus;j>=0;j-=0.2) { for (var j=bonus;j>=0;j-=0.2) {
while (TryBiggestGain(j)) { while (TryBiggestGain(j)) {
@ -257,6 +258,7 @@ const MAXSTEPS= 10000
} }
} }
} }
}
for (var j=bonus;j>=0;j-=0.2) { for (var j=bonus;j>=0;j-=0.2) {
result = TryMatchingRehearsal(j) result = TryMatchingRehearsal(j)
if (!result) { if (!result) {
@ -284,6 +286,7 @@ const MAXSTEPS= 10000
} }
if (maxscore>0) {
if (flexible) { if (flexible) {
for (var i=5;i>0;i--) { for (var i=5;i>0;i--) {
for (var j=bonus;j>=0;j-=0.2) { for (var j=bonus;j>=0;j-=0.2) {
@ -299,6 +302,7 @@ const MAXSTEPS= 10000
} }
} }
} }
}
start=end start=end
if (result===undefined) { if (result===undefined) {

Loading…
Cancel
Save