ejb@think.ARPA (Erik Bailey) (04/24/86)
#!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # init_all.c # kill_alm.c # leave_at.c # This archive created: Sat Jun 8 12:58:38 1985 echo shar: extracting init_all.c '(24401 characters)' cat << \SHAR_EOF > init_all.c /* * %W% (mrdch&amnnon) %G% */ # include "header" FILE * ttys[2]; planet * spntr = &pl[0]; /* the first planet to point to by * */ planet * apntr = &pl[33]; /* the first planet to point to by & */ planet * capitals[2]; info * info_head[2]; int iswiz[2]; /* * The following are flags to indicate that one of the players * wants to perform a specific action. If both flags are set, * action is taken. */ int wants_save[2]; int wants_quit[2]; int wants_restor[2]; int wants_newy[2]; int wants_pause[2]; int Pause = 0; /* 0 indicates no cup of coffee */ /* initial money sum for each player */ int teller[2] = { 100, 100 }; /* initial money given for feeding each player */ int food[2] = { 11, 11 }; /* money invested in trade */ int trade[2] = TWOZERO; /* the first year of the Galactical-Time */ int year = 0; int skip; int player; /* initialization of various arrays */ char *ocup_name[CLASES] = { "fighters", "citizens", "scientists", "builders", "miners", "slaves" }; int espcost[ESPTYP] = { MIN_ESP, POPUL_ESP, KNOW_ESP, METAL_ESP, FORCE_ESP, ALM_ESP, MSL_ESP }; char *inftypes[ESPTYP] = { "KIND", "POPUL", "KNOW", "METALS", "FORCES", "ALMs", "MISSL" }; jmp_buf jparse; init_disp () { /* find out who is the current player */ if (!player) curpln = spntr; else curpln = apntr; init_disc (); prteller (); } init_disc () { clear (); init_dis (); } init_dis () { int i; for (i = 0; i < MAXPL; i++) { draw_map (&pl[i]); } so (22, 0, "Command:"); } show_name () { FILE * namefile; char nwcm[200]; (void) sprintf (nwcm, "%sGname", ONLINE); namefile = fopen (nwcm, "r"); if (namefile == NULL) { say ("I think you have the wrong name, sir. Try \"help\"."); } while (fgets (nwcm, 200, namefile) != NULL) print ("%s\r", nwcm); (void) fclose (namefile); } struct todif { char ch; int r, c; }; struct todif moves[] = { { ' ', 0 ,6 }, { ' ', 13 ,48 }, { ' ', 0 ,75 }, { ' ', 1 ,63 }, { ' ', 13 ,32 }, { ' ', 2 ,9 }, { ' ', 7 ,60 }, { ' ', 12 ,72 }, { ' ', 8 ,10 }, { ' ', 1 ,8 }, { ' ', 8 ,20 }, { ' ', 2 ,21 }, { ' ', 7 ,57 }, { ' ', 2 ,31 }, { ' ', 11 ,29 }, { ' ', 1 ,48 }, { ' ', 11 ,31 }, { ' ', 2 ,24 }, { ' ', 11 ,49 }, { ' ', 2 ,49 }, { ' ', 3 ,49 }, { ' ', 12 ,35 }, { ' ', 2 ,57 }, { ' ', 12 ,70 }, { ' ', 3 ,75 }, { ' ', 4 ,16 }, { ' ', 0 ,55 }, { ' ', 4 ,30 }, { ' ', 5 ,62 }, { ' ', 0 ,69 }, { ' ', 5 ,67 }, { ' ', 6 ,30 }, { ' ', 12 ,31 }, { ' ', 6 ,61 }, { ' ', 2 ,67 }, { ' ', 7 ,3 }, { ' ', 4 ,57 }, { ' ', 5 ,9 }, { ' ', 7 ,23 }, { ' ', 8 ,29 }, { ' ', 5 ,24 }, { ' ', 8 ,43 }, { ' ', 1 ,17 }, { ' ', 1 ,43 }, { ' ', 8 ,50 }, { ' ', 5 ,50 }, { ' ', 8 ,68 }, { ' ', 1 ,29 }, { ' ', 8 ,75 }, { ' ', 9 ,19 }, { ' ', 9 ,47 }, { ' ', 10 ,10 }, { ' ', 1 ,21 }, { ' ', 10 ,70 }, { ' ', 12 ,55 }, { ' ', 11 ,62 }, { ' ', 0 ,20 }, { ' ', 12 ,8 }, { ' ', 11 ,11 }, { ' ', 13 ,6 }, /* end of sname 1-2 */ { ' ', 0 ,21 }, { ' ', 1 ,31 }, { ' ', 2 ,29 }, { ' ', 3 ,67 }, { ' ', 6 ,67 }, { ' ', 7 ,30 }, { ' ', 13 ,31 }, { ' ', 0 ,7 }, { ' ', 13 ,35 }, { ' ', 7 ,49 }, { ' ', 13 ,62 }, { ' ', 7 ,56 }, { ' ', 0 ,57 }, { ' ', 7 ,50 }, { ' ', 0 ,68 }, { ' ', 1 ,6 }, { ' ', 12 ,16 }, { ' ', 1 ,45 }, { ' ', 12 ,24 }, { ' ', 1 ,18 }, { ' ', 7 ,59 }, { ' ', 8 ,22 }, { ' ', 3 ,22 }, { ' ', 2 ,55 }, { ' ', 7 ,69 }, { ' ', 8 ,42 }, { ' ', 7 ,75 }, { ' ', 8 ,18 }, { ' ', 2 ,68 }, { ' ', 3 ,3 }, { ' ', 9 ,42 }, { ' ', 10 ,31 }, { ' ', 11 ,42 }, { ' ', 8 ,19 }, { ' ', 11 ,63 }, { ' ', 8 ,56 }, { ' ', 9 ,3 }, { ' ', 5 ,22 }, { ' ', 9 ,44 }, { ' ', 10 ,22 }, { ' ', 5 ,30 }, { ' ', 9 ,7 }, { ' ', 3 ,10 }, { ' ', 11 ,70 }, { ' ', 5 ,49 }, { ' ', 11 ,71 }, { ' ', 3 ,63 }, { ' ', 9 ,10 }, { ' ', 12 ,7 }, { ' ', 1 ,46 }, { ' ', 2 ,8 }, { ' ', 12 ,30 }, { ' ', 2 ,22 }, { ' ', 12 ,33 }, { ' ', 4 ,42 }, { ' ', 9 ,63 }, { ' ', 4 ,56 }, { ' ', 6 ,60 }, { ' ', 3 ,29 }, { ' ', 9 ,31 }, { ' ', 13 ,7 }, { ' ', 9 ,70 }, { ' ', 13 ,72 }, /* end of sname 2-3 */ { ' ', 0 ,46 }, { ' ', 1 ,30 }, { ' ', 3 ,68 }, { ' ', 9 ,11 }, { ' ', 9 ,29 }, { ' ', 3 ,69 }, { ' ', 4 ,68 }, { ' ', 9 ,16 }, { ' ', 5 ,56 }, { ' ', 13 ,55 }, { ' ', 7 ,48 }, { ' ', 8 ,7 }, { ' ', 7 ,61 }, { ' ', 9 ,17 }, { ' ', 5 ,48 }, { ' ', 9 ,9 }, { ' ', 5 ,55 }, { ' ', 9 ,30 }, { ' ', 2 ,16 }, { ' ', 2 ,75 }, { ' ', 3 ,11 }, { ' ', 13 ,63 }, { ' ', 6 ,68 }, { ' ', 13 ,70 }, { ' ', 7 ,29 }, { ' ', 9 ,43 }, { ' ', 10 ,62 }, { '@', 0 ,64 }, { ' ', 9 ,46 }, { ' ', 0 ,67 }, { ' ', 1 ,7 }, { ' ', 10 ,71 }, { ' ', 11 ,9 }, { ' ', 9 ,22 }, { ' ', 1 ,10 }, { ' ', 9 ,24 }, { ' ', 5 ,11 }, { ' ', 12 ,10 }, { ' ', 5 ,29 }, { '*', 12 ,16 }, { ' ', 9 ,49 }, { ' ', 10 ,50 }, { ' ', 9 ,55 }, { '@', 10 ,56 }, { ' ', 12 ,32 }, { ' ', 1 ,68 }, { ' ', 12 ,36 }, { ' ', 3 ,23 }, { ' ', 3 ,57 }, { ' ', 12 ,49 }, { ' ', 3 ,31 }, { ' ', 12 ,50 }, { ' ', 3 ,48 }, { ' ', 13 ,22 }, { ' ', 8 ,16 }, { ' ', 13 ,29 }, { ' ', 8 ,63 }, { ' ', 11 ,22 }, { ' ', 11 ,23 }, { ' ', 8 ,69 }, { ' ', 11 ,61 }, { ' ', 9 ,6 }, { ' ', 13 ,37 }, /* end of sname 3-4 */ { ' ', 0 ,5 }, { ' ', 1 ,20 }, { ' ', 0 ,8 }, { ' ', 2 ,11 }, { '@', 7 ,69 }, { ' ', 8 ,3 }, { '@', 7 ,75 }, { ' ', 3 ,30 }, { ' ', 4 ,9 }, { '#', 3 ,31 }, { ' ', 4 ,11 }, { ' ', 12 ,22 }, { ' ', 4 ,22 }, { ' ', 12 ,23 }, { ' ', 4 ,23 }, { ' ', 0 ,9 }, { ' ', 1 ,19 }, { '*', 12 ,24 }, { ' ', 1 ,22 }, { ' ', 12 ,29 }, { ' ', 1 ,44 }, { '*', 8 ,4 }, { ' ', 1 ,56 }, { ' ', 8 ,6 }, { '#', 2 ,46 }, { ' ', 1 ,67 }, { ' ', 2 ,47 }, { ' ', 1 ,75 }, { ' ', 2 ,3 }, { '*', 2 ,6 }, { ' ', 12 ,34 }, { ' ', 2 ,48 }, { '#', 2 ,49 }, { ' ', 12 ,37 }, { ' ', 2 ,50 }, { ' ', 12 ,48 }, { ' ', 1 ,69 }, { ' ', 12 ,61 }, { '@', 1 ,73 }, { ' ', 12 ,63 }, { '*', 2 ,12 }, { ' ', 12 ,71 }, { ' ', 2 ,30 }, { ' ', 7 ,67 }, { '@', 12 ,72 }, { ' ', 7 ,68 }, { ' ', 13 ,9 }, { ' ', 4 ,31 }, { ' ', 13 ,16 }, { ' ', 4 ,69 }, { ' ', 5 ,3 }, { ' ', 4 ,75 }, { ' ', 5 ,10 }, { '#', 0 ,32 }, { ' ', 2 ,56 }, { '#', 0 ,43 }, { ' ', 2 ,63 }, { '*', 3 ,5 }, { '#', 5 ,29 }, { ' ', 3 ,16 }, { ' ', 5 ,68 }, { '@', 2 ,66 }, { ' ', 2 ,69 }, { ' ', 5 ,69 }, { ' ', 0 ,31 }, { '*', 3 ,17 }, { ' ', 0 ,44 }, { '@', 5 ,74 }, { ' ', 5 ,75 }, { ' ', 10 ,49 }, { ' ', 4 ,24 }, { '*', 4 ,25 }, { ' ', 10 ,55 }, { ' ', 4 ,29 }, { ' ', 10 ,56 }, { ' ', 4 ,49 }, { ' ', 6 ,16 }, { '@', 4 ,54 }, { ' ', 10 ,61 }, { '@', 4 ,68 }, { '#', 0 ,46 }, { ' ', 4 ,63 }, { ' ', 0 ,47 }, { '@', 10 ,62 }, { ' ', 0 ,48 }, { '*', 6 ,11 }, { ' ', 4 ,67 }, { ' ', 6 ,22 }, { ' ', 10 ,63 }, { ' ', 6 ,3 }, { '@', 10 ,70 }, { '*', 6 ,4 }, { ' ', 6 ,23 }, { ' ', 8 ,8 }, { ' ', 5 ,31 }, { '#', 5 ,33 }, { '*', 8 ,10 }, { ' ', 8 ,17 }, { ' ', 6 ,24 }, { '#', 6 ,32 }, { '#', 6 ,41 }, { ' ', 0 ,30 }, { ' ', 1 ,4 }, { '@', 0 ,67 }, { ' ', 1 ,5 }, { ' ', 6 ,42 }, { '*', 1 ,10 }, { ' ', 6 ,48 }, { ' ', 5 ,57 }, { ' ', 6 ,49 }, { '@', 5 ,62 }, { ' ', 8 ,9 }, { '@', 5 ,66 }, { '@', 6 ,55 }, { ' ', 6 ,57 }, { '#', 0 ,49 }, { ' ', 6 ,59 }, { ' ', 0 ,56 }, { '#', 14 ,51 }, { '@', 0 ,62 }, { ' ', 6 ,56 }, { ' ', 0 ,64 }, { ' ', 6 ,62 }, { ' ', 0 ,63 }, { '@', 6 ,67 }, { '@', 14 ,61 }, { ' ', 6 ,69 }, { '@', 14 ,69 }, { ' ', 6 ,75 }, { '*', 7 ,17 }, { ' ', 13 ,42 }, { ' ', 6 ,31 }, { ' ', 13 ,50 }, { '*', 5 ,13 }, { ' ', 7 ,16 }, { ' ', 5 ,16 }, { '@', 13 ,60 }, { '*', 5 ,18 }, { '*', 5 ,22 }, { ' ', 13 ,61 }, { ' ', 6 ,29 }, { ' ', 13 ,71 }, { '*', 7 ,21 }, { '*', 6 ,25 }, { ' ', 7 ,22 }, { ' ', 8 ,24 }, { '*', 7 ,23 }, { '*', 8 ,25 }, { ' ', 9 ,23 }, { '#', 9 ,44 }, { ' ', 3 ,42 }, { ' ', 9 ,48 }, { '@', 3 ,74 }, { ' ', 4 ,3 }, { '*', 10 ,17 }, { '@', 10 ,74 }, { ' ', 11 ,3 }, { '@', 9 ,54 }, { '*', 4 ,8 }, { '@', 9 ,60 }, { ' ', 3 ,55 }, { '@', 3 ,62 }, { ' ', 9 ,61 }, { '@', 3 ,68 }, { ' ', 9 ,74 }, { ' ', 10 ,3 }, { '@', 8 ,67 }, { ' ', 10 ,9 }, { ' ', 8 ,70 }, { ' ', 7 ,31 }, { ' ', 8 ,55 }, { '@', 7 ,60 }, { '*', 8 ,7 }, { ' ', 7 ,62 }, { ' ', 8 ,23 }, { '*', 10 ,10 }, { ' ', 8 ,31 }, { ' ', 10 ,11 }, { '#', 8 ,32 }, { ' ', 10 ,16 }, { '*', 11 ,5 }, { ' ', 12 ,9 }, { '*', 11 ,25 }, { ' ', 12 ,16 }, { '@', 9 ,68 }, { ' ', 13 ,30 }, { ' ', 9 ,69 }, { ' ', 13 ,34 }, { ' ', 9 ,71 }, { ' ', 13 ,36 }, { '*', 14 ,10 }, { ' ', 10 ,29 }, { ' ', 11 ,30 }, { '*', 14 ,18 }, { '#', 11 ,41 }, { ' ', 12 ,4 }, { ' ', 10 ,30 }, { '#', 10 ,31 }, { ' ', 12 ,5 }, { '#', 14 ,30 }, { '#', 14 ,37 }, { ' ', 11 ,10 }, { '#', 7 ,47 }, { '*', 11 ,15 }, { ' ', 7 ,58 }, { ' ', 8 ,45 }, { '#', 14 ,35 }, { ' ', 8 ,46 }, { '@', 11 ,54 }, { ' ', 11 ,72 }, { ' ', 8 ,48 }, { ' ', 11 ,16 }, { ' ', 10 ,42 }, { '#', 14 ,42 }, { ' ', 10 ,72 }, /* end of sname 4-5 */ { ' ', 6 ,58 }, { ' ', 0 ,19 }, { '@', 6 ,61 }, { ' ', 0 ,22 }, { ' ', 1 ,49 }, { ' ', 2 ,6 }, { ' ', 1 ,73 }, { ' ', 2 ,10 }, { ' ', 3 ,17 }, { ' ', 12 ,24 }, { ' ', 3 ,50 }, { ' ', 12 ,42 }, { '*', 13 ,7 }, { ' ', 2 ,42 }, { '*', 7 ,4 }, { '@', 2 ,54 }, { '@', 6 ,66 }, { '@', 2 ,65 }, { ' ', 7 ,17 }, { ' ', 2 ,66 }, { ' ', 3 ,5 }, { '*', 3 ,7 }, { ' ', 13 ,8 }, { ' ', 1 ,55 }, { ' ', 1 ,57 }, { ' ', 6 ,67 }, { '*', 7 ,12 }, { '@', 1 ,71 }, { ' ', 13 ,23 }, { ' ', 3 ,56 }, { ' ', 3 ,62 }, { '*', 5 ,26 }, { '@', 3 ,67 }, { ' ', 5 ,42 }, { ' ', 5 ,62 }, { '@', 12 ,54 }, { ' ', 3 ,68 }, { '*', 4 ,9 }, { ' ', 4 ,10 }, { ' ', 12 ,62 }, { ' ', 2 ,23 }, { ' ', 3 ,9 }, { ' ', 12 ,72 }, { '*', 2 ,14 }, { ' ', 13 ,5 }, { '@', 5 ,65 }, { ' ', 2 ,12 }, { '@', 5 ,73 }, { ' ', 6 ,4 }, { ' ', 5 ,74 }, { '*', 6 ,19 }, { ' ', 5 ,66 }, { ' ', 0 ,32 }, { '@', 5 ,69 }, { '#', 0 ,33 }, { '*', 10 ,18 }, { '@', 3 ,73 }, { ' ', 6 ,11 }, { ' ', 3 ,74 }, { '*', 4 ,5 }, { ' ', 10 ,23 }, { ' ', 4 ,8 }, { '*', 9 ,4 }, { ' ', 3 ,24 }, { ' ', 9 ,8 }, { ' ', 9 ,18 }, { ' ', 10 ,24 }, { ' ', 7 ,21 }, { ' ', 10 ,48 }, { ' ', 7 ,23 }, { '*', 3 ,19 }, { '*', 9 ,11 }, { '*', 3 ,26 }, { '@', 10 ,53 }, { ' ', 4 ,55 }, { '*', 11 ,14 }, { '@', 4 ,60 }, { ' ', 11 ,15 }, { ' ', 4 ,68 }, { ' ', 5 ,18 }, { '@', 10 ,68 }, { '@', 7 ,53 }, { '*', 5 ,14 }, { ' ', 7 ,60 }, { '*', 8 ,8 }, { ' ', 10 ,70 }, { '#', 0 ,41 }, { ' ', 5 ,13 }, { ' ', 0 ,43 }, { '@', 8 ,74 }, { ' ', 9 ,21 }, { ' ', 0 ,46 }, { ' ', 8 ,25 }, { '*', 8 ,26 }, { '@', 0 ,60 }, { '@', 8 ,69 }, { ' ', 0 ,62 }, { '*', 6 ,23 }, { ' ', 6 ,55 }, { ' ', 7 ,24 }, { ' ', 6 ,25 }, { ' ', 7 ,42 }, { ' ', 8 ,10 }, { ' ', 8 ,44 }, { ' ', 6 ,50 }, { ' ', 8 ,49 }, { ' ', 11 ,25 }, { ' ', 7 ,69 }, { ' ', 8 ,4 }, { ' ', 7 ,75 }, { ' ', 8 ,7 }, { '*', 11 ,26 }, { ' ', 8 ,30 }, { ' ', 11 ,50 }, { ' ', 8 ,56 }, { '@', 8 ,59 }, { '@', 0 ,65 }, { ' ', 8 ,61 }, { ' ', 0 ,67 }, { ' ', 1 ,9 }, { ' ', 11 ,55 }, { ' ', 8 ,11 }, { '@', 11 ,61 }, { '*', 8 ,23 }, { '@', 11 ,73 }, { ' ', 13 ,24 }, { '*', 8 ,18 }, { '*', 13 ,25 }, { ' ', 1 ,10 }, { '*', 14 ,12 }, { '*', 8 ,12 }, { ' ', 14 ,69 }, { '@', 15 ,62 }, { ' ', 4 ,25 }, { '@', 15 ,68 }, { ' ', 4 ,50 }, { '*', 1 ,11 }, { '@', 8 ,66 }, { ' ', 1 ,47 }, { ' ', 8 ,67 }, { ' ', 9 ,45 }, { ' ', 11 ,24 }, { ' ', 9 ,50 }, { ' ', 11 ,54 }, { ' ', 13 ,33 }, { ' ', 9 ,54 }, { ' ', 13 ,49 }, { '@', 9 ,58 }, { ' ', 10 ,17 }, { ' ', 14 ,18 }, { '@', 4 ,53 }, { '*', 14 ,19 }, { ' ', 4 ,54 }, { ' ', 5 ,22 }, { '', 14 ,59 }, { ' ', 5 ,23 }, { ' ', 14 ,61 }, { ' ', 10 ,74 }, { ' ', 11 ,5 }, { '*', 11 ,22 }, { ' ', 13 ,60 }, { ' ', 9 ,62 }, { ' ', 9 ,68 }, { ' ', 10 ,10 }, { '@', 13 ,71 }, { '@', 9 ,67 }, { ' ', 14 ,10 }, /* end of sname 5-6 */ { '@', 0 ,63 }, { ' ', 0 ,65 }, { ' ', 1 ,11 }, { '#', 5 ,31 }, { '*', 1 ,12 }, { ' ', 2 ,49 }, { ' ', 5 ,33 }, { '@', 2 ,63 }, { ' ', 2 ,65 }, { ' ', 4 ,5 }, { ' ', 2 ,54 }, { ' ', 4 ,9 }, { ' ', 7 ,47 }, { ' ', 5 ,26 }, { '#', 7 ,40 }, { '*', 5 ,27 }, { '@', 7 ,51 }, { ' ', 5 ,29 }, { ' ', 7 ,53 }, { '#', 5 ,49 }, { ' ', 15 ,68 }, { '@', 7 ,60 }, { '@', 5 ,58 }, { '@', 7 ,65 }, { '*', 4 ,21 }, { ' ', 4 ,48 }, { '*', 5 ,16 }, { '@', 4 ,52 }, { '#', 5 ,35 }, { '@', 15 ,67 }, { ' ', 5 ,69 }, { ' ', 6 ,19 }, { ' ', 6 ,23 }, { ' ', 4 ,53 }, { ' ', 4 ,60 }, { '*', 5 ,6 }, { '@', 4 ,67 }, { '*', 5 ,10 }, { ' ', 5 ,14 }, { ' ', 6 ,41 }, { '@', 1 ,69 }, { ' ', 3 ,19 }, { ' ', 6 ,32 }, { ' ', 3 ,26 }, { ' ', 1 ,71 }, { '*', 3 ,27 }, { ' ', 2 ,14 }, { '*', 2 ,16 }, { '@', 6 ,70 }, { ' ', 7 ,4 }, { ' ', 3 ,7 }, { '*', 3 ,8 }, { '*', 7 ,5 }, { ' ', 3 ,31 }, { '*', 7 ,14 }, { ' ', 8 ,12 }, { ' ', 7 ,12 }, { '*', 8 ,13 }, { '#', 15 ,44 }, { '#', 3 ,33 }, { ' ', 15 ,62 }, { '*', 9 ,13 }, { '*', 15 ,14 }, { '#', 9 ,47 }, { '*', 15 ,21 }, { '@', 9 ,56 }, { ' ', 9 ,58 }, { '#', 3 ,47 }, { ' ', 9 ,44 }, { ' ', 3 ,73 }, { '#', 16 ,35 }, { '#', 2 ,44 }, { ' ', 6 ,61 }, { ' ', 2 ,46 }, { ' ', 6 ,66 }, { '#', 16 ,51 }, { ' ', 8 ,23 }, { ' ', 0 ,33 }, { ' ', 8 ,26 }, { '#', 0 ,35 }, { ' ', 14 ,59 }, { '#', 0 ,40 }, { '#', 15 ,29 }, { ' ', 0 ,41 }, { ' ', 14 ,35 }, { ' ', 14 ,37 }, { '*', 8 ,28 }, { ' ', 0 ,49 }, { ' ', 14 ,30 }, { '#', 8 ,46 }, { '#', 0 ,51 }, { ' ', 8 ,47 }, { '*', 10 ,23 }, { ' ', 11 ,22 }, { ' ', 10 ,31 }, { ' ', 11 ,26 }, { '@', 0 ,58 }, { ' ', 9 ,11 }, { ' ', 0 ,60 }, { '@', 3 ,53 }, { '@', 11 ,52 }, { '*', 7 ,20 }, { '*', 7 ,24 }, { ' ', 8 ,8 }, { '#', 7 ,33 }, { '*', 8 ,10 }, { '@', 11 ,59 }, { ' ', 11 ,61 }, { ' ', 12 ,6 }, { '@', 11 ,66 }, { '*', 12 ,21 }, { ' ', 3 ,67 }, { ' ', 14 ,51 }, { '@', 3 ,71 }, { '@', 14 ,57 }, { '#', 15 ,39 }, { '@', 9 ,65 }, { ' ', 9 ,67 }, { '*', 10 ,5 }, { '*', 11 ,28 }, { ' ', 12 ,54 }, { '#', 11 ,33 }, { ' ', 13 ,25 }, { ' ', 14 ,19 }, { '@', 8 ,65 }, { '#', 10 ,43 }, { '*', 13 ,26 }, { ' ', 10 ,53 }, { '@', 13 ,53 }, { '*', 14 ,10 }, { ' ', 10 ,68 }, { ' ', 14 ,12 }, { '@', 10 ,69 }, { '*', 11 ,13 }, { ' ', 8 ,66 }, { ' ', 11 ,14 }, { ' ', 8 ,69 }, { ' ', 9 ,4 }, { '@', 16 ,62 }, { ' ', 14 ,42 }, /* end of sname 6-7 */ { ' ', 2 ,16 }, { '*', 5 ,7 }, { '*', 15 ,16 }, { '#', 3 ,34 }, { ' ', 5 ,10 }, { ' ', 11 ,33 }, { '*', 5 ,29 }, { ' ', 11 ,41 }, { ' ', 5 ,31 }, { ' ', 10 ,69 }, { '#', 5 ,33 }, { '*', 11 ,6 }, { '*', 5 ,22 }, { '*', 11 ,23 }, { ' ', 5 ,27 }, { ' ', 11 ,28 }, { '@', 5 ,57 }, { '*', 11 ,29 }, { ' ', 5 ,58 }, { '*', 13 ,27 }, { ' ', 14 ,10 }, { '#', 2 ,42 }, { ' ', 5 ,49 }, { '#', 10 ,46 }, { '@', 5 ,51 }, { ' ', 2 ,44 }, { '*', 5 ,11 }, { ' ', 5 ,16 }, { ' ', 2 ,63 }, { ' ', 3 ,8 }, { '*', 3 ,9 }, { ' ', 15 ,21 }, { '*', 3 ,17 }, { '*', 15 ,23 }, { ' ', 3 ,33 }, { '*', 14 ,12 }, { ' ', 5 ,35 }, { ' ', 14 ,57 }, { '#', 3 ,45 }, { ' ', 15 ,14 }, { ' ', 3 ,47 }, { '@', 3 ,62 }, { ' ', 4 ,21 }, { ' ', 10 ,23 }, { ' ', 4 ,52 }, { '#', 10 ,33 }, { ' ', 4 ,67 }, { ' ', 5 ,6 }, { ' ', 15 ,29 }, { ' ', 5 ,65 }, { '@', 5 ,67 }, { '*', 6 ,17 }, { '@', 6 ,63 }, { ' ', 7 ,5 }, { ' ', 6 ,70 }, { ' ', 7 ,40 }, { '*', 8 ,25 }, { '#', 10 ,41 }, { '#', 8 ,35 }, { ' ', 10 ,43 }, { ' ', 0 ,58 }, { ' ', 11 ,48 }, { '#', 5 ,37 }, { '#', 5 ,47 }, { '@', 11 ,51 }, { '@', 0 ,62 }, { ' ', 1 ,12 }, { ' ', 0 ,63 }, { '*', 1 ,13 }, { ' ', 12 ,21 }, { ' ', 7 ,65 }, { '@', 7 ,70 }, { '*', 8 ,14 }, { '#', 12 ,47 }, { ' ', 13 ,7 }, { '@', 12 ,64 }, { '*', 8 ,6 }, { '*', 13 ,9 }, { ' ', 8 ,13 }, { '@', 1 ,57 }, { ' ', 13 ,26 }, { ' ', 15 ,39 }, { ' ', 7 ,24 }, { ' ', 7 ,33 }, { ' ', 15 ,44 }, { '#', 12 ,34 }, { ' ', 8 ,32 }, { '#', 12 ,41 }, { '@', 7 ,64 }, { '@', 15 ,57 }, { ' ', 7 ,51 }, { '#', 16 ,29 }, { '@', 1 ,68 }, { '#', 16 ,40 }, { ' ', 1 ,69 }, { '#', 8 ,40 }, { ' ', 7 ,14 }, { ' ', 8 ,46 }, { ' ', 9 ,47 }, { '@', 11 ,58 }, { ' ', 8 ,28 }, { '*', 8 ,30 }, { ' ', 11 ,59 }, { ' ', 9 ,56 }, { ' ', 9 ,65 }, { ' ', 10 ,5 }, { ' ', 11 ,52 }, { '@', 8 ,50 }, { '@', 8 ,55 }, { ' ', 9 ,13 }, { '*', 9 ,14 }, { ' ', 11 ,66 }, { '*', 7 ,15 }, { '@', 9 ,64 }, { '#', 8 ,45 }, { '@', 11 ,68 }, { '*', 12 ,19 }, { '#', 16 ,45 }, /* end of sname 7-8 */ { ' ', 2 ,42 }, { '*', 5 ,13 }, { '@', 1 ,67 }, { ' ', 1 ,68 }, { '#', 5 ,40 }, { '#', 5 ,45 }, { ' ', 12 ,47 }, { '#', 11 ,35 }, { '#', 11 ,40 }, { ' ', 12 ,64 }, { '*', 13 ,18 }, { ' ', 5 ,47 }, { ' ', 6 ,63 }, { ' ', 7 ,15 }, { ' ', 5 ,22 }, { ' ', 5 ,33 }, { '*', 7 ,16 }, { ' ', 7 ,70 }, { ' ', 8 ,14 }, { ' ', 12 ,34 }, { '*', 5 ,23 }, { ' ', 12 ,41 }, { '*', 8 ,15 }, { '@', 6 ,62 }, { ' ', 8 ,25 }, { '*', 3 ,18 }, { ' ', 8 ,55 }, { '@', 8 ,70 }, { ' ', 9 ,14 }, { '*', 9 ,16 }, { ' ', 10 ,33 }, { ' ', 10 ,41 }, { ' ', 11 ,6 }, { ' ', 10 ,46 }, { '*', 11 ,7 }, { '#', 13 ,40 }, { ' ', 6 ,17 }, { '#', 13 ,45 }, { '*', 6 ,18 }, { '@', 13 ,62 }, { ' ', 14 ,12 }, { '*', 15 ,13 }, { '#', 11 ,45 }, { ' ', 15 ,16 }, { '@', 11 ,57 }, { ' ', 3 ,17 }, { ' ', 11 ,58 }, { '#', 3 ,40 }, { ' ', 5 ,11 }, { '@', 11 ,67 }, { ' ', 3 ,34 }, { '*', 8 ,26 }, { '#', 3 ,35 }, { '@', 8 ,54 }, { ' ', 11 ,68 }, { '#', 5 ,35 }, { ' ', 12 ,19 }, { ' ', 5 ,37 }, { '#', 13 ,35 }, { '*', 16 ,18 }, { ' ', 23 , 0 }, { '\0',0,0} }; prologue() { struct todif *tomoves = moves; while ( (tomoves->ch != '\0' )) { term0 () ; pos(tomoves->r,tomoves->c) ; xputchar(tomoves->ch) ; fflush (tty) ; term1 () ; pos(tomoves->r,tomoves->c) ; xputchar(tomoves->ch) ; fflush (tty) ; tomoves++ ; } } SHAR_EOF if test 24401 -ne "`wc -c init_all.c`" then echo shar: error transmitting init_all.c '(should have been 24401 characters)' fi echo shar: extracting kill_alm.c '(1629 characters)' cat << \SHAR_EOF > kill_alm.c /* * %W% (mrdch&amnnon) %G% */ # include "header" killalm (s) char *s; { planet * pp; int i, j, nalms; pp = getpl (s); /* get planet id */ skipwhite (s); /* go to the no. of alms */ nalms = atoi (s); /* see how many he wants to kill */ if (nalms <= 0) { say ("But sir, this will not change much !!"); return; } skipword (s); /* jump over that no. */ assert_end (s); /* see if it ending nicely */ if (pp -> whos == player) { j = nalms * REMOVE_COST; assert_money (j); /* see if he has that much */ j = (nalms > pp -> alms) ? pp -> alms : nalms; teller[player] -= j * REMOVE_COST;/* take min. */ pp -> alms -= j; if (pp -> alms < 0) pp -> alms = 0; if (pp -> alms) { say ("The planet is not yet clean, sir!!"); return; } else { say ("It is perfectly safe now, sir."); return; } } else { /* remove from the enemy teritory */ for (i = 0; i < 10; i++) if (pp -> gate[i] -> whos == player) break; if (i == 10) { say ("But sir, we don't have access to that planet!!"); return; } i = nalms * ALM_KILL_COST; assert_money (i); /* see if he has that much */ teller[player] -= i; /* take money IN ANY CASE !! */ pp -> alms -= nalms; if (pp -> alms < 0) pp -> alms = 0; } } SHAR_EOF if test 1629 -ne "`wc -c kill_alm.c`" then echo shar: error transmitting kill_alm.c '(should have been 1629 characters)' fi echo shar: extracting leave_at.c '(1881 characters)' cat << \SHAR_EOF > leave_at.c /* * %W% (mrdch&amnnon) %G% */ # include "header" leaveat (s) char *s; { planet * pp; int i = 0, spl; char cc; pp = getpl (s); /* get planet id. */ assert_player (pp); /* see if legal + owner */ skipwhite (s); /* in case of knowledge, no parameter needed */ if (*s == 'k' || (*s == 'K')) { if (pp -> inventar.know > pp -> to_take.know) { say ("But sir !!! Why destroy the hard acquired knowledge??"); return ; } pp -> inventar.know = pp -> to_take.know; if (*s == 'K') /* clear moving knowledge */ pp -> to_take.know = 0; say ("%c-type knowledge was left, sir !!!", 'A' + pp -> inventar.know); return; } i = atoi (s); /* in any other case- numeric parameter needed */ assert_number (i); /* chek if legal no. */ skipword (s); cc = *s++; /* take item he wants to leave on planet */ assert_end (s); /* does he end gracefully?? */ if (cc == 't') { if (pp -> to_take.metals < i) { say ("But you don't have that much metal there !!"); return; } /* perform metal transfer */ pp -> to_take.metals -= i; pp -> inventar.metals += i; say ("%d A-type material was transferred, sir !!", i); return; } spl = which_class (cc); assert_occup (spl); /* does it exist?? */ if (pp -> to_take.popul[spl] < i) { say ("But sir, you don't have that many %s there!!!", ocup_name[spl]); return; } /* perform human transfer */ pp -> to_take.popul[spl] -= i; pp -> inventar.popul[spl] += i; say ("%d %s were left on planet, sir.", i, ocup_name[spl]); return; } SHAR_EOF if test 1881 -ne "`wc -c leave_at.c`" then echo shar: error transmitting leave_at.c '(should have been 1881 characters)' fi # End of shell archive exit 0 -- Erik Bailey -- 7 Oak Knoll (USENET courtesy of ihnp4!think!ejb Arlington, MA 02174 Thinking Machines Corp. ejb@think.com (617) 643-0732 Cambridge, MA) It takes thought to make a program that thinks. But it takes work to make a program that works.