Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -0,0 +1,26 @@
|
|||
func Min(A, B);
|
||||
real A, B;
|
||||
return fix(if A < B then A else B);
|
||||
|
||||
int Panacea, Ichor, Gold, Panacea_, Ichor_, Gold_, Val, Max;
|
||||
real Weight, Volume;
|
||||
[Max:= 0;
|
||||
for Panacea:= 0 to Min(25.0/0.3, 0.25/0.025) do
|
||||
[for Ichor:= 0 to Min(25.0/0.2, 0.25/0.015) do
|
||||
[for Gold:= 0 to Min(25.0/2.0, 0.25/0.002) do
|
||||
[Val:= Panacea*3000 + Ichor*1800 + Gold*2500;
|
||||
Weight:= float(Panacea)*0.3 + float(Ichor)*0.2 + float(Gold)*2.0;
|
||||
Volume:= float(Panacea)*0.025 + float(Ichor)*0.015 + float(Gold)*0.002;
|
||||
if Val>Max and Weight<=25.0 and Volume<= 0.25 then
|
||||
[Max:= Val;
|
||||
Panacea_:= Panacea; Ichor_:= Ichor; Gold_:= Gold;
|
||||
];
|
||||
];
|
||||
];
|
||||
];
|
||||
Text(0, "The traveler carries ");
|
||||
IntOut(0, Panacea_); Text(0, " vials of panacea, ");
|
||||
IntOut(0, Ichor_); Text(0, " ampules of ichor, and ");
|
||||
IntOut(0, Gold_); Text(0, " bars of gold"); CrLf(0);
|
||||
Text(0, "for a maximum value of "); IntOut(0, Max); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue