/* ==================================== *\
 *	File      : SlagSkib.c               *
 *	Påbegyndt : 06.03.01 Henning Karlby  *
 *	Færdig    :                          *
 *	Ændret    :                          *
\* ==================================== */

/* ---- INCLUDES ------- */
#include <stdio.h>
#include <conio.h>
#define Height 5
#define Width 10

void main(void)
	{
		char fjende [Height] [Width] =
			{  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
				{ 0, 1, 1, 1, 1, 0, 0, 1, 0, 1 },
				{ 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 },
				{ 1, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
				{ 1, 0, 1, 1, 1, 0, 0, 0, 0, 0 }
			};
		char ven [Height] [Width];
		int x, y;

		for ( y = 0; y < Height; y++)
			 for ( x = 0; x < Width; x++)
				  ven[y][x] = '.';
		printf("Indtast koordinater på formen x,y (4,2).\n");
		printf("Indtast et negativt tal for at afslutte!\n");

		while ( x >= 0 )
			{
				for (y = 0; y < Height; y++)
					{
						for ( x = 0; x < Width; x++ )
							printf("%c ", ven[y][x] );
						printf("\n\n");
					}
				printf("Indtast koordinaterne for dit skud: ");
				scanf("%d,%d", &x, &y);
				if ( fjende[y][x] == 1)
					ven[y][x] = 'R';   // Ramt
				else
					ven[y][x] = 'F';   // Forbier
			}  // Slut på while
	}  // Slut på programmet

