any beginner ideas?

This is a discussion on any beginner ideas? within the C Programming forums, part of the General Programming Boards category; I wasn't sure if I should post this here or on the contest board. I'm jumping back into C after ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    34

    any beginner ideas?

    I wasn't sure if I should post this here or on the contest board. I'm jumping back into C after a VERY long absence. Basically what I'm looking for are some ideas for programs. I've looked at the contests and the challenges, those are good but I'm looking for something a little more. Something like, "using recursion write a program to do this" or "write two functions, one that does this, one that does that. Use pointers to do this".

    I have a couple really good books but they're really boring to go through and they don't have any program ideas. Does anyone have a list of the programming homework they were assigned to do maybe? I would like them to start easy and gradually get harder. I can only write so many hang man games, tic tac toe and phone book programs. Basically I'm just looking for program ideas with some hints on what to use to do it.

    Having source available with the solution would be nice but isn't really needed, I would like to figure it out on my own. Thanks in advance for any help and I apologize if this is the wrong board for this.
    -gunder

    if (problem)
    postcount++;

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    I like this idea from K&R2:

    Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal; a vertical orientation is more challenging.
    At the point of the book that the [above] programming exercise is given, basically the reader has been introduced to getchar and putchar. Anyway, you can look at a solution if you can't figure it out.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Since we've been having such a fine discussion on recursion, here's the challenge:

    Generate a N x N maze using the following methodology for creation:
    1 - Input a starting point, Y and X, where Y and X are in bounds for the maze.
    2 - From the starting point, visit every other cell in the maze, you should use the following methods for moving:
    -- If any neighboring squares are unvisited, pick one of them at random, and go there.
    -- The act of moving there will remove the "wall" between the two cells. You may keep track of the "walls" however you like. The common method is to use a bit of masking, pardon the pun, to denote if a wall exists or not. A cell whose value is zero means it's unused. However, you can use any method to keep track of where you've been you choose.
    -- If you reach a point where all neighboring cells are visited, you should begin backtracking your path to find a neighboring cell that isn't visited, and begin the process again.
    -- When all rooms have been reached, you are to done.
    3 - Implement the above method using recursion.
    4 - Implement the above method without using recursion.
    5 - You should have a method for printing your maze to the screen, or file, in the event it's too large. A maze might look like this:
    Code:
    +--+--+--+--+--+
    |     |  |  |  |
    +--+  +  +  +  +
    |  |     |     |
    +  +  +--+  +--+
    |     |><|     |
    +--+  +  +--+  +
    |              |
    +  +--+  +--+  +
    |  |        |  |
    +--+--+--+--+--+
    It might, but you can make it however you like. That was just an example of a possible 5x5 maze. You could also denote the starting point, just as a point of interest. I did here with "><", because after all, X marks the spot.

    If you're bored, also do the following:

    1 - Given one of these generated mazes, enter a starting point and a finishing point.
    2 - Implement a recursive method for finding the finishing point, using the above rules for generation. However in this case, you don't remove any walls, you simply go there. You'll need to keep track of your progress, so you can backtrack effectively.
    3 - Implement an iterative version of the same pathing.


    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    The Hawk Man
    Join Date
    Nov 2005
    Location
    Beaverton, OR USA
    Posts
    13
    I am completely new at programming and am teaching myself because of not being able to attend school for it at this time. I like giving myself my own homework because it's fun and makes me feel like I'm actually in school again. Anyway, I created a project program that is REALLY simple. It's a zodiac generator. You enter in the month (i.e. 2) and the day (i.e. 26) and it gives you your zodiac sign (i.e. Pisces). It's pretty cool.

  5. #5
    Matt Conway bobthebullet990's Avatar
    Join Date
    Nov 2005
    Location
    Cambridge
    Posts
    121

    Wink

    do the hello world program!!!!!!!!

  6. #6
    Matt Conway bobthebullet990's Avatar
    Join Date
    Nov 2005
    Location
    Cambridge
    Posts
    121

    Lightbulb

    Quote Originally Posted by GavinHawk
    I am completely new at programming and am teaching myself because of not being able to attend school for it at this time. I like giving myself my own homework because it's fun and makes me feel like I'm actually in school again. Anyway, I created a project program that is REALLY simple. It's a zodiac generator. You enter in the month (i.e. 2) and the day (i.e. 26) and it gives you your zodiac sign (i.e. Pisces). It's pretty cool.
    Try this for starting out in C....

    General I/O
    read RAWBIT PPM files
    write RAWBIT PGM files
    write RAWBIT PPM files
    read RAWBIT PGM files
    read RAWBIT PBM files
    write RAWBIT PBM files

    Point Operations
    RGB to grescale conversion
    Brightness adjustment
    Contrast adjustment
    gamma correction

    Area Operations
    Sharpen
    Edge Detect
    Geometric Operation
    Rescale
    Minification Using Median Substitution

    Frame Operations
    Image Addition
    Image Subraction

    ....OH how fun my 1st year of uni was!!! ...this was for module image processing in C, coursework was to produce a library of the above functions!

    But this was first year and i had never ever even seen a c program! I only ever used VB, so you can imagine the jump i needed to take!!!! NOT FUN!

    This module is now obselete though because too many people failed!!!! ...if you want to learn C, try some of this!!! ...the website for this module is still there!!! ...the address is:

    If you want to learn more advanced C quickly, the best thing is to be thrown right in at the deep end! ...it actually works! I had never ever touched C, at the beginning of the year, i was just getting to grips with C structure and layout, writing hello world to the screen!!!! ....In first year of uni, we had to write an image processing library of functions!!! FUN! ...but it is awesome if you want to learn about image processing and learn to program in C!

    The module notes are still on the web, so if you fancy learning C, there is no better way, this really gets you in at the deep end!!! Trust me, i was there, i did it, and i learnt C!!!! although for the first few months i was the most confused person in the world!!!!!!!! well, here is the address for the site:

    http://www.cems.uwe.ac.uk/~irjohnso/uqc146s1.html

    ...my library of functions ended up totalling around 2,000 lines of code!!!!! so i am sure you can imagine how fun my course is at uni!!!!! ...Computing for real time systems and embedded systems programming

  7. #7
    Registered User
    Join Date
    Sep 2003
    Posts
    34
    Thanks for the suggestions, I really like the histogram and the maze. Those are things that are interesting to do but not too complicated. Thanks again.
    -gunder

    if (problem)
    postcount++;

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ideas, how do you get them? xD
    By Akkernight in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 01-22-2009, 03:53 AM
  2. Project ideas
    By steve1_rm in forum C++ Programming
    Replies: 6
    Last Post: 04-14-2008, 06:34 AM
  3. cool ideas for a game
    By Shadow12345 in forum Game Programming
    Replies: 7
    Last Post: 05-18-2004, 09:37 PM
  4. idea's idea's idea's
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-29-2002, 01:30 AM
  5. Small app ideas
    By dirkduck in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-15-2002, 08:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21