parent
c1a681eb7f
commit
6ce5d0479f
@ -0,0 +1,28 @@ |
|||||||
|
* { |
||||||
|
font-family: "Comic Sans MS", "Comic Sans", cursive; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
|
||||||
|
body::before { |
||||||
|
content: ""; |
||||||
|
position: fixed; |
||||||
|
width: 100vw; |
||||||
|
height: 100vh; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
background-image: url("https://cdn.discordapp.com/emojis/744938186983080126.png?v=1"); |
||||||
|
background-size: cover; |
||||||
|
background-repeat: no-repeat; |
||||||
|
background-position: center calc(62% + 2%); |
||||||
|
z-index: -1; |
||||||
|
opacity: 0.25; |
||||||
|
} |
||||||
|
|
||||||
|
textarea { |
||||||
|
background-color: transparent; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
textarea:disabled { |
||||||
|
color: black; |
||||||
|
} |
@ -1,356 +1,567 @@ |
|||||||
<script> |
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<link rel="stylesheet" href="muni.css" /> |
||||||
|
<title>D4DJ Parking Calculator | Powered by Muni</title> |
||||||
|
<script> |
||||||
|
const MAXSTEPS = 10000; |
||||||
|
|
||||||
const MAXSTEPS= 10000 |
function test() { |
||||||
|
var start = Math.abs(Number(document.getElementById("starting").value)); |
||||||
|
var end = Math.abs(Number(document.getElementById("ending").value)); |
||||||
|
var maxscore = Math.abs( |
||||||
|
Number(document.getElementById("maxscore").value) |
||||||
|
); |
||||||
|
var bonus = Number(document.getElementById("team").value); |
||||||
|
var type = document.getElementById("Bingo").checked |
||||||
|
? "Bingo" |
||||||
|
: document.getElementById("Poker").checked |
||||||
|
? "Poker/Raid" |
||||||
|
: "Medley"; |
||||||
|
var flexible = document.getElementById("flexible").checked; |
||||||
|
//document.getElementById("console").value=flexible+"...\n\n" |
||||||
|
var step = 1; |
||||||
|
var flameCount = 0; |
||||||
|
var originalTarget = start; |
||||||
|
document.getElementById("console").value = ""; |
||||||
|
|
||||||
function test(){ |
var interval = type == "Medley" ? 15000 : 10000; |
||||||
var start = Math.abs(Number(document.getElementById("starting").value)) |
|
||||||
var end = Math.abs(Number(document.getElementById("ending").value)) |
|
||||||
var maxscore = Math.abs(Number(document.getElementById("maxscore").value)) |
|
||||||
var bonus = Number(document.getElementById("team").value) |
|
||||||
var type = (document.getElementById("Bingo").checked?"Bingo": |
|
||||||
document.getElementById("Poker").checked?"Poker/Raid": |
|
||||||
"Medley") |
|
||||||
var flexible = document.getElementById("flexible").checked |
|
||||||
//document.getElementById("console").value=flexible+"...\n\n" |
|
||||||
var step=1 |
|
||||||
var flameCount=0 |
|
||||||
var originalTarget=start |
|
||||||
document.getElementById("console").value="" |
|
||||||
|
|
||||||
var interval = (type=="Medley")?15000:10000 |
function EPCalc(voltage, score, bonus) { |
||||||
|
if (voltage > 0) { |
||||||
|
switch (type) { |
||||||
|
case "Bingo": |
||||||
|
{ |
||||||
|
return ( |
||||||
|
voltage * |
||||||
|
Math.floor( |
||||||
|
(1 + bonus) * Math.max(10, Math.floor(score / interval)) |
||||||
|
) |
||||||
|
); |
||||||
|
} |
||||||
|
break; |
||||||
|
case "Medley": |
||||||
|
{ |
||||||
|
return ( |
||||||
|
voltage * |
||||||
|
Math.floor( |
||||||
|
(1 + bonus) * (10 + Math.floor(score / interval)) |
||||||
|
) |
||||||
|
); |
||||||
|
} |
||||||
|
break; |
||||||
|
case "Poker/Raid": |
||||||
|
{ |
||||||
|
return ( |
||||||
|
voltage * |
||||||
|
Math.floor( |
||||||
|
(1 + bonus) * (50 + Math.floor(score / interval)) |
||||||
|
) |
||||||
|
); |
||||||
|
} |
||||||
|
break; |
||||||
|
} |
||||||
|
} else { |
||||||
|
return Math.round(bonus * 10) + 10; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
function EPCalc(voltage,score,bonus) { |
function EvenOdd(val) { |
||||||
if (voltage>0) { |
return val % 2 == 0 ? "even" : "odd"; |
||||||
switch (type) { |
} |
||||||
case "Bingo":{ |
|
||||||
return voltage * Math.floor((1 + bonus)*Math.max(10,Math.floor(score/interval))) |
|
||||||
}break; |
|
||||||
case "Medley":{ |
|
||||||
return voltage * Math.floor((1 + bonus)*(10+Math.floor(score/interval))) |
|
||||||
}break; |
|
||||||
case "Poker/Raid":{ |
|
||||||
return voltage * Math.floor((1 + bonus)*(50 + Math.floor(score/interval))) |
|
||||||
}break; |
|
||||||
} |
|
||||||
} else { |
|
||||||
return Math.round(bonus*10)+10 |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
function EvenOdd(val) { |
function TryBiggestGain(tbonus) { |
||||||
return val%2==0?"even":"odd" |
var voltage = 5; |
||||||
} |
for (var i = maxscore; i >= maxscore * 0.8; i -= interval) { |
||||||
|
if (start + EPCalc(voltage, i, tbonus) < end - 10) { |
||||||
|
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
|
if ( |
||||||
|
EvenOdd(start + EPCalc(voltage, i, tbonus)) == EvenOdd(end - 10) |
||||||
|
) { |
||||||
|
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
|
start += EPCalc(voltage, i, tbonus); |
||||||
|
flameCount += voltage; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Using " + |
||||||
|
voltage + |
||||||
|
" voltage w/" + |
||||||
|
Math.round(tbonus * 100) + |
||||||
|
"% team, score between " + |
||||||
|
i + |
||||||
|
"~" + |
||||||
|
(i + interval - 1) + |
||||||
|
" pts. EP +" + |
||||||
|
EPCalc(voltage, i, tbonus) + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
function TryBiggestGain(tbonus) { |
function TrySmallerGain(voltage, tbonus) { |
||||||
var voltage=5 |
for (var i = maxscore; i >= maxscore * 0.8; i -= interval) { |
||||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
if (start + EPCalc(voltage, i, tbonus) < end - 10) { |
||||||
if (start+EPCalc(voltage,i,tbonus)<end-10) { |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
if ( |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
EvenOdd(start + EPCalc(voltage, i, tbonus)) == EvenOdd(end - 10) |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
) { |
||||||
start+=EPCalc(voltage,i,tbonus) |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
flameCount+=voltage |
start += EPCalc(voltage, i, tbonus); |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
flameCount += voltage; |
||||||
return true |
document.getElementById("console").value += |
||||||
} |
"Step " + |
||||||
} |
step++ + |
||||||
} |
") Using " + |
||||||
return false |
voltage + |
||||||
} |
" voltage w/" + |
||||||
|
Math.round(tbonus * 100) + |
||||||
|
"% team, score between " + |
||||||
|
i + |
||||||
|
"~" + |
||||||
|
(i + interval - 1) + |
||||||
|
" pts. EP +" + |
||||||
|
EPCalc(voltage, i, tbonus) + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
function TrySmallerGain(voltage,tbonus) { |
function TrySmolGain(voltage, tbonus) { |
||||||
for (var i=maxscore;i>=maxscore*0.8;i-=interval) { |
for (var i = maxscore; i >= 0; i -= interval) { |
||||||
if (start+EPCalc(voltage,i,tbonus)<end-10) { |
if ( |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
EPCalc(voltage, i, tbonus) >= 10 + Math.round(bonus * 10) && |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
start + EPCalc(voltage, i, tbonus) <= |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
end - (10 + Math.round(bonus * 10)) |
||||||
start+=EPCalc(voltage,i,tbonus) |
) { |
||||||
flameCount+=voltage |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
if ( |
||||||
return true |
EvenOdd(start + EPCalc(voltage, i, tbonus)) == EvenOdd(end - 10) |
||||||
} |
) { |
||||||
} |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
} |
start += EPCalc(voltage, i, tbonus); |
||||||
return false |
flameCount += voltage; |
||||||
} |
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Using " + |
||||||
|
voltage + |
||||||
|
" voltage w/" + |
||||||
|
Math.round(tbonus * 100) + |
||||||
|
"% team, score between " + |
||||||
|
i + |
||||||
|
"~" + |
||||||
|
(i + interval - 1) + |
||||||
|
" pts. EP +" + |
||||||
|
EPCalc(voltage, i, tbonus) + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
for (var i = maxscore; i >= 0; i -= interval) { |
||||||
|
if ( |
||||||
|
EvenOdd(start + EPCalc(voltage, i, tbonus)) != |
||||||
|
EvenOdd(end - 10) && |
||||||
|
start + EPCalc(voltage, i, tbonus) == end |
||||||
|
) { |
||||||
|
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
|
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
|
start += EPCalc(voltage, i, tbonus); |
||||||
|
flameCount += voltage; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Using " + |
||||||
|
voltage + |
||||||
|
" voltage w/" + |
||||||
|
Math.round(tbonus * 100) + |
||||||
|
"% team, score between " + |
||||||
|
i + |
||||||
|
"~" + |
||||||
|
(i + interval - 1) + |
||||||
|
" pts. EP +" + |
||||||
|
EPCalc(voltage, i, tbonus) + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
/*for (var i=maxscore;i>=0;i-=interval) { |
||||||
|
if ((start+EPCalc(voltage,i,tbonus))==end) { |
||||||
|
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
|
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
|
start+=EPCalc(voltage,i,tbonus) |
||||||
|
flameCount+=voltage |
||||||
|
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
||||||
|
return true |
||||||
|
} |
||||||
|
}*/ |
||||||
|
for (var i = maxscore; i >= 0; i -= interval) { |
||||||
|
if ( |
||||||
|
EvenOdd(start + EPCalc(voltage, i, tbonus)) != |
||||||
|
EvenOdd(end - 10) && |
||||||
|
start + EPCalc(voltage, i, tbonus) == end |
||||||
|
) { |
||||||
|
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
|
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
|
start += EPCalc(voltage, i, tbonus); |
||||||
|
flameCount += voltage; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Using " + |
||||||
|
voltage + |
||||||
|
" voltage w/" + |
||||||
|
Math.round(tbonus * 100) + |
||||||
|
"% team, score between " + |
||||||
|
i + |
||||||
|
"~" + |
||||||
|
(i + interval - 1) + |
||||||
|
" pts. EP +" + |
||||||
|
EPCalc(voltage, i, tbonus) + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
function TrySmolGain(voltage,tbonus) { |
function TryEqualGain(voltage, tbonus) { |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
for (var i = maxscore; i >= 0; i -= interval) { |
||||||
if (EPCalc(voltage,i,tbonus)>=(10+Math.round(bonus*10))&&(start+EPCalc(voltage,i,tbonus)<=end-(10+Math.round(bonus*10)))) { |
//document.getElementById("console").value+=(start+EPCalc(voltage,i,tbonus))+"/"+end+"\n" |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
if (start + EPCalc(voltage, i, tbonus) == end) { |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))==EvenOdd(end-10)) { |
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
||||||
start+=EPCalc(voltage,i,tbonus) |
start += EPCalc(voltage, i, tbonus); |
||||||
flameCount+=voltage |
flameCount += voltage; |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
document.getElementById("console").value += |
||||||
return true |
"Step " + |
||||||
} |
step++ + |
||||||
} |
") Using " + |
||||||
} |
voltage + |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
" voltage w/" + |
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(start+EPCalc(voltage,i,tbonus))==end) { |
Math.round(tbonus * 100) + |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
"% team, score between " + |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
i + |
||||||
start+=EPCalc(voltage,i,tbonus) |
"~" + |
||||||
flameCount+=voltage |
(i + interval - 1) + |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
" pts. EP +" + |
||||||
return true |
EPCalc(voltage, i, tbonus) + |
||||||
} |
". Remaining:" + |
||||||
} |
(end - start) + |
||||||
/*for (var i=maxscore;i>=0;i-=interval) { |
" EP \n"; |
||||||
if ((start+EPCalc(voltage,i,tbonus))==end) { |
return true; |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
} |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
} |
||||||
start+=EPCalc(voltage,i,tbonus) |
if (end == start) { |
||||||
flameCount+=voltage |
return false; |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
} else { |
||||||
return true |
return undefined; |
||||||
} |
} |
||||||
}*/ |
} |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
|
||||||
if (EvenOdd(start+EPCalc(voltage,i,tbonus))!=EvenOdd(end-10)&&(start+EPCalc(voltage,i,tbonus))==end) { |
|
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
|
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
|
||||||
start+=EPCalc(voltage,i,tbonus) |
|
||||||
flameCount+=voltage |
|
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
|
||||||
return true |
|
||||||
} |
|
||||||
} |
|
||||||
return false |
|
||||||
} |
|
||||||
|
|
||||||
function TryEqualGain(voltage,tbonus) { |
function TryMatchingRehearsal(tbonus) { |
||||||
for (var i=maxscore;i>=0;i-=interval) { |
//document.getElementById("console").value+=(Math.round(tbonus*10))+10 |
||||||
//document.getElementById("console").value+=(start+EPCalc(voltage,i,tbonus))+"/"+end+"\n" |
if (end - start == Math.round(tbonus * 10) + 10) { |
||||||
if ((start+EPCalc(voltage,i,tbonus))==end) { |
var gain = Math.round(tbonus * 10) + 10; |
||||||
//document.getElementById("console").value+="Ending value needs to be "+EvenOdd(end-10)+"\n" |
start += gain; |
||||||
//document.getElementById("console").value+=EvenOdd(start+EPCalc(voltage,i,tbonus))+"/"+EvenOdd(end-10)+"\n" |
document.getElementById("console").value += |
||||||
start+=EPCalc(voltage,i,tbonus) |
"Step " + |
||||||
flameCount+=voltage |
step++ + |
||||||
document.getElementById("console").value+="Step "+(step++)+") Using "+voltage+" voltage w/"+Math.round(tbonus*100)+"% team, score between "+i+"~"+(i+interval-1)+" pts. EP +"+EPCalc(voltage,i,tbonus)+". Remaining:"+(end-start)+" EP \n" |
") Use Rehearsal w/" + |
||||||
return true |
Math.round(tbonus * 100) + |
||||||
} |
"% team. EP +" + |
||||||
} |
gain + |
||||||
if (end==start) { |
". Remaining:" + |
||||||
return false |
(end - start) + |
||||||
} else { |
" EP \n"; |
||||||
return undefined |
return false; |
||||||
} |
} |
||||||
} |
return true; |
||||||
|
} |
||||||
|
|
||||||
function TryMatchingRehearsal(tbonus) { |
function TryRehearsal(tbonus) { |
||||||
//document.getElementById("console").value+=(Math.round(tbonus*10))+10 |
if (end == start) { |
||||||
if (end-start==(Math.round(tbonus*10))+10) { |
return false; |
||||||
var gain=(Math.round(tbonus*10))+10 |
} |
||||||
start+=gain |
var voltage = 0; |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+Math.round(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
if ((end - start) % 2 !== 0) { |
||||||
return false |
return undefined; |
||||||
} |
} |
||||||
return true |
|
||||||
} |
|
||||||
|
|
||||||
function TryRehearsal(tbonus) { |
if (end - start > 10 + Math.round(tbonus * 10) + 10) { |
||||||
if (end==start) { |
var gain = 10 + Math.round(tbonus * 10); |
||||||
return false |
start += gain; |
||||||
} |
document.getElementById("console").value += |
||||||
var voltage=0 |
"Step " + |
||||||
if ((end-start)%2!==0) { |
step++ + |
||||||
return undefined |
") Use Rehearsal w/" + |
||||||
} |
tbonus * 100 + |
||||||
|
"% team. EP +" + |
||||||
|
gain + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} else if (end - start >= 20) { |
||||||
|
var gain = end - start - 10; |
||||||
|
start += gain; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Use Rehearsal w/" + |
||||||
|
(gain - 10) * 10 + |
||||||
|
"% team. EP +" + |
||||||
|
gain + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return true; |
||||||
|
} else if ((end - start) % 10 == 0) { |
||||||
|
var gain = 10; |
||||||
|
start += gain; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Use Rehearsal w/0% team. EP +" + |
||||||
|
gain + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return false; |
||||||
|
} else { |
||||||
|
var gain = end - start; |
||||||
|
start += gain; |
||||||
|
document.getElementById("console").value += |
||||||
|
"Step " + |
||||||
|
step++ + |
||||||
|
") Use Rehearsal w/" + |
||||||
|
(gain - 10) * 10 + |
||||||
|
"% team. EP +" + |
||||||
|
gain + |
||||||
|
". Remaining:" + |
||||||
|
(end - start) + |
||||||
|
" EP \n"; |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
if (end-start>(10+Math.round(tbonus*10))+10) { |
return false; |
||||||
var gain=(10+Math.round(tbonus*10)) |
/*var voltage=0 |
||||||
start+=gain |
if (end-start>36) { |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(tbonus*100)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
start+=26 |
||||||
return true |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
||||||
} else |
return true |
||||||
if (end-start>=20) { |
} else |
||||||
var gain=end-start-10 |
if (end-start>20) { |
||||||
start+=gain |
var bonus = (end-start-20)*10 |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
var gain = end-start-10 |
||||||
return true |
start+=end-start-10 |
||||||
} else |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
||||||
if ((end-start)%10==0) { |
if ((bonus/10)%2!=0) { |
||||||
var gain=10 |
return undefined |
||||||
start+=gain |
} else { |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/0% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
return true |
||||||
return false |
} |
||||||
} else |
} else { |
||||||
{ |
if (end-start<10||(end-start)%2!=0) { |
||||||
var gain=end-start |
return undefined |
||||||
start+=gain |
} |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((gain-10)*10)+"% team. EP +"+(gain)+". Remaining:"+(end-start)+" EP \n" |
var bonus = ((end-start-10)/20)*2 |
||||||
return false |
start+=end-start |
||||||
} |
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((bonus)*100)+"% team. EP +"+EPCalc(voltage,1,bonus)+". Remaining:"+(end-start)+" EP \n" |
||||||
|
|
||||||
return false |
return false |
||||||
/*var voltage=0 |
} |
||||||
if (end-start>36) { |
return true*/ |
||||||
start+=26 |
} |
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(1.6*100)+"% team. EP +"+EPCalc(voltage,1,1.6)+". Remaining:"+(end-start)+" EP \n" |
|
||||||
return true |
|
||||||
} else |
|
||||||
if (end-start>20) { |
|
||||||
var bonus = (end-start-20)*10 |
|
||||||
var gain = end-start-10 |
|
||||||
start+=end-start-10 |
|
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+(bonus)+"% team. EP +"+gain+". Remaining:"+(end-start)+" EP \n" |
|
||||||
if ((bonus/10)%2!=0) { |
|
||||||
return undefined |
|
||||||
} else { |
|
||||||
return true |
|
||||||
} |
|
||||||
} else { |
|
||||||
if (end-start<10||(end-start)%2!=0) { |
|
||||||
return undefined |
|
||||||
} |
|
||||||
var bonus = ((end-start-10)/20)*2 |
|
||||||
start+=end-start |
|
||||||
document.getElementById("console").value+="Step "+(step++)+") Use Rehearsal w/"+((bonus)*100)+"% team. EP +"+EPCalc(voltage,1,bonus)+". Remaining:"+(end-start)+" EP \n" |
|
||||||
|
|
||||||
return false |
if (end - start > 1000000) { |
||||||
} |
document.getElementById("console").value = |
||||||
return true*/ |
"Get closer to target score before using parking calculator!"; |
||||||
} |
} else { |
||||||
|
var result = true; |
||||||
|
while (start != end) { |
||||||
|
if (flexible) { |
||||||
|
for (var j = bonus; j >= 0; j -= 0.2) { |
||||||
|
while (TryBiggestGain(j)) { |
||||||
|
//document.getElementById("console").value+=+start+" EP"+"\n" |
||||||
|
} |
||||||
|
for (var i = 4; i > 0; i--) { |
||||||
|
while (TrySmallerGain(i, j)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
|
} |
||||||
|
} |
||||||
|
for (var i = 5; i > 0; i--) { |
||||||
|
while (TrySmolGain(i, j)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} else { |
||||||
|
while (TryBiggestGain(bonus)) { |
||||||
|
//document.getElementById("console").value+=+start+" EP"+"\n" |
||||||
|
} |
||||||
|
for (var i = 4; i > 0; i--) { |
||||||
|
while (TrySmallerGain(i, bonus)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
|
} |
||||||
|
} |
||||||
|
for (var i = 5; i > 0; i--) { |
||||||
|
while (TrySmolGain(i, bonus)) { |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
for (var j = bonus; j >= 0; j -= 0.2) { |
||||||
|
result = TryMatchingRehearsal(j); |
||||||
|
if (!result) { |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
if (result) { |
||||||
|
for (var j = 1.6; j >= 0; j -= 0.2) { |
||||||
|
result = TryMatchingRehearsal(j); |
||||||
|
if (!result) { |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
if (result) { |
||||||
|
do { |
||||||
|
if (flexible) { |
||||||
|
for (var j = bonus; j >= 0; j -= 0.2) { |
||||||
|
result = TryRehearsal(j); |
||||||
|
} |
||||||
|
} else { |
||||||
|
result = TryRehearsal(bonus); |
||||||
|
} |
||||||
|
} while (result); |
||||||
|
} |
||||||
|
|
||||||
if ((end-start)>1000000) { |
if (flexible) { |
||||||
document.getElementById("console").value="Get closer to target score before using parking calculator!" |
for (var i = 5; i > 0; i--) { |
||||||
} |
for (var j = bonus; j >= 0; j -= 0.2) { |
||||||
else { |
while ((result = TryEqualGain(i, j))) { |
||||||
var result=true |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
while (start!=end) { |
} |
||||||
if (flexible) { |
} |
||||||
for (var j=bonus;j>=0;j-=0.2) { |
} |
||||||
while (TryBiggestGain(j)) { |
} else { |
||||||
//document.getElementById("console").value+=+start+" EP"+"\n" |
for (var i = 5; i > 0; i--) { |
||||||
} |
while ((result = TryEqualGain(i, bonus))) { |
||||||
for (var i=4;i>0;i--) { |
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
while (TrySmallerGain(i,j)) { |
} |
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
} |
||||||
} |
} |
||||||
} |
|
||||||
for (var i=5;i>0;i--) { |
|
||||||
while (TrySmolGain(i,j)) { |
|
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} else { |
|
||||||
while (TryBiggestGain(bonus)) { |
|
||||||
//document.getElementById("console").value+=+start+" EP"+"\n" |
|
||||||
} |
|
||||||
for (var i=4;i>0;i--) { |
|
||||||
while (TrySmallerGain(i,bonus)) { |
|
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
|
||||||
} |
|
||||||
} |
|
||||||
for (var i=5;i>0;i--) { |
|
||||||
while (TrySmolGain(i,bonus)) { |
|
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
for (var j=bonus;j>=0;j-=0.2) { |
|
||||||
result = TryMatchingRehearsal(j) |
|
||||||
if (!result) { |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
if (result) { |
|
||||||
for (var j=1.6;j>=0;j-=0.2) { |
|
||||||
result = TryMatchingRehearsal(j) |
|
||||||
if (!result) { |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
if (result) { |
|
||||||
do { |
|
||||||
if (flexible) { |
|
||||||
for (var j=bonus;j>=0;j-=0.2) { |
|
||||||
result = TryRehearsal(j) |
|
||||||
} |
|
||||||
} else { |
|
||||||
result = TryRehearsal(bonus) |
|
||||||
} |
|
||||||
} while (result); |
|
||||||
} |
|
||||||
|
|
||||||
|
start = end; |
||||||
|
if (result === undefined) { |
||||||
|
document.getElementById("console").value = |
||||||
|
"Impossible to park using this team!"; |
||||||
|
} else { |
||||||
|
document.getElementById("console").value = |
||||||
|
"Calculating from " + |
||||||
|
originalTarget + |
||||||
|
" to " + |
||||||
|
end + |
||||||
|
" for event type " + |
||||||
|
type + |
||||||
|
"...\n\t(All games are done in Free Live)\n\nFound a park! " + |
||||||
|
(step - 1) + |
||||||
|
" steps and " + |
||||||
|
flameCount + |
||||||
|
" voltage required!\n\n" + |
||||||
|
document.getElementById("console").value; |
||||||
|
} |
||||||
|
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
||||||
|
step++; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<h1>D4DJ Event Parking Calculator</h1> |
||||||
|
|
||||||
if (flexible) { |
<fieldset> |
||||||
for (var i=5;i>0;i--) { |
<legend>Parking Configuration</legend> |
||||||
for (var j=bonus;j>=0;j-=0.2) { |
<input type="radio" id="Poker" name="type" value="Poker" checked /> |
||||||
while (result = TryEqualGain(i,j)) { |
<label for="Poker">Poker/Raid</label> |
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
|
||||||
} |
<input type="radio" id="Bingo" name="type" value="Bingo" /> |
||||||
} |
<label for="Bingo">Bingo</label> |
||||||
} |
|
||||||
} else { |
<input type="radio" id="Medley" name="type" value="Medley" /> |
||||||
for (var i=5;i>0;i--) { |
<label for="Medley">Medley</label> |
||||||
while (result = TryEqualGain(i,bonus)) { |
|
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
<hr /> |
||||||
} |
<label for="team">Event Team Bonus:</label> |
||||||
} |
<select id="team" name="team"> |
||||||
} |
<option value="0">0%</option> |
||||||
|
<option value="0.2">20%</option> |
||||||
|
<option value="0.4">40%</option> |
||||||
|
<option value="0.6">60%</option> |
||||||
|
<option value="0.8">80%</option> |
||||||
|
<option value="1.0">100%</option> |
||||||
|
<option value="1.2">120%</option> |
||||||
|
<option value="1.4">140%</option> |
||||||
|
<option value="1.6" selected>160%</option> |
||||||
|
</select> |
||||||
|
<label for="flexible" alt="Yes" |
||||||
|
><b>Flexible Team?</b></label |
||||||
|
><input id="flexible" type="checkbox" /> |
||||||
|
<i>If turned on, calculates scoring options using lower % teams also.</i> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<label for="maxscore"><b>Max Free Live Score: </b></label |
||||||
|
><input id="maxscore" min="0" type="number" value="650000" /> |
||||||
|
<hr /> |
||||||
|
<label for="starting"><b>Starting EP: </b></label |
||||||
|
><input id="starting" min="0" type="number" value="100000" /> |
||||||
|
<span style="font-size: 32px; padding: 0px 10px 0px 10px">➔</span> |
||||||
|
<label for="ending"><b>Target EP: </b></label |
||||||
|
><input id="ending" min="0" type="number" value="104000" /> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<button |
||||||
|
id="calculate" |
||||||
|
style=" |
||||||
|
background-color: #ccddff; |
||||||
|
margin-left: 20px; |
||||||
|
width: 240px; |
||||||
|
height: 32px; |
||||||
|
font-size: 18px; |
||||||
|
" |
||||||
|
onclick="test()" |
||||||
|
> |
||||||
|
Calculate |
||||||
|
</button> |
||||||
|
</fieldset> |
||||||
|
<div style="display: flex; justify-content: stretch; align-items: center"> |
||||||
|
<textarea rows="20" cols="160" id="console" disabled> </textarea> |
||||||
|
</div> |
||||||
|
|
||||||
start=end |
<script> |
||||||
if (result===undefined) { |
document.getElementById("ips").value = ""; |
||||||
document.getElementById("console").value="Impossible to park using this team!" |
</script> |
||||||
} else { |
</body> |
||||||
document.getElementById("console").value="Calculating from "+originalTarget+" to "+end+" for event type "+type+"...\n\t(All games are done in Free Live)\n\nFound a park! "+(step-1)+" steps and "+flameCount+" voltage required!\n\n"+document.getElementById("console").value |
</html> |
||||||
} |
|
||||||
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n" |
|
||||||
step++ |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
</script> |
|
||||||
|
|
||||||
<h1>D4DJ Event Parking Calculator</h1> |
|
||||||
|
|
||||||
<fieldset> |
|
||||||
<legend>Parking Configuration</legend> |
|
||||||
<input type="radio" id="Poker" name="type" value="Poker" checked> |
|
||||||
<label for="Poker">Poker/Raid</label> |
|
||||||
|
|
||||||
<input type="radio" id="Bingo" name="type" value="Bingo"> |
|
||||||
<label for="Bingo">Bingo</label> |
|
||||||
|
|
||||||
<input type="radio" id="Medley" name="type" value="Medley"> |
|
||||||
<label for="Medley">Medley</label> |
|
||||||
|
|
||||||
<hr> |
|
||||||
<label for="team">Event Team Bonus:</label> |
|
||||||
<select id="team" name="team"> |
|
||||||
<option value="0">0%</option> |
|
||||||
<option value="0.2">20%</option> |
|
||||||
<option value="0.4">40%</option> |
|
||||||
<option value="0.6">60%</option> |
|
||||||
<option value="0.8">80%</option> |
|
||||||
<option value="1.0">100%</option> |
|
||||||
<option value="1.2">120%</option> |
|
||||||
<option value="1.4">140%</option> |
|
||||||
<option value="1.6" selected>160%</option> |
|
||||||
</select> |
|
||||||
<label for="flexible" alt="Yes"><b>Flexible Team?</b></label><input id="flexible" type="checkbox"> <i>If turned on, calculates scoring options using lower % teams also.</i> |
|
||||||
<br> |
|
||||||
<br> |
|
||||||
<label for="maxscore"><b>Max Free Live Score: </b></label><input id="maxscore" min=0 type="number" value="650000"> |
|
||||||
<hr> |
|
||||||
<label for="starting"><b>Starting EP: </b></label><input id="starting" min=0 type="number" value="100000"> |
|
||||||
<span style="font-size:32px;padding:0px 10px 0px 10px">➔</span> |
|
||||||
<label for="ending"><b>Target EP: </b></label><input id="ending" min=0 type="number" value="104000"> |
|
||||||
<br> |
|
||||||
<br> |
|
||||||
<button id="calculate" style="background-color:#CCDDFF;margin-left:20px;width:240px;height:32px;font-size:18px;" onclick="test()">Calculate</button> |
|
||||||
</fieldset> |
|
||||||
<div style="justify-content: center;align-items: center;"> |
|
||||||
<hr> |
|
||||||
<textarea rows=20 cols=160 id="console"> |
|
||||||
</textarea> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script> |
|
||||||
document.getElementById("ips").value="" |
|
||||||
</script> |
|
||||||
|
Loading…
Reference in new issue