@ -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,36 +226,38 @@ const MAXSTEPS= 10000
else {
else {
var result = true
var result = true
while ( start != end ) {
while ( start != end ) {
if ( flexible ) {
if ( maxscore > 0 ) {
for ( var j = bonus ; j >= 0 ; j -= 0.2 ) {
if ( flexible ) {
while ( TryBiggestGain ( j ) ) {
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"
//document.getElementById("console").value+=+start+" EP"+"\n"
}
}
for ( var i = 4 ; i > 0 ; i -- ) {
for ( var i = 4 ; i > 0 ; i -- ) {
while ( TrySmallerGain ( i , j ) ) {
while ( TrySmallerGain ( i , bonus ) ) {
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
}
}
}
}
for ( var i = 5 ; i > 0 ; i -- ) {
for ( var i = 5 ; i > 0 ; i -- ) {
while ( TrySmolGain ( i , j ) ) {
while ( TrySmolGain ( i , bonus ) ) {
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
//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 ) {
for ( var j = bonus ; j >= 0 ; j -= 0.2 ) {
result = TryMatchingRehearsal ( j )
result = TryMatchingRehearsal ( j )
@ -284,18 +286,20 @@ const MAXSTEPS= 10000
}
}
if ( flexible ) {
if ( maxscore > 0 ) {
for ( var i = 5 ; i > 0 ; i -- ) {
if ( flexible ) {
for ( var j = bonus ; j >= 0 ; j -= 0.2 ) {
for ( var i = 5 ; i > 0 ; i -- ) {
while ( result = TryEqualGain ( i , j ) ) {
for ( var j = bonus ; j >= 0 ; j -= 0.2 ) {
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
while ( result = TryEqualGain ( i , j ) ) {
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
}
}
}
}
}
}
} else {
} else {
for ( var i = 5 ; i > 0 ; i -- ) {
for ( var i = 5 ; i > 0 ; i -- ) {
while ( result = TryEqualGain ( i , bonus ) ) {
while ( result = TryEqualGain ( i , bonus ) ) {
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
//document.getElementById("console").value+="Step "+(step++)+")"+start+" EP"+"\n"
}
}
}
}
}
}
}