Browse Source

Erstellen Spielfeld

remotes/origin/branchJulia
Julia Selig 11 months ago
parent
commit
c3865b164d
  1. 24
      src/main/c/Pong/game.c

24
src/main/c/Pong/game.c

@ -1 +1,25 @@
#include <stdio.h>
#define WIDTH 40 //Breite Spielfeld
#define HEIGHT 20 //Höhe Spielfeld
void drawField() {
for (int i = 0; i <= HEIGHT; i++){
for (int j = 0; j <= WIDTH; j++){
if (i == 0 || i == HEIGHT){
printf("-");
} else if ("i == 0 || j == WIDTH") {
printf("|");
} else {
printf(" ");
}
}
printf("\n");
}
}
int main(){
drawField();
return 0;
}
Loading…
Cancel
Save