mirror of
https://github.com/PoetryInCode/matrix.git
synced 2026-08-13 11:24:40 -04:00
hanged compiler to clang
This commit is contained in:
parent
7a9d954aab
commit
4d073347f3
4
Makefile
4
Makefile
@ -1,9 +1,9 @@
|
|||||||
all: build
|
all: build
|
||||||
|
|
||||||
CC=gcc
|
CC=clang
|
||||||
STD=gnu99
|
STD=gnu99
|
||||||
OPT=-Os
|
OPT=-Os
|
||||||
DBG=-g -ggdb -gstabs
|
DBG=-g -ggdb
|
||||||
OTHER=
|
OTHER=
|
||||||
|
|
||||||
CMD=$(CC) $(DBG) -std=$(STD) $(OPT) $(OPT)
|
CMD=$(CC) $(DBG) -std=$(STD) $(OPT) $(OPT)
|
||||||
|
|||||||
BIN
bin/matrix
BIN
bin/matrix
Binary file not shown.
26
src/main.c
26
src/main.c
@ -4,6 +4,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#define UP (1)
|
#define UP (1)
|
||||||
#define DOWN (2)
|
#define DOWN (2)
|
||||||
@ -17,6 +18,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
WINDOW term = *initscr();
|
WINDOW term = *initscr();
|
||||||
start_color();
|
start_color();
|
||||||
init_pair(1,COLOR_GREEN,COLOR_BLACK);
|
init_pair(1,COLOR_GREEN,COLOR_BLACK);
|
||||||
@ -26,21 +28,24 @@ int main(int argc, char **argv) {
|
|||||||
puts("Error could not enter no-delay mode");
|
puts("Error could not enter no-delay mode");
|
||||||
return ERR;
|
return ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int time;
|
int time;
|
||||||
if(argc >= 3) {
|
int initTailLen;
|
||||||
time=atoi(argv[2]);
|
for(int i=1; i<argc; i++) {
|
||||||
} else {
|
if(strcmp(argv[i],"--tickTime")) {
|
||||||
time=20;
|
time=atoi(argv[i+1]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if(strcmp(argv[i],"--streamLen")) {
|
||||||
|
initTailLen=atoi(argv[i+1]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
timeout(time);
|
timeout(time);
|
||||||
|
|
||||||
int maxX = COLS;
|
int maxX = COLS;
|
||||||
int maxY = LINES;
|
int maxY = LINES;
|
||||||
int initTailLen;
|
|
||||||
if(argc >= 2) {
|
|
||||||
initTailLen=atoi(argv[1]);
|
|
||||||
} else {
|
|
||||||
initTailLen=10;
|
|
||||||
}
|
|
||||||
int tailLen[maxX];
|
int tailLen[maxX];
|
||||||
|
|
||||||
for(int i=0; i<maxX; i++) {
|
for(int i=0; i<maxX; i++) {
|
||||||
@ -104,7 +109,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//-------Back to normal format-------
|
|
||||||
if(tail[i]!=limit) {//keep iterating the tail intill it is at the limit
|
if(tail[i]!=limit) {//keep iterating the tail intill it is at the limit
|
||||||
if(dir==DOWN) {
|
if(dir==DOWN) {
|
||||||
tail[i]++;
|
tail[i]++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user