I wrote a matrix clone script in C.
The window can be resized while running the script, and the speed and colors can be adjusted according to the user's liking.
https://gitlab.com/christosangel/matrix_clone
This is what the script looks like while running:
Any feedback is most welcome!
cmatrix clone
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
- christosangelopoulos
- Level 3
- Posts: 152
- Joined: Fri Nov 13, 2020 10:19 pm
cmatrix clone
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: cmatrix clone
Correct me if I'm wrong as I'm a novice, but the use of system("clear") makes it platform specific doesn't it? As Windows uses "cls". I'm not sure what the alternative is though. Perhaps writing 200 empty lines?
- christosangelopoulos
- Level 3
- Posts: 152
- Joined: Fri Nov 13, 2020 10:19 pm
Re: cmatrix clone
You simply cannot be more of a novice than me, I have started educating myself in C for the last 10 days or so.
First I wrote this in bash, but the script was not very fast + resource demanding. So, I thought that it seemed a good experience to learn a thing or two in another language.
I haven't any idea how this script would work in Windows, and this wasn't my initial intention. What is more, it wouldn't seem impossible for other incompatibilities to exist in the script.
However I begun this journey in knowledge of this language in Linux, and I intend to continue this way. This is why I have chosen to share this in this Linum Mint forum, and not any other.
My guess is that someone with more knowledge and experience in C, in order to make this script less platform specific, would substitute the
It goes without saying that if anyone is up to it, I am open to suggestions !
First I wrote this in bash, but the script was not very fast + resource demanding. So, I thought that it seemed a good experience to learn a thing or two in another language.
I haven't any idea how this script would work in Windows, and this wasn't my initial intention. What is more, it wouldn't seem impossible for other incompatibilities to exist in the script.
However I begun this journey in knowledge of this language in Linux, and I intend to continue this way. This is why I have chosen to share this in this Linum Mint forum, and not any other.
My guess is that someone with more knowledge and experience in C, in order to make this script less platform specific, would substitute the
system("clear");
command with an if ... then
statement of a kind, that differentiates the command to clear according to the existing operating system. This someone certainly is not going to be me at the moment, as I lack both knowledge in C and experience in Windows.It goes without saying that if anyone is up to it, I am open to suggestions !
Re: cmatrix clone
Hi,
I'm pretty sure it is literally just the system("clear").
I don't see why anything else you've done wouldn't work on any other platform. On Windows someone would compile this with MinGW most likely.
I don't use Windows for the most part, my desktop is Linux Mint and my laptop is PopOS. But when it comes to creating open source software I personally just think its important for it to be available to all, including Windows users.
I know you've just made a fun script so at the end of the day it doesn't matter, its your script, etc. I just thought it was worth mentioning as from what I've read on the topic, using system specific commands is generally considered poor practice, but you'll hear all kinds of arguments and points of view.
I mean people have written software that only works on Linux and nothing else, it's not a problem. I just thought I'd mention it.
Good luck with learning C my man.
I'm pretty sure it is literally just the system("clear").
I don't see why anything else you've done wouldn't work on any other platform. On Windows someone would compile this with MinGW most likely.
I don't use Windows for the most part, my desktop is Linux Mint and my laptop is PopOS. But when it comes to creating open source software I personally just think its important for it to be available to all, including Windows users.
I know you've just made a fun script so at the end of the day it doesn't matter, its your script, etc. I just thought it was worth mentioning as from what I've read on the topic, using system specific commands is generally considered poor practice, but you'll hear all kinds of arguments and points of view.
I mean people have written software that only works on Linux and nothing else, it's not a problem. I just thought I'd mention it.
Good luck with learning C my man.
- christosangelopoulos
- Level 3
- Posts: 152
- Joined: Fri Nov 13, 2020 10:19 pm
Re: cmatrix clone
Thank you, I am going to need it!
I have just entered pointer hell, so most likely at some point I am going to update the script and introduce new knowledge to it.
As I mentioned, I am up to suggestions and help from anyone to make the script less platform specific. And most probably, when I have the time, I will make a few google searches myself at some point in the futere and resolve this issue.
Many thanks for your feedback!
Re: cmatrix clone
One of the best things, and worst things, about the C language.
A developer can do wonderful things with pointers but my advice would be to keep it simple where possible. I remember going on a training course and learning something really cool that could be done with them, which I'd never known until then. Back at work I was keen to show off and it wasn't long before I had the chance to make use of my new found knowledge.
Six months later, I had to make a change to that same area of the code and spent what I now think of as the best part of a day (but was likely "just" a few hours), trying to work out what my code was doing.
- christosangelopoulos
- Level 3
- Posts: 152
- Joined: Fri Nov 13, 2020 10:19 pm
Re: cmatrix clone
I know this feeling.
Hopefully, AFTER this trouble, the knowledge is trully yours!