Test 1
1000 Iterations full loop (type="food" took 8073ms
Test 2
1000 Iterations (full loop, fullness > 0) took 12169ms
Test 3
1000 Iterations (fullness.text) took 4118ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 966ms
Test 1
1000 Iterations full loop (type="food" took 8137ms
Test 2
1000 Iterations (full loop, fullness > 0) took 12462ms
Test 3
1000 Iterations (fullness.text) took 4094ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 971ms
Test 1
1000 Iterations full loop (type="food" took 8198ms
Test 2
1000 Iterations (full loop, fullness > 0) took 12297ms
Test 3
1000 Iterations (fullness.text) took 3975ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 965ms
> call speed.ash
Test 1
1000 Iterations full loop (type="food" took 91235ms
Test 2
1000 Iterations (full loop, fullness > 0) took 125781ms
Test 3
1000 Iterations (fullness.text) took 22016ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 10625ms
Test 1
1000 Iterations full loop (type="food" took 91078ms
Test 2
1000 Iterations (full loop, fullness > 0) took 125782ms
Test 3
1000 Iterations (fullness.text) took 22015ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 10609ms
Test 1
1000 Iterations full loop (type="food" took 91235ms
Test 2
1000 Iterations (full loop, fullness > 0) took 126000ms
Test 3
1000 Iterations (fullness.text) took 22015ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 10625ms
print("Test 5");
boolean[item] onlyfood;
foreach it in $items[] {
if ( item_type(it) == "food" ) {
onlyfood[ it ] = true;
}
}
starttime = gametime_to_int();
for i from 1 to 1000 {
int epiccount = 0;
foreach it in onlyfood {
if (it.fullness > 0 & it.quality=="epic" ) {
epiccount +=1;
}
}
}
print("1000 Iterations (generated food map) took " + (gametime_to_int() - starttime) + "ms");
Test 1
1000 Iterations full loop (type="food" took 16124ms
Test 2
1000 Iterations (full loop, fullness > 0) took 24883ms
Test 3
1000 Iterations (fullness.text) took 7452ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 2084ms
Test 5
1000 Iterations (generated food map) took 2035ms
print("Test 6");
boolean[item] onlyfillingfood;
foreach it in $items[] {
if ( item_type(it) == "food" && it.fullness > 0 ) {
onlyfillingfood[ it ] = true;
}
}
starttime = gametime_to_int();
for i from 1 to 1000 {
int epiccount = 0;
foreach it in onlyfillingfood {
if (it.quality=="epic" ) {
epiccount +=1;
}
}
}
print("1000 Iterations (generated filling food map) took " + (gametime_to_int() - starttime) + "ms");
Test 1
1000 Iterations (full loop type="food") took 4523ms
Test 2
1000 Iterations (full loop, fullness > 0) took 15956ms
Test 3
1000 Iterations (fullness.text) took 7352ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 1829ms
Test 5
1000 Iterations (generated food map) took 1726ms
Test 6
1000 Iterations (generated filling food map) took 870ms
Test 1
1000 Iterations (full loop type="food") took 4408 ms and found 24 epic foods
Test 2
1000 Iterations (full loop, fullness > 0) took 13496 ms and found 24 epic foods
Test 3
1000 Iterations (fullness.text) took 7338 ms and found 24 epic foods
Test 4
1000 Iterations (fullness.text(pre loaded) map size = 412) took 1817 ms and found 24 epic foods
Test 5
1000 Iterations (generated food map size = 415) took 1836 ms and found 24 epic foods
Test 6
1000 Iterations (generated filling food map size = 409) took 877 ms and found 24 epic foods
> ashq foreach it in $items[] if ( item_type( it ) == "food" && it.fullness == 0 ) print( it )
Children's Meal of the Damned
spooky frank
plate of franks and beans
flask of peppermint oil
quantum taco
s'more
int starttime = 0;
int epiccount = 0;
boolean[item] food;
for a from 1 to 3 {
print("Test 1");
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
foreach it in $items[] {
if((item_type(it) == "food") && (it.quality=="epic") ) {
epiccount +=1;
}
}
}
print("1000 Iterations (full loop type=\"food\") took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
print("Test 2");
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
foreach it in $items[] {
if((it.fullness > 0) && (it.quality=="epic") ) {
epiccount +=1;
}
}
}
print("1000 Iterations (full loop, fullness > 0) took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
print("Test 3");
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
int[item] food;
file_to_map("fullness.txt", food);
foreach it in food {
if((it.fullness > 0) && (it.quality=="epic") ) {
epiccount +=1;
}
}
}
print("1000 Iterations (fullness.text) took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
print("Test 4");
int[item] food;
file_to_map("fullness.txt", food);
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
foreach it in food {
if((it.fullness > 0) && (it.quality=="epic") ) {
epiccount +=1;
}
}
}
print("1000 Iterations (fullness.text(pre loaded) map size = " + count(food) + ") took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
print("Test 5");
boolean[item] onlyfood;
foreach it in $items[] {
if ( item_type(it) == "food" ) {
onlyfood[ it ] = true;
}
}
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
foreach it in onlyfood {
if (it.fullness > 0 && it.quality=="epic" ) {
epiccount +=1;
}
}
}
print("1000 Iterations (generated food map size = " + count( onlyfood) + ") took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
Print("Test 6");
boolean[item] onlyfillingfood;
foreach it in $items[] {
if ( item_type(it) == "food" && it.fullness > 0 ) {
onlyfillingfood[ it ] = true;
}
}
starttime = gametime_to_int();
epiccount = 0;
for i from 1 to 1000 {
foreach it in onlyfillingfood {
if (it.quality=="epic" ) {
epiccount +=1;
}
}
}
print("1000 Iterations (generated filling food map size = " + count( onlyfillingfood) + ") took " + (gametime_to_int() - starttime) + " ms and found " + ( epiccount / 1000 ) + " epic foods");
}
Test 1
1000 Iterations full loop (type="food" took 8073ms
Test 2
1000 Iterations (full loop, fullness > 0) took 12169ms
Test 3
1000 Iterations (fullness.text) took 4118ms
Test 4
1000 Iterations (fullness.text(pre loaded)) took 966ms
Test 1
1000 Iterations (full loop type="food") took 1961 ms and found 24 epic foods
Test 2
1000 Iterations (full loop, fullness > 0) took 5683 ms and found 24 epic foods
Test 3
1000 Iterations (fullness.text) took 3659 ms and found 24 epic foods
Test 4
1000 Iterations (fullness.text(pre loaded) map size = 412) took 758 ms and found 24 epic foods
Test 5
1000 Iterations (generated food map size = 415) took 761 ms and found 24 epic foods
Test 6
1000 Iterations (generated filling food map size = 409) took 351 ms and found 24 epic foods
And keeps epic spleeners as well!
foreach it in $items[] {
if ((it.quality=="epic") & (item_amount(it) > 0)) print("You have " + item_amount(it) + " of " + it + " which is " + it.quality + " quality","red");
if ((it.quality=="awesome") & (item_amount(it) > 0)) print("You have " + item_amount(it) + " of " + it + " which is " + it.quality + " quality","blue");
if ((it.quality=="good") & (item_amount(it) > 0)) print("You have " + item_amount(it) + " of " + it + " which is " + it.quality + " quality","green");
if ((it.quality=="decent") & (item_amount(it) > 0)) print("You have " + item_amount(it) + " of " + it + " which is " + it.quality + " quality");
if ((it.quality=="crappy") & (item_amount(it) > 0)) print("You have " + item_amount(it) + " of " + it + " which is " + it.quality + " quality","gray");
}
foreach it in $items[]
{
float gainadv;
int totalcost;
switch (type)
{
case "food":
totalcost = it.fullness;
gainadv = totalcost > 0 ? (averange(set_range(it.adventures)) / totalcost) : 0;
break;
case "drink":
totalcost = it.inebriety;
gainadv = totalcost > 0 ? (averange(set_range(it.adventures)) / totalcost) : 0;
break;
case "spleen":
totalcost = it.spleen;
gainadv = totalcost > 0 ? (averange(set_range(it.adventures)) / totalcost) : 0;
break;
default:
continue;
break;
}
if (gainadv > 5) { do something with good consumables }
else { get rid of bad stuff }
}