diff options
author | Alexander Kauerz <kauerz@informatik.uni-luebeck.de> | 2011-12-30 11:16:44 +0100 |
---|---|---|
committer | Alexander Kauerz <kauerz@informatik.uni-luebeck.de> | 2011-12-30 11:16:44 +0100 |
commit | 0b164e2a515135e8a48d7b03a468ea67d477312f (patch) | |
tree | e269150e30edce5307bdf8c58927886fde23be77 /Matrix_5x6/Charlie | |
parent | 9d19a4dfbc5d6a161b4c18d6fd0555c6f4d306a5 (diff) | |
download | ledmatrix-0b164e2a515135e8a48d7b03a468ea67d477312f.tar ledmatrix-0b164e2a515135e8a48d7b03a468ea67d477312f.zip |
Mauercode optimiert.
Diffstat (limited to 'Matrix_5x6/Charlie')
-rw-r--r-- | Matrix_5x6/Charlie/Charlie.pde | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Matrix_5x6/Charlie/Charlie.pde b/Matrix_5x6/Charlie/Charlie.pde index ad2b5d3..d8884d0 100644 --- a/Matrix_5x6/Charlie/Charlie.pde +++ b/Matrix_5x6/Charlie/Charlie.pde @@ -210,6 +210,13 @@ void lauftext(char *text) { } +void bmauer( int x, int y){ + scr[x][y] = 20; + drawscr(5); + fadescr_down(); +} + + void mauer(int dir) { /* 0=up 1=down 2=right 3=left @@ -220,31 +227,25 @@ void mauer(int dir) { case 0: for (int i=0;i<y;i++) for (int j=0;j<x;j++) { - scr[j][i] = 30; - drawscr(2); + bmauer(j,i); } break; case 1: for (int i=y-1;i>=0;i--) for (int j=0;j<x;j++) { - scr[j][i] = 30; - drawscr(2); + bmauer(j,i); } break; case 2: for (int i=0;i<x;i++) for (int j=0;j<y;j++) { - scr[i][j] = 30; - drawscr(2); + bmauer(i,j); } break; case 3: for (int i=x-1;i>=0;i--) for (int j=0;j<y;j++) { - scr[i][j] = 20; - drawscr(5); - fadescr_down(); - + bmauer(i,j); } break; @@ -266,7 +267,7 @@ void loop() { // schnecke(random(4)); // clrscr(); // mauer(0); -clrscr(); -mauer(3); +// clrscr(); +mauer(random(4)); } |