This page is dedicated to the C++ code I wrote in highschool. Despite no one wanting me to code in C++ since I graduated from college, all the jobs I’m interviewing for now want multiple years of C++ experience. Experience, I must point out, I would not have received had I already been working for said companies since I graduated from college. This C++ code probably won’t compile on these fancy 32 or 64-bit computers we have today. It was all written in 16-bit DOS using Borland Turbo C++. Without the Borland libraries and direct memory access of MSDOS, they won’t run without some manipulation. I could try to get them to work with DosBox, when I get the inclination to do so.
MyString.h:
Back before there was a String class in C++, again when memory was at a premium, everything had to be done with character arrays. These had limited functionality (you couldn’t do more with an array of characters than you could an array of strings, save for printing it out (assuming the last character was a zero). So anyway, this class was meant to implement more user-friendly textual strings. Strings that could easily be concatenated, split, printed, etc…, without the user having to worry about how much memory had already been reserved. Again, it’s totally pointless in a modern system, but it’s here.
Mouse.h:
Back in the days of MSDOS, the OS didn’t just come with standard universal mouse drivers. This file include a class to interface to low-level processor interrupts to communicate with a serial mouse. I believe it still required some sort of device driver/application to connect the mouse to the computer, but this class allowed you to read-back information on the mouse. Things weren’t object oriented back then. You didn’t click on a Windows Object which then generated an event, you clicked on an area of the screen, and had to figure out for yourself what the user was attempting to do. Yeah, computer OSes do a whole lot of stuff for us today, I’m not sure kids in school these days even consider these types of things anymore. Needless to say, this class is obsolete, not sure it would even work with todays modern processors.
Recycle.h:
Also back in the days of MSDOS and 16-bit memory access, memory usage was a major concern. This class allowed the efficient management of memory to prevent fragmentation when many instances of the same structure needed to be created and deleted during execution. With many modern programming environments (.NET, JVM, Python, etc…), memory management isn’t even an option, much less having to worry about maximum allocation or fragmentation. Let the OS/virtual machine figure it out, that’s the new mantra.
Uno:
I had a school project where I had to write something. I chose to create a computer version of Uno. I know what you’re saying, “I have Uno on my phone, why would I want a character-based Uno DOS program?” Well, when I was in high school, game manufacturers hadn’t yet seen the light that people would want to do stuff on their computers, so if you wanted to play Uno, you needed a deck of cards and some friends. Anyway, this isn’t the most elegant of programs, but it mostly gets the job done, but again, it won’t run on modern Windows without some finagling that I haven’t done yet. Oh well.
All the code is in my repository:
Pingback: C++ Code / High School / College | Hellwig Code and Apps