Thread: Program Idea's

  1. #1

    Question Program Idea's

    I've been learning C++ for over 2 months now on my own.... but i have run out of idea's for new programs

    can anyone give me a challange not something TOO hard since i am still quite new to the language but a little challenge would be great

    Thank You

    -Devouring One-
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    how about checkers. Or even simpler, tic-tac-toe. You can make the computer play against you.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    126
    I think that tic tac toe is a good idea. I did one last year.

  4. #4
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146

    Re: Program Idea's

    Originally posted by devour89
    I've been learning C++ for over 2 months now on my own.... but i have run out of idea's for new programs

    can anyone give me a challange not something TOO hard since i am still quite new to the language but a little challenge would be great

    Thank You

    -Devouring One-
    First of all, wow, I can't believe you ran out of ideas. I only wish that I could have the time to code out all of my ideas.

    Here are some possibilities:
    Write a calculator that allows the user to input something like "3+4*2" and outputs 11(notice the order of operations there).
    Output Parkside's triangle given a seed and a size.
    Write a program that encrypts and decrypts messages using various ciphers (my teacher suggested that one for me).
    Think of any card game you have ever played. Then, code it.
    You also might want to do some googling for programming challenges and problems used for competitions.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  5. #5
    thank you all very much!!

    One question...
    I also have an idea of making some sort of game editor for an online game.... but what it needs to do accept input from the Clipboard when someone copies information about there stats, gold etc

    How would i be able to do that.

    And about the calculator... it seems pretty simple apart form that i don't know how to strip strings from sertian characters.

    Can anybody help... give me some sort of example a really simple one like where you input name and age in one big line without spaces and it splits/strips them apart.

    Thank you again

  6. #6
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by devour89
    And about the calculator... it seems pretty simple apart form that i don't know how to strip strings from sertian characters.

    Can anybody help... give me some sort of example a really simple one like where you input name and age in one big line without spaces and it splits/strips them apart.

    Thank you again
    Remember that strings are arrays of characters.
    Code:
    int j = 0;
    char str2[MAX];
    char str1[MAX]= "Hello World!";
    // str1[0] == 'H';
    for(int i = 0; (str1[i] != ' ') ||(str1[i] != '\0'); ++i)
    {
    	str2[j] = str1[i];
    	++j
    }
    // str2 == "Hello";
    Now use that method to search through a string like "1+2" looking for +,-,*,/. You can use the library <ctype> for functions to determine if a character is a letter or a number or several other things.
    If you limit your calculator to single digit numbers and have a good grasp on arrays, it shouldn't be too difficult.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  7. #7
    Thanks... but is '*' is this a .... well what kind of character is it??
    Code:
    //taken from ctype.h
    int	isalnum(int);
    int	isalpha(int);
    int	iscntrl(int);
    int	isdigit(int);
    int	isgraph(int);
    int	islower(int);
    int	isprint(int);
    int	ispunct(int);
    int	isspace(int);
    int	isupper(int);
    int	isxdigit(int);
    from this my best guess would be: int iscntrl(int);

    but i'm probally wrong

  8. #8
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    Originally posted by devour89
    Thanks... but is '*' is this a .... well what kind of character is it??
    My guess would be ispunct, but I could easily be wrong. To be sure, you could write a program to find out which one of those categories it fits into. What I suggest is writing your own function. That wouldn't be hard at all. Just look at an ASCII table to find the integer values for +,-,*, and /. Then write a function that returns true if the character is one of those characters and false otherwise.

    Hope that helps.
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  9. #9
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    I got one
    I like it:::

    Create an Abstract Data type called
    newInt
    that is basically the same as an int except it has new properties
    it also has an array for its factors
    it has a boolean function iseven()
    and it has all the necessary overloaded operators +,-,+=,-=,=,<,<=,>,>= etc.
    and it overloads the ostream and istream operators.

    it is also a templated class ex:

    Code:
    template<class T>
    class newInt
    {
    public:
    	newInt();
    	newInt(T target);
    	//Memberfunctions etc.
    
    	//Overloaded operators
    
    private:
    	//the way your going to store all this info
    
    };
    //Overloaded Stream operators
    oh and it stores the VALUE in two ways
    one in just a complete int value and another in an array digit-by-digit

    have fun!

    btw: I have this done if anyone cares

    in 2 days, I will show the DECLERATIONS

    -Luke
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  10. #10
    ???

    ok... hmmm... I've no clue...

    Explain that to me please I haven't learned Templates yet.
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

  11. #11
    well here is the outcome:

    Code:
    #include <iostream.h>
    #include <conio.h>
    #include <stdlib.h>
    
    int main()
    {
     char num[20]= { 0 };
     double temp; 
     char next;
     int x = 0;
     int y = 0;
     cout<<"Calc: ";
     cin>>num;
     for(int i=0;i<20;i++)
     {
       
       if(num[i] == '*')     
       {
        x = i-1;
        y = i+1;
        temp =  atof(&num[x])*atof(&num[y]);
       }
       if(num[i] == '/')
       {
        x = i-1;
        y = i+1;
        temp = atof(&num[x])/atof(&num[y]);
       }
       if(num[i] == '+')
       {
        x = i-1;
        y = i+1;
        temp = atof(&num[x])+atof(&num[y]);
       }
       if(num[i] == '-')
       {
        x = i-1;
        y = i+1;
        temp = atof(&num[x])-atof(&num[y]);
       }
     }
     cout<<"\n"<<temp;
     
     getchar();
     return 0;
    
    }
    that is the claculator if you haven't noticed. I know it sucks. Any suggestions??
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

  12. #12
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Originally posted by Lynux-Penguin
    it is also a templated class ex:
    This isn't exactly a place that templating makes any sense considering there are no datatypes/values that would be templated in your description and example overview.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  2. my server program auto shut down
    By hanhao in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-13-2004, 10:49 PM
  3. Replies: 3
    Last Post: 01-14-2003, 10:34 PM
  4. Program doesn't always do whats expected... any ideas? (newbie)
    By photoresistor in forum C++ Programming
    Replies: 4
    Last Post: 12-07-2002, 02:49 AM
  5. Program ideas...
    By code987 in forum C++ Programming
    Replies: 3
    Last Post: 11-18-2002, 11:41 PM