Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- //Done by IGN:FwostyMage
- int printspawn (int wave) {
- if (wave >= 31) { printf("360 "); return wave-31; }
- if (wave >= 15) { printf("180 "); return wave-15; }
- if (wave >= 7) { printf("90 "); return wave-7; }
- if (wave >= 3) { printf("45 "); return wave-3; }
- printf("22 ");
- return wave-1;
- }
- void getspawn (int loc) {
- int spawnarr[15] = {3, 5, 2, 1, 5, 3, 4, 1, 2, 3, 5, 4, 1, 2, 4};
- int sval = spawnarr[loc];
- if (sval == 1) printf("NW, ");
- if (sval == 2) printf("C, ");
- if (sval == 3) printf("SE, ");
- if (sval == 4) printf("S, ");
- if (sval == 5) printf("SW, ");
- return;
- }
- void jadspawn (int start) {
- int i=1;
- printf("JAD ");
- getspawn(start);
- printf("Healers: ");
- while (i<5) {
- getspawn((start+i)%15);
- i++;
- }
- printf("\n");
- return;
- }
- void printwave (int start, int wave) {
- int i = 0;
- int curwave = wave;
- printf("Wave %d: ", wave);
- if (curwave == 63) {
- jadspawn((start)%15);
- return;
- }
- while (curwave > 0) {
- curwave = printspawn(curwave);
- getspawn((start+i)%15);
- i++;
- }
- printf("\n");
- return;
- }
- int spawn2int(char spn[3]) {
- if (strcmp(spn,"NW")==0) return 1;
- if (strcmp(spn,"N")==0) return 1;
- if (strcmp(spn,"C")==0) return 2;
- if (strcmp(spn,"SE")==0) return 3;
- if (strcmp(spn,"E")==0) return 3;
- if (strcmp(spn,"S")==0) return 4;
- if (strcmp(spn,"SW")==0) return 5;
- if (strcmp(spn,"W")==0) return 5;
- printf("Return a valid format please! \n");
- return -1;
- }
- /*
- int spawnarr2start (int spawnarr[4]) {
- int spawns[15] = {3, 5, 2, 1, 5, 3, 4, 1, 2, 3, 5, 4, 1, 2, 4};
- int i = 0, j, k;
- while (i < 15) {
- j = 0, k = 0;
- while ((j < 4) && (k == 0)) {
- if (spawns[(i+j)%15] != spawnarr[j]) k=1;
- j++;
- }
- if (k == 0) return i;
- i++;
- }
- printf("Spawns aren't accurate! \n");
- return -1;
- }
- */
- int getstart () {
- char s1[3];
- int c1=-1;
- int* c2 = malloc(sizeof(int));
- *c2=-1;
- printf("Enter center as C, south as S, \n");
- printf("northwest as NW or N, southwest as SW or W, \n");
- printf("and southeast as SE or E. First 22 spawn?");
- scanf("%s",s1);
- c1=spawn2int(s1);
- switch (c1) {
- case 1 : //nw
- printf("Where did the next 22s spawn? \n");
- printf("If SW and SE, type 1 \n");
- printf("If C and SE, type 2 \n");
- printf("If C and S, type 3");
- scanf("%d",c2);
- switch(*c2) {
- case 1:
- return 3;
- break;
- case 2:
- return 7;
- break;
- case 3:
- return 12;
- break;
- default :
- return -1;
- }
- case 2 : //center
- printf("Where did the next 22s spawn? \n");
- printf("If NW and SW, type 1 \n");
- printf("If SE and SW, type 2 \n");
- printf("If S and SE, type 3");
- scanf("%d",c2);
- switch(*c2) {
- case 1:
- return 2;
- break;
- case 2:
- return 8;
- break;
- case 3:
- return 13;
- break;
- default :
- return -1;
- }
- case 3 : //se
- printf("Where did the next 22s spawn? \n");
- printf("If SW and C, type 1 \n");
- printf("If S and NW, type 2 \n");
- printf("If SW and S, type 3");
- scanf("%d",c2);
- switch(*c2) {
- case 1:
- return 0;
- break;
- case 2:
- return 5;
- break;
- case 3:
- return 9;
- break;
- default :
- return -1;
- }
- case 4 : //south
- printf("Where did the next 22s spawn? \n");
- printf("If SE and SW, type 1 \n");
- printf("If NW and C, type 2");
- scanf("%d",c2);
- switch(*c2) {
- case 1:
- return 14;
- break;
- case 2:
- *c2=-1;
- printf("The first 45 should spawn center. \n");
- printf("Type 1 if the second 45 spawned SE and 2 if it spawned S.");
- scanf("%d",c2);
- switch(*c2) {
- case 1 :
- return 6;
- case 2 :
- return 11;
- default :
- return -1;
- }
- break;
- default :
- return -1;
- }
- case 5 : //sw
- printf("Where did the next 22s spawn? \n");
- printf("If C and NW, type 1 \n");
- printf("If SE and S, type 2 \n");
- printf("If S and NW, type 3");
- scanf("%d",c2);
- switch(*c2) {
- case 1:
- return 1;
- break;
- case 2:
- return 4;
- break;
- case 3:
- return 10;
- break;
- default :
- return -1;
- }
- default :
- return -1;
- }
- }
- int main () {
- int wave = 4, start = -1;
- char s1[3];
- int i=0,j;
- start=getstart();
- printf("\n");
- if (start == -1) { return -1; }
- if ((start!=6)&&(start!=11)) { printwave(start+2,3); }
- start=start+3;
- getchar();
- while (i < 6) {
- j=0;
- while (j < 10) {
- printwave(start,wave);
- wave++;
- start++;
- j++;
- }
- if (i==5) return 0;
- printf("Press ENTER to print more waves.\n");
- getchar();
- i++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement