Work for 7/1

This commit is contained in:
David Meyer 2020-07-01 23:56:44 +09:00
parent bd525cc54a
commit 5e8093e845
1 changed files with 26 additions and 26 deletions

View File

@ -60,18 +60,15 @@ One person needs to eat 20 bushels of grain per year to stay healthy.\n\
";
char MSGMENU[]=
"You may use your grain to ...\n\
(F)eed your people,\n\
(P)lant crops on your land, or\n\
(B)uy more land. \n\
Or ...\n\
(S)ell land to increase your grain.\n\
You may also ...\n\
(E)xecute your current plan,\n\
(R)eset your current plan and start over, or\n\
(Q)uit the game.\n\
"\n\
[F]eed your people with grain | [E]xecute your current plan\n\
[P]lant crops on your land | [R]eset your current plan and start over\n\
[B]uy more land | [Q]uit the game\n\
";
char MSGPLTOT[] =
" ------------------------------ | ------------------------------\n";
char MSGSPLASH[] =
" ___ ___ ___. .__ \n\
/ | \\_____ _____ _____ __ ______________ \\_ |__ |__|\n\
@ -387,21 +384,23 @@ planmenu(void)
int cmdch = 0;
Plancmd cmd;
if(foodgrain > 0 || landsale != 0 || plantland > 0)
{
print("You are currently planning ...\n");
if(foodgrain > 0)
print("to provide %d bushels of grain to feed the people\n", foodgrain);
if(plantland > 0)
print("to plant %d acres of land using %d bushels of grain for seed\n",
plantland, plantland / 2);
if(landsale > 0)
print("to sell %d acres of land for %d bushels of grain\n", landsale,
landsale * landprice);
if(landsale < 0)
print("to buy %d acres of land for %d bushels of grain\n", landsale * -1,
landsale * landprice * -1);
}
print("\n Plan for Year %d\n", Year);
print(" Grain in storage %7d | Land (price %2d) %7d\n", Grain, landprice, Land);
if(landsale > 0)
print(" From land sale %7d | Sell %7d\n", landsale * landprice, landsale);
if(landsale < 0)
print(" For land purchase%7d | Purchase %7d\n", landsale * landprice * -1, landsale * -1);
if(landsale != 0)
print("%s Net %7d | Net %7d\n", MSGPLTOT, Grain + (landsale * landprice), Land - landsale);
if(foodgrain > 0) print(" Provide for food%7d |\n", foodgrain);
if(plantland > 0)
print(" Provide for seed%7d | Plant %7d\n", plantland / 2, plantland);
if(foodgrain > 0 || plantland > 0)
print("%s Balance %7d | Fallow acres %7d\n", MSGPLTOT,
Grain + (landsale * landprice) - foodgrain - (plantland / 2),
Land - landsale - plantland);
print("\n Population: %6d (need food: %6d; can farm: %6d)\n", Pop, Pop * 20, Pop * 10);
print(MSGMENU);
if(write(CONSCTL, "rawon", 5) != 5) exits("\ncan't turn off echo\n");
while(cmdch == 0)
@ -529,7 +528,7 @@ scanyes(char *prompt)
if(write(CONSCTL, "rawon", 5) != 5) exits("\ncan't turn off echo\n");
while(in != 'y' && in != 'n')
{
print("%s [y/n] ", prompt);
print("%s [yn] ", prompt);
in = getchar();
if(in == EOF) exits("\nerror reading terminal input\n");
print("%c\n", in);
@ -544,3 +543,4 @@ setlandprice(void)
{
landprice = nrand(10) + 17;
}