summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-04-16 09:45:03 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-04-16 10:10:15 -0400
commita9d3e9a13d17c9036e88b4e4a0df40f210cf06d6 (patch)
tree187e3170e7dbe46cd3bfbd133f83f51a79ecbe06 /apps/plugins
parent42dba708e3bcd2fa448f9d2865157b910a62a11a (diff)
The Matrix plugin -- Bugfix
Off by one errorS in the matrix plugin might even say its the matrix plugin re-loaded Change-Id: I2bc7487615a9e28fcd1d170961fb0b5ee6da6af7
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/matrix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c
index 087a501474..1b2f6d465a 100644
--- a/apps/plugins/matrix.c
+++ b/apps/plugins/matrix.c
@@ -166,7 +166,7 @@ static void matrix_loop(void)
*/
/* A little more random now for spaces */
if (rb->rand() % randomness == 1){
- while (i <= ROWS && (matrix[i][j].val == 129 ||
+ while (i < ROWS && (matrix[i][j].val == 129 ||
matrix[i][j].val == -1)){
i++;
randomness--;
@@ -179,19 +179,19 @@ static void matrix_loop(void)
}
- if (i > ROWS)
+ if (i >= ROWS)
break;
/* Go to the head of this collumn */
z = i;
y = 0;
- while (i <= ROWS && (matrix[i][j].val != 129 &&
+ while (i < ROWS && (matrix[i][j].val != 129 &&
matrix[i][j].val != -1)) {
i++;
y++;
}
- if (i > ROWS) {
+ if (i >= ROWS) {
matrix[z][j].val = 129;
matrix[ROWS - 1][j].bold = 1;
matrix_blit_char(z - 1, j, matrix[z][j].val);
@@ -200,7 +200,7 @@ static void matrix_loop(void)
matrix[i][j].val = rb->rand() % (MAXCHARS-1) + 1;
- if (matrix[i - 1][j].bold == 2) {
+ if (i > 0 && matrix[i - 1][j].bold == 2) {
matrix[i - 1][j].bold = 1;
matrix[i][j].bold = 2;
}