All pastes #597152 Raw Edit

Anonymous

public text v1 · immutable
#597152 ·published 2007-06-30 12:57 UTC
rendered paste body
void getiing_started(int player)
{
	int i, check =0;
	int cell=0;
	for (i=1; i <= NUM_SUB; i++) {
		do {
			printf("\nplayer %d, please enter the leftmost cell of submarine number %d\n", player, i);
			scanf("%d", &cell);
			check = inputSub(player,cell,i);
			if (check == 0) {
				printf("\nError: submarine will overlap another submarine, please try again...\n");
				continue;
			}
			if (check == 2) {
				printf("\nError: Iligal cordinate for submarine, please try again...\n");
				continue;
			}
		} while (check != 1);
		
        subs[player][i-1] = cell;
	}
}