Lost Inspiration

This is a discussion on Lost Inspiration within the C++ Programming forums, part of the General Programming Boards category; HMMMMM, I cant think of anything that I want to do, can anybody suggest something to program that is not ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    545

    Lost Inspiration

    HMMMMM, I cant think of anything that I want to do, can anybody suggest something to program that is not too advanced. I think someting to do with Classes and maybe a bit of virtual functions and things like that. But I can't think of anything to incorporate this into.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    > can anybody suggest something to program that is not too advanced
    One man's "simple" is another man's "huh?"

    What sort of programs have you done, and how did you rate their difficulty?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    That's not much to begin with. I personally don't think very highly of the purposes of virtual functions and inheritance.

    How about a container class we can all use? A rope, cord, trie, whatever that the STL doesn't have yet Thinking of doing one myself.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  4. #4
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    Failing that, why dont you make a small game? But use classes and virtuals with it where and when you can. Depending on how much you know, take a dive into openGl or even the tricky DirectX
    I'm just trying to be a better person - My Name Is Earl

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Write a program that prints its own source code.

    Do not use File I/O to read the source file to do this.
    Callou collei we'll code the way
    Of prime numbers and pings!

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Well, I know a bit of how direct X works, what coding to do with it but I dont really know enough to implement it all into my own game.

    >What sort of programs have you done, and how did you rate their difficulty?

    Not really very difficult, Ive made a Tic Tac Toe, a Horse Betting game where the winner was not decided by the odds. I think I did a very small program to do with bank accounts with classes. All not very difficult and I dont know anything about STL yet. I really ought to expand my knowledge a bit.

  7. #7
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Posts
    311
    A battleship game. Either ascii graphics or win32 or opengl.

  8. #8
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    QuestionC: why write another quine when we all already know what the smallest one looks like?

    A sorting algorithm?
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  9. #9
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    You stated you did a small bank account program using claesses - heres a perfect one for you:

    Design a running C++ simulation of an ATM machine. Think of clasess, eg: screen, withdraw, deposit. Then code the program and test it as you go.

    I had to do this exact thing for an assignment last year and I found it both challenging and enjoyable.
    I'm just trying to be a better person - My Name Is Earl

  10. #10
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    for my current assignment we were told to find a small business and make a program for that. ive chosen to do a small 4x4 breakers yard.

  11. #11
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    this really depends on what you want to achieve. If your goal is to improve your programming ability, try writing one of your existing programs in a different style/language (try a functional language for instance).

    If your goal is to improve your C++ specifically, I'd think about generic components that you use and try to write a template for them. Play with some boost libraries. If you really want to work with classes and virtual functions, write a simple GUI toolkit. there's an excellent article on gamedev about writing a directx gui, try to extend it so that you can create GUIs from xml files
    i.e.
    Code:
    <dialog title="main window">
      <button x="20" y="30" width="100" height="20" caption="press me"/>
      <editbox x="50" y="30" width="100" height="20" />
    </dialog>
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  12. #12
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    Wish we could do that in XHTML You could be lazy and use libxml or something for the dirty work, so its just glueing the XMl and GUI (maybe GTK, FLTK or Qt) together. Directx... ugh.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Project Lost Tomorrow recruiting Programmers and Sound Engineers
    By chewtoy in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 12-07-2005, 04:02 AM
  2. I lost my laptop, DVD and money
    By Sang-drax in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 10-01-2004, 07:13 PM
  3. lost disk
    By Benzakhar in forum Linux Programming
    Replies: 7
    Last Post: 01-11-2004, 05:18 PM
  4. Lost ID number
    By ripper079 in forum C++ Programming
    Replies: 13
    Last Post: 10-04-2002, 12:51 PM
  5. API, LOST... help
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 03-13-2002, 02:19 PM

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