|
wator.c |
/* * initialisiert das Feld `wator' und belegt es mit * `nfische' Fischen und * `nhaie' Haie * falls die Anzahl zu gross ist, wird FALSE zurueckgeliefert */ int init_wator(int nfische, int nhaie) { int zeile, spalte; if (nfische + nhaie > ZEILEN*SPALTEN) return FALSE; for (zeile = 0; zeile < ZEILEN; ++ zeile) for (spalte = 0; spalte < SPALTEN; ++ spalte) wator[zeile][spalte] = LEER; fuelle(nhaie, HAI, hbrut); fuelle(nfische, FISCH, fbrut); return TRUE; /* alles OK */ } |
init_wator ist für die gesamte Initialisierung
verantwortlich.
|
Copyright © 1998 Andreas Borchert, in HTML konvertiert am 01.12.1998 |