Inventory program

As I was struggling through a recent Java class a good friend of mine told me that something which helped him learn the language was to pick a project for himself, not school related, that was advanced enough to force him to learn new things about the language. The logic seemed sound. Instead of running only through the examples and projects in the class I would get to do something I wanted to.

Now I know that I'm no where even close to designing a game, although someday I would like to give it a shot. I thought I would start a bit smaller. Overall I want a program that will allow me to create an inventory of collectible cards, and eventually allow for the creation of a virtual deck (following the rules and conventions of the game).... There's lots of things I want this program to be able to do.

I'm new to programming overall so many of the core concepts are still really new for me. I am excited to learn and unsure if C++ is going to be the language for me on this project or not. Regardless, I believe that even developing a basic inventory program would be beneficial in the learning process.

What I'm looking for at the onset of this project is a starting point, topics to start researching. Things specific to the goal of the program. As I go along I am sure the questions will become a bit more focused. I'm willing to do the leg work, but I need direction so I don't spend tons of time on something that has little impact on what I'm doing right now.

I would greatly appreciate any assistance you guys are willing to give me.
Hey Playstation, i was directed towards this link http://www.cplusplus.com/articles/N6vU7k9E/

it gives you exercises to use as well as the knowledge needed to fulfill them. hope it helps you as much as it helped me! :D

i understand this is not exactly what you were hoping for and im sure other posters will give you more detailed and related answers, but i find that if im stuck on making a program and i need to learn more just to make it compile, im better off stepping away and learning the concepts more thoroughly that way i dont have to keep rewriting my project over and over.
Last edited on
Interesting, I created such an inventory system many years ago (for MTG in my case) and cataloged a few thousand cards. I considered turning it into a full online game, but the sheer amount of cards with rather unique rules and the fact that I could only play it with friends due to legal issues kept me from it.

Anyway, it depends how you want your inventory system to look like. It can be done as a console program, which is easy to do but somewhat less comfortable to use compared to a GUI program. For the console variant, you mostly need to know about console input/output and file handling.

Now I know that I'm no where even close to designing a game, although someday I would like to give it a shot.

Well, not really, you can create games at any stage of your learning process - you just have to choose the right complexity. Aiming for the next Elder Scrolls or Crysis won't do, but a Breakout clone or a side-scrolling shooter such as R-Type are fairly easy to do. I found writing games in particular to be an excellent way of learning as there is hardly any other type of applications where you can make such wide-spread use of different programming concepts, structures and algorithms.

I think you chose a good project. An inventory system is simple enough and you can add an actual game later on top of it when you've gained some experience.
Athar, MtG is actually the CCG of choice for this program. I have a few friends that would like it for other games. I think that once I get the core of the program done it wouldn't be all that complicated to make the needed adjustments from MtG to Yugio (sp) or Pokemon or even beyond.

Ultimately I want it to have that deck building capability. Where I see a lot of problems is the ever changing deck type definitions, where certain cards fall within certain types and in certain types they are banned, etc...

This current class is literally my second injection of programming knowledge. The C++ class has gone by with far less sweating and wringing of the hands than Java. I'm unsure if the relative ease is from having gone through Java already and having some exposure to programming concepts or if C++ is really that much easier to wrap one's head around. In any case I know that for my understanding if nothing else I need to start small. Eventually I want to move on to designing games. I need to understand the core concepts a bit more before I start worrying about GUIs and things of that sort which come with gaming.

I imagine that the project will hold many alterations. I have more classes in Java coming up, I imagine I'll be placing the program through the Java filters before too long. Like I said I think this will be a good personal project and once I'm comfortable with the conventions of programming through more advanced features like deck building, GUIs and perhaps some sort of AI testing ability for the deck builder portion of things.

@Affinity4Code I appreciate the link. I'm looking for any and all direction from the more advanced people out there. I want to do this, and I know I need to spend my time in the trenches before I really get to do the fun stuff. I will check it out.
Eh, its no problem. im not familiar with your level of expertise and mine is DEFINITELY lacking lol. you have me interested in your project though :) sounds fun and i think i will do some research and make my own. i dont even know where to begin, so this will be an adventure for sure :)
Odd, I'm pretty sure I typed a response already. LOL. I'm in much the same boat. I have ideas of how it can be done, but I'm unsure of how to do it within C++'s rules. The class I'm in is only an introduction to the language and thus far has barely touched upon topics like user input and arrays (which would be at the core of the program were it to be done in Java, and eventually will)

I would be interested to see what research you come across, Affinity.
I'll keep you posted ;) i got an idea in my head thats slowly forming on my console, aint near post-ibility yet if ya get my drift, lol. Gotta figure out a good way to sort all the inputs into their various classes...
Here's a question....we can store user generated input in to a variable....if I have the user enter 500 different card names, will that single variable hold all 500 names or is it just the one? A moment of inspiration, or perhaps a blonde moment...guess it depends on the answer. LOL.
Alright, so I've been watching some tutorials by Bucky on Youtube...and I just went through number 26, which is where he talks about letting user generated input populate an array. In the program we write during the tutorial we declare the number of elements in the array, but leave the actual "definition" of those elements to the user. My question is; is there a way to have the number of elements in the array defined by the user? To give some coded examples:

double bucky[5]={};
tells the program there are to be (5) elements in the array called bucky. The {} leaves the definition of those elements undefined, for the user to fill in later. How can I give the same option to the program for the number of elements in the array?

The overall purpose of the first incarnation of this program is to track inventory of a collectible card collection. Most people will not know the number of cards they own right off the top of their head. I certainly won't know what other people have...is there an infinity option, or something?
Use dynamic memory, or an STL container like a vector.
Topic archived. No new replies allowed.