Skip to content

Commit

Permalink
Merge pull request #69 from FrozenAndrey/fix#68
Browse files Browse the repository at this point in the history
Fixes #68 (First symbol in a drawing line is green like others)
  • Loading branch information
abishekvashok authored Mar 27, 2019
2 parents 67cf6ee + 7ad0c61 commit 8b716ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmatrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
/* Matrix typedef */
typedef struct cmatrix {
int val;
bool is_head;
} cmatrix;

/* Global variables */
Expand Down Expand Up @@ -620,6 +621,7 @@ if (console) {
y = 0;
while (i <= LINES && (matrix[i][j].val != ' ' &&
matrix[i][j].val != -1)) {
matrix[i][j].is_head = false;
i++;
y++;
}
Expand All @@ -630,7 +632,7 @@ if (console) {
}

matrix[i][j].val = (int) rand() % randnum + randmin;

matrix[i][j].is_head = true;

/* If we're at the top of the collumn and it's reached its
full length (about to start moving down), we do this
Expand All @@ -657,7 +659,7 @@ if (console) {
for (i = y; i <= z; i++) {
move(i - y, j);

if (matrix[i][j].val == 0) {
if (matrix[i][j].is_head && !rainbow) {
if (console || xwindow) {
attron(A_ALTCHARSET);
}
Expand All @@ -683,8 +685,7 @@ if (console) {
attroff(A_ALTCHARSET);
}
} else {

if(rainbow){
if(rainbow) {
int randomColor = rand() % 6;

switch(randomColor){
Expand Down

0 comments on commit 8b716ff

Please sign in to comment.