Question about a game programming project?

easy sudoku
INeeDHelP! asked:

Hi there. So, I’m on the last grade at school and one of my basic lessons is Algorithm Theory and Programming. It’s a really easy lesson, and there is also a fake programming language created exclusively for the lesson which mainly follows the Pascal model. Because I love IT and programming, I’ve also chosen the computer lab as a lesson of choice. So yesterday I was writing a program that we did on that lesson in C++ while on the lab, and the teacher noticed that (he is the same teacher that teaches us the basic lesson and we have a great relationship) so he came and told me that some other guys where trying to make a Sudoku game and asked whether I wanted to make a team with them and work on a new project. I happily accepted the offer and today I was trying to think of a new project, when this came to mind:

I’m into making a card-like game, not with graphics and stuff, just text. I want it to be this way: When the game starts, you get a number of choices (with simple output-input commands) like “Play”, “bla” “bla” and an option to add new cards (like yu-gi-oh) which will need a password. I’m ok until here, I just don’t know if this will need object-oriented programming which i’m still learning (remember, I’ll keep it simple!)

What do you think? any other ideas? thanks!






One Response to 'Question about a game programming project?'

  1. valley9 - September 9th, 2010 at 4:46 pm

    Yes, that’s a good idea :)

    You asked whether this requires Object Oriented Programming. That depends on you. Personally, I think that you should use OOP because it makes your code cleaner and easier to maintain. In that case you can have the following classes/objects: Player, Game, Card… (that’s what I can think of for now), and the properties should be as follows:

    * The ‘Player’ class should have firstName, lastName, password, score, rank…
    * The ‘Game’ class should have playersArray (which is a list of the players), cardsArray (which is a collection of all the possible cards)
    * The ‘Card’ class should have cardType (i.e. Spades or soemthing else), and cardNumber (e.g. 8)
    This first part is simple, but then you’d need to build up on that by having in functioanlity which remembers which player has currently played a card, etc. and also you need to add on points to the player’s score….

    So, this is how you could have an OOP solution (all you basically do is to make a list of all the ‘things’ or ‘objects’ and turn them into classes). I’d definitely recommend OOP – and I think it’s phasing out precedural programming (I did programming at uni – and we did lots of OOP, in C++ too).


Leave a Reply