Thread: Learning Project

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    11

    Learning Project

    I finally buckled down and got serious about learning C++. I've read tutorials and forums, but reading won't be as productive as practice? right?

    So, I open up the compiler and get a fresh workspace going. Now what do i want to make...yea...hmm... I've done the Hello World thing, and figured i'd expand on that, but where would i go? Arrays and Pointers saying Hello World? Functions expressing Hello World in numerical sequences?

    So i was wondering, what kind of programs did you guys start with? I figured i could start one project and expand/upgrade code until i move on.

    Or, knowing what you know now, what would be the ideal project to learn C++?

    Thanks. Any and all help is appreciated.

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    32
    Some of my first programs where,

    Prime number generator,
    Prime factorization,
    Fibonacci sequence,

    A date program that would take a integer say 27 and output the date in this format :
    Tuesday January 27, 2004

    or 33
    Monday February 2, 2004

  3. #3
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    dos based games really helped me understand loops, strings, pointers, key input handling, etc. Theres alot of support for starting them and all, why no go that way?

  4. #4
    Registered User Scribbler's Avatar
    Join Date
    Sep 2004
    Location
    Aurora CO
    Posts
    266
    I know it's really cliche, but writing a program to play chess will cover pretty much every aspect of programming.

  5. #5
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    battle chess? oo la la hehe

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    A chess engine can get pretty complex. I would leave that one for a while.

    Simple DOS games really helped me get good at BASIC, so RoD's suggestion is quite a good one, as I imagine it's the same with C/C++. They're fun to make too. There's a gaming board here, browse through there and get some ideas, and you might learn a thing or two from gamedev.net.

  7. #7
    Registered User
    Join Date
    Oct 2004
    Posts
    11
    thanks guys.

  8. #8
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Experiment with file I/O, classes, templates, overloaded functions/operators, the STL... not really for just starting out learning (except maybe for the file I/O part), but expand into the other areas after a bit of practice.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  9. #9
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    I have the same problem. However, I know probably 65% of the language, not counting the STL or any graphical stuff. I'm sure I would be capable of writing something good, just no ideas come to mind when I sit down and actually try to write something. Maybe I should start on chess, like you guys suggested to howdytest.

  10. #10
    Registered User Kybo_Ren's Avatar
    Join Date
    Sep 2004
    Posts
    136
    However, I know probably 65% of the language, not counting the STL or any graphical stuff.
    Well, graphical stuff doesn't count, because it's not part of the language

    I'd recommend writing some useful things --
    - A file encryptor (simple encryption)
    - An alarm clock
    - A program that will take scores from a text file and calculate students' grades from that (easier with the STL, but can easily be done without).

    I think a chess engine is a bit complex right now. AI can get pretty complex.
    Last edited by Kybo_Ren; 12-27-2004 at 12:47 AM.

  11. #11
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    i never really did it to learn, but one thing that i wish i had done when i was learning (starting out) is find some "beginner" source code, pick a function or a class and erase the source before i looked at it leave only the prototype. then try to re-write the function on your own.

    when you are just starting out though, you pretty much have to stick with programs that don't really do anything. once you feel like you have a good understanding of the basic language features, i suggest moving onto learning STL...it makes programming sooooooooo much easier. that's another thing i wish i had learned sooner.

    although you won't use them as much if you use the STL, i suggest getting very familiar with pointers and references. i can't really explain how having a good knowledge of pointers has helped me, but i can tell you that it has definitly helped me understand the way programs work.

    good luck on your journey

    edit: i really need to work on my writing skills
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  12. #12
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    write your own version of strtok();

    write your own version of tic-tak-toe;

    write your own version of battleship;

    write your own version of a card game such as poker or war or go fish or gin rummy, etc.

    create your own singly and doubly linked lists classes;

    create a container of names sorted by last, and first names--that is:
    smith, anna
    smith, bill
    smith, joanne
    zimmerman, michael

    create your own tree class (any variety);

    create a program to generate a random maze and a program to solve it and define the shortest path(s) if one exists;

    Create a program to solve this puzzle: Pretend there is a 3by3 cube made of individual 1by1 cubes that represents a block of cheese. You are a mouse that gets to eat the cheese. You can start at any arbitrary 1by1 cube. When you eat that piece you can move to another adjacent piece in the up, down, right, left, front or back position from your current position, but you can't go kidddy corner. What's the most 1by1 cubes of cheese you will be able to eat, and indicate one path to do it.

    Create a concordance for a given piece of literature. That is, create a table containing each unique word in the piece of literature and the unique lines that each word can be found on.

    read, research if necessary, and attempt to answer questions posted on this board. If you are polite, demonstrate integrity and honesty, and show that you have made an effort, most people won't mind if your answers aren't always 100% accurate; but do the best you can.

    Post your own questions, if need be, when you run into an obstacle.

    Register at topcoder and attempt to do some of their challenges.

  13. #13
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    write your own version of tic-tak-toe;
    I've written my own two-player version of Connect Four. No AI, however. After doing that, my mind went blank with ideas. I tried to make up my own game with no success.

    Thanks for the suggestions, Kybo_Ren. I will try some of those.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. HELP! 1st Project!
    By Zionstorm in forum C++ Programming
    Replies: 3
    Last Post: 09-15-2008, 09:36 AM
  2. Operating System Project
    By Pete in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 07-15-2004, 09:33 AM
  3. application project
    By featherflutter in forum C++ Programming
    Replies: 2
    Last Post: 06-26-2004, 11:12 AM
  4. Please, suggest a project ….
    By Dragon227Slayer in forum C# Programming
    Replies: 1
    Last Post: 06-12-2004, 11:16 AM
  5. Please, suggest a project ….
    By Dragon227Slayer in forum Tech Board
    Replies: 1
    Last Post: 06-12-2004, 10:48 AM