My first "finished" project

Hello Everyone.

My name is Christopher Rodriguez, and though I've been messing around with C++ for a few years, I had never really created a program of my own, from scratch. Now I have, and I am looking for a few kind souls to let me know what they think. I'm not asking for solutions here, but more of a review of the entire project.

The code (it's a bzipped tarball right now) lives at:
http://www.danusclearing.com/openleaf/tarballs/mastermind-0.0.1.tar.bz2

The project was to recreate the old board game "Mastermind" for the terminal. Right now, as it is in an early alpha, the only finished feature is playing the basic 4 peg, 6 color game against a computer 'mastermind.'

In order to play the game, if You compile it, You need to input the first letter of one of six colors (Red, Blue, Green, Yellow, Orange and White), four times, at the guess prompt. Your first guess might be 'RRRR' or 'GYOW.' I haven't included support for lower case letters yet, so they need to be capitals right now.

After the guess, a correction code comes up. '0' is 'in the right place,' '^' is 'used at least once in the code, but not here,' and 'X' is 'not used in this code at all.' Youll figure it out pretty easily, especially if You look at the code.

In total, there are about 190 lines of code there. The NCurses Library is included for the unstable branch of the program, where I am working to convert the code to a compatible format for the C-based functions of Curses. The sections I feel need the most work are the end of the game loop, and probably the overall structure of the entire program.

I'll admit that I didn't really follow much of a good design practice for this program, but that is part of why I am asking for reviews: I want to improve, and have no real way to do so aside from creating another project and trying to implement it. Unfortunately, This approach doesn't really let me learn new design practices or better flow in my programs, so I am a bit worried.

Anyway, Thank You for reading this long post. I will appreciate any and all comments and criticisms that I receive, and look forward to hearing all of them! I really want to improve.


Thank You all,

Christopher Rodriguez
You should try to make it GUI based. If you already have experience with C++ learning how to use GUI's should be easy for you. (Qt would probably be a good start).
Thanks for the reply, hanst99. I had planned to eventually take it to the GUI, but I was considering learning to use SDL.

Would Qt or GTK be a 'better' choice, in the long run? Is there any reason that I *shouldn't* learn a library like SDL? I've seen a lot of debates over various different GUI toolkits, but none which compare "media" libraries like SDL to Qt. Is there a fundamental difference between these two kinds of libraries?

I live mostly in the command line; when I do go into a GUI, I use a window manager (fluxbox, usually) but no Desktop Environment... Please excuse my ignorance in this matter.

SDL is a multimedia library -which means, it's for handling images, sound and the like - a pretty old one at that. If you wanted to use multimedia stuff with C++, SFML would probably be your best choice. Qt does have some multimedia support too, but I don't know very much about that - I use it solely for creating GUI's. SFML on the other hand has it's focus on the multimedia stuff (and is, as far as I know, mostly used for games). I don't think it provides GUI functionality though (it might, but if it does I haven't heard of it). GTK+ is C based - you can use it with C++ of course, but...

And no, there is no particular reason why you should not learn to use a library - except for when it's outdated.
Topic archived. No new replies allowed.