I made this last semester for my intro to C++ class. It works great and I got a good grade, but I want to make improvements to it. I really would like to add classes and make it more OO, but I've always had problems with classes. I know the syntax and completed my homework assignments dealing with them, its just a rough spot for me and I know they are EXTREMELY important in C++ programming.
So I was wondering if anyone could take a look at this and give me some ideas on what to improve and maybe even small examples to start me off / get me thinking about what to do. Like I said classes would be nice to add, I just have no idea where to start. But I'm open to any other suggestions as well, not just classes. I want to keep improving this until there's not much left to do with it before I move onto my next project.
Well if you'd like a real challenge, you could go read a tutorial on graphical programming and make a form application for it or take it to the next level and program it in Allegro or OpenGL.
That's way beyond OP's level of expertise given the original request.
Here are some ideas:
1) Make a class named "Grid" that encapsulates the playing board. Before you even start, think about what functions might Grid have.
2) Make a class named "Player" that encapsulates one of the two players. What member functions might Player have?
2a) Make the computer play by modifying Player to support a computer player. Don't worry too much about the computer logic;
having it move randomly (but legally) is sufficient for now.
2b) Once you've finished (2a), make Player an abstract base class, then create two derived classes: "Human" and "Computer".
2c) Make the computer play with optimal strategy.
3) Your checkWin() function is quite long because you had to write lines of code for each different way you could win. Consider
using a data-driven implementation that allows you to reduce the function body to a for() loop with a single if() inside it. Can you
think of how to do this?
4) Now take everything you did above and make a Connect Four game instead. Here's where you'll really reap the benefits of
(3), even though you'll have to change the function a bit, because there are quite a number of ways to win in Connect Four.