Det er jo bare en masse "gotoxy" sætninger som tager så meget plads og som bare skal ind i en "for" løkke. Her er alle sætningerne:
gotoxy (9,0); cout << "["; gotoxy (41,0); cout << "]";
gotoxy (9,1); cout << "["; gotoxy (41,1); cout << "]";
gotoxy (9,2); cout << "["; gotoxy (41,2); cout << "]";
gotoxy (9,3); cout << "["; gotoxy (41,3); cout << "]";
gotoxy (9,4); cout << "["; gotoxy (41,4); cout << "]";
gotoxy (9,5); cout << "["; gotoxy (41,5); cout << "]";
gotoxy (9,6); cout << "["; gotoxy (41,6); cout << "]";
gotoxy (9,7); cout << "["; gotoxy (41,7); cout << "]";
gotoxy (9,8); cout << "["; gotoxy (41,8); cout << "]";
gotoxy (9,9); cout << "["; gotoxy (41,9); cout << "]";
gotoxy (9,10); cout << "["; gotoxy (41,10); cout << "]";
gotoxy (9,11); cout << "["; gotoxy (41,11); cout << "]";
gotoxy (9,12); cout << "["; gotoxy (41,12); cout << "]";
gotoxy (9,13); cout << "["; gotoxy (41,13); cout << "]";
gotoxy (9,14); cout << "["; gotoxy (41,14); cout << "]";
gotoxy (9,15); cout << "["; gotoxy (41,15); cout << "]";
gotoxy (9,16); cout << "["; gotoxy (41,16); cout << "]";
gotoxy (9,17); cout << "["; gotoxy (41,17); cout << "]";
gotoxy (9,18); cout << "["; gotoxy (41,18); cout << "]";
gotoxy (9,19); cout << "["; gotoxy (41,19); cout << "]";
gotoxy (9,20); cout << "["; gotoxy (41,20); cout << "]";
gotoxy (9,21); cout << "["; gotoxy (41,21); cout << "]";
gotoxy (9,22); cout << "["; gotoxy (41,22); cout << "]";
gotoxy (9,23); cout << "["; gotoxy (41,23); cout << "]";
gotoxy (9,24); cout << "["; gotoxy (41,24); cout << "]";
gotoxy (9,25); cout << "["; gotoxy (41,25); cout << "]";
gotoxy (9,26); cout << "["; gotoxy (41,26); cout << "]";
gotoxy (9,27); cout << "["; gotoxy (41,27); cout << "]";
gotoxy (9,28); cout << "["; gotoxy (41,28); cout << "]";
gotoxy (9,29); cout << "["; gotoxy (41,29); cout << "]";
gotoxy (9,30); cout << "["; gotoxy (41,30); cout << "]";
gotoxy (9,31); cout << "["; gotoxy (41,31); cout << "]";
gotoxy (9,32); cout << "["; gotoxy (41,32); cout << "]";
gotoxy (9,33); cout << "["; gotoxy (41,33); cout << "]";
gotoxy (9,34); cout << "["; gotoxy (41,34); cout << "]";
gotoxy (9,35); cout << "["; gotoxy (41,35); cout << "]";
gotoxy (9,36); cout << "["; gotoxy (41,36); cout << "]";
gotoxy (9,37); cout << "["; gotoxy (41,37); cout << "]";
gotoxy (9,38); cout << "["; gotoxy (41,38); cout << "]";
gotoxy (9,39); cout << "["; gotoxy (41,39); cout << "]";
gotoxy (9,40); cout << "["; gotoxy (41,40); cout << "]";
gotoxy (9,41); cout << "["; gotoxy (41,41); cout << "]";
gotoxy (9,42); cout << "["; gotoxy (41,42); cout << "]";
gotoxy (9,43); cout << "["; gotoxy (41,43); cout << "]";
gotoxy (9,44); cout << "["; gotoxy (41,44); cout << "]";
gotoxy (9,45); cout << "["; gotoxy (41,45); cout << "]";
gotoxy (9,46); cout << "["; gotoxy (41,46); cout << "]";
gotoxy (9,47); cout << "["; gotoxy (41,47); cout << "]";
Og her er den "for" løkke som vi har siddet og pillet ved:
int tegn_y = 0;
int tegn_x = 48;
void tegn_bane() {
for (tegn_y = 0; tegn_y <= 48; tegn_y++)
{
gotoxy (9,tegn_y); cout << "[" << endl;
}
}
Nogen ide til det nu? Jeg har prøvet så mange forskellige måder nu!
----------------------------------------
Der findes ingenting der så let slår fejl, som tanker