Winterbay
Active member
I am currently trying to write ascript that will calculate the best sushi to eat in turns of meat/turn of fishy (might be extended to other things as well, but you need to start somewhere). The current script (included below) prints a degub-log when I try to verify it, and since my skills of interpreting debug-logs are limited I come to the forums for help. Debug-log attached.
I started out by trying to have 1 record for all types of sushi and use a dummy-ingredient for those that were not needed but that also gave a debug-log (with the number 3 exchanged for the number 7).
I started out by trying to have 1 record for all types of sushi and use a dummy-ingredient for those that were not needed but that also gave a debug-log (with the number 3 exchanged for the number 7).
PHP:
record sushiparts
{
item name;
int price;
};
record base_sushi
{
sushiparts ingredient1;
int total_cost;
int fishy;
};
record nigri_sushi
{
sushiparts ingredient1;
sushiparts ingredient2;
int total_cost;
int fishy;
};
sushiparts[int] meat;
meat[1] = new sushiparts($item[beefy fish meat],mall_price($item[beefy fish meat]));
meat[2] = new sushiparts($item[glistening fish meat],mall_price($item[glistening fish meat]));
meat[3] = new sushiparts($item[slick fish meat],mall_price($item[slick fish meat]));
sushiparts[int] topping;
topping[1] = new sushiparts($item[eel sauce],mall_price($item[eel sauce]));
topping[2] = new sushiparts($item[dragonfish caviar],mall_price($item[dragonfish caviar]));
topping[3] = new sushiparts($item[sea salt crystal],mall_price($item[sea salt crystal]));
sushiparts[int] filling;
filling[1] = new sushiparts($item[sea avocado],mall_price($item[sea avocado]));
filling[2] = new sushiparts($item[sea carrot],mall_price($item[sea carrot]));
filling[3] = new sushiparts($item[sea cucumber],mall_price($item[sea cucumber]));
filling[4] = new sushiparts($item[sea radish],mall_price($item[sea radish]));
sushiparts[int] basics;
basics[1] = new sushiparts($item[white rice],mall_price($item[white rice]));
basics[2] = new sushiparts($item[seaweed],mall_price($item[seaweed]));
base_sushi[item] base;
base[$item[beefy fish meat]] = new base_sushi(meat[1],meat[1].price,5);
base[$item[glistening fish meat]] = new base_sushi(meat[2],meat[2].price,5);
base[$item[slick fish meat]] = new base_sushi(meat[3],meat[3].price,,5);
nigri_sushi[item] nigri;
int[int] total
for i from 1 to 3
{
total[i] = meat[i].price + basics[i].price;
}
nigri[$item[beefy nigri]] = new nigri_sushi(meat[1],basics[1],total[1],20);