cmatrix clone

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

cmatrix clone

Post by christosangelopoulos »

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:

Image
Any feedback is most welcome! :)
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.
Nikolai5
Level 4
Level 4
Posts: 309
Joined: Thu Dec 23, 2021 5:25 pm
Location: Northern England

Re: cmatrix clone

Post by Nikolai5 »

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?
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: cmatrix clone

Post by christosangelopoulos »

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 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 :) !
Nikolai5
Level 4
Level 4
Posts: 309
Joined: Thu Dec 23, 2021 5:25 pm
Location: Northern England

Re: cmatrix clone

Post by Nikolai5 »

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.
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: cmatrix clone

Post by christosangelopoulos »

Nikolai5 wrote: Thu Jun 23, 2022 6:18 am Good luck with learning C my man.
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! :)
dave0808
Level 5
Level 5
Posts: 987
Joined: Sat May 16, 2015 1:02 pm

Re: cmatrix clone

Post by dave0808 »

christosangelopoulos wrote: Thu Jun 23, 2022 8:04 am I have just entered pointer hell,
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. :lol:
User avatar
christosangelopoulos
Level 3
Level 3
Posts: 152
Joined: Fri Nov 13, 2020 10:19 pm

Re: cmatrix clone

Post by christosangelopoulos »

dave0808 wrote: Thu Jun 23, 2022 11:33 am 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. :lol:
I know this feeling.
Hopefully, AFTER this trouble, the knowledge is trully yours!
Locked

Return to “Programming & Development”