Register
Email: Password:
Forum » Learning C++
  • « previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • » next
  • Learning C++

    Neoecs 18 years ago
    "HarmlessHermit" said:
    Yay! The thing to keep it from disappearing is simply adding a
    system ("pause");
    before the return 0;[/code]

    Btw is system(); a command that sends the argument to the dosprompt. like system( "Echo test" ); is the same as writing test in the console/cmd

    If anyone anytime needs help with C C++ or gameprogramming feel free to add me on MSN: <!-- e --><a href="mailto:s_manitski@hotmail.com">s_manitski@hotmail.com</a><!-- e -->
    #
    Grim Reaper 18 years ago
    Quess-a what?

    I be-a joining!

    Jep, it be true, I gots me a copy of Bloodshed Dev-C++ and have been reading a tutorial thingamajic fer c++ programming.
    #
    void 18 years ago
    w00t
    #
    Grim Reaper 18 years ago
    "void" said:
    w00t

    w00t indeed.

    You shall be presented with some Grim Apps when I have done some...

    Note: The above thing is just a joke. *Smelling pretty colors* is the best *game*.
    #
    Grim Reaper 18 years ago
    Gnyah...

    The place in *heavy space#* where I go to *smell pretty colours##* be confusing me...

    So, I must ask thee, which place be better for *smelling pretty colours,* <!-- w --><a class="postlink" href="http://www.cprogramming.com">http://www.cprogramming.com</a><!-- w --> or <!-- m --><a class="postlink" href="http://www.intap.net/~drw/cpp/">http://www.intap.net/~drw/cpp/</a><!-- m --> (I haven't tried the latter option yet, although I'll go there after I post this)?


    # *heavy space* is something the Orz in SC2 and 3 call (our) normal space
    ## *smelling pretty colours* is something the Orz say in SC2 and 3, but I use it now as an equivalent for "to learn c++"


    EDIT: I strongly advice everyone to visit (and join ) Vacuus' forums ( found here).
    #
    Rayben 18 years ago
    Anyone know how to output integers in binary form?
    There are ios flags for decimal, octagonal and hexagonal but there doesn't seem to be one for binary.. or did I miss that one?
    I tried ios::bin, binary, bit, bitwise but nothing works.
    #
    Cheery 18 years ago
    "void" said:


    The Facts:

    -Most members here are young which is the perfect time to learn.

    -Most members think of Ville as a superhero, coincadently he is a C++ programmer.

    -Most members would love to be able to make games like Ville.



    So I have given you some links to help you get started learning the language. Also some info, C++ is used by almost all professionals to make games. C is also widely used but luckly C++ accepts all C code (with very few exceptions).

    'Referring the text from beginning...'

    C++ is not a perfect language for everything.

    The biggest problem is that developing C++ code is a long and hard process. Another not less worse problem is that C++ is intended to be readable for compiler, not for a person so you have to make it readable yourself.

    I would rather tell people to learn C and design stuff.
    C does have simpler syntax than C++ has.

    I would say C++ is a waste of time if the bigger companies wouldn't use it.

    Some people still live on nineteens and think program speed is the major goal when designing software. There are few another things to notice too.

    These another things to notice are: Program features in overall performance, usability, reliability and last, time elapsed to develope a program. The last point is the most important but it shouldn't get into a head. Is a gamemaker quickly done game reliable and usable?

    Myself I noticed C++ doesn't fullfill the 'fast development time'. The syntax is really slow to write.

    Only thing I had to do were taking in an another language which would work as good 'just do it' language while C or C++ would be the tool to write parts where speed is the key of performance.

    So I had three choices: C#, Java or Python I were heard before somewhere.

    C# were immediately out because it's owned by microsoft. I could wait bad syntax, Long lines of code, poor standards, high quality looking low quality IDE, low reliability, no cross platform and high overhead and bloatness. 'hey wait this is not what I want!!!' It would definetly be worse than C.

    I had experiences from Java, it has exactly same problems as C have: long development time, bad readability. Also it had rather big overhead.

    Python were my 'last plate of soup'. It has a completely different syntax designed for common humen. It doesn't need any IDEs between code and developer. Also it had a excellent quality standard library coming with all kind of usefull stuff. Python were just for me! It has small size, it were fast, simple to learn... I disappointed it's C interface layer were ugly, but I found a pyrex which allowed me to extend python, pyrex is a language designed to write python modules. Also this whole thing has a smallest overhead I ever have seen!

    This started my development with python & C hybrides.

    Try python yourself!
    http://python.org/
    #
    Grim Reaper 18 years ago
    I gots me some questions:

    1. How can I make a 2d array?
    2. How can I store characters, symbols and other markings in a 2d array?
    3. How can I make an object (or something else) that can be controlled to move about using a 2d array containing characters, symbols etc. as a background?

    Example:
    #########
    #.......#
    #.......#
    #.......#
    #.......#
    #########
    /\ the symbols contained within the 2d array
    @ < the symbol representing the player
    \/ the player moving about the array
    #########
    #.......#
    #.......#
    #...@...#
    #.......#
    #########


    4. How could I store the X and Y positions of the player inside the array? (this one I think I have pretty much figured out, asked anyway)
    5. How could I do so that the player can't go through some "tiles" while he can go through some other ones (best thing I've figured out is a 2d array storing different types of numbers depending on what type of tile there is)?
    6.How could I create objects (or something like that) that change their appearance once the player hits them (=switches)?
    7. How could I make it so that once a switch is hit, something happens in that (or in some other) room?
    #
    Cheery 18 years ago
    "Grim Reaper" said:
    I gots me some questions:

    1. How can I make a 2d array?
    --------------------------------
    you make array of arrays.

    Speudo:
    map =
    [
    [1,1,1,1,1,1],
    [1,0,0,0,0,1],
    [1,0,0,0,0,1],
    [1,0,0,0,0,1],
    [1,0,0,0,0,1],
    [1,1,1,1,1,1],
    ]
    --------------------------------
    2. How can I store characters, symbols and other markings in a 2d array?
    --------------------------------
    Depends about a language. You don't have to use that array, you can use also separate object array.

    In some case you can structure your cell.

    Speudo:
    class Cell:
    objects = []
    type = 'wall'
    __init__(self, type = 'wall'):
    self.type = type

    # Turn your original array into a celled map.
    map =
    --------------------------------
    3. How can I make an object (or something else) that can be controlled to move about using a 2d array containing characters, symbols etc. as a background?
    --------------------------------
    You have a reference into that character on your map.
    then you just find out where he is, and move him from cell into another.
    --------------------------------
    4. How could I store the X and Y positions of the player inside the array? (this one I think I have pretty much figured out, asked anyway)
    --------------------------------
    Descbrided above.
    --------------------------------
    5. How could I do so that the player can't go through some "tiles" while he can go through some other ones (best thing I've figured out is a 2d array storing different types of numbers depending on what type of tile there is)?
    --------------------------------
    you put the behauvior into tile type.
    --------------------------------
    6.How could I create objects (or something like that) that change their appearance once the player hits them (=switches)?
    --------------------------------
    you can make a callback or event system('switch') which allows you to attack a extra behauvior into the cell. In event system, it must have some fallbacking ( ie. can character step on it? ) because information is not immediately processed in that case.
    --------------------------------
    7. How could I make it so that once a switch is hit, something happens in that (or in some other) room?
    --------------------------------
    you set behauvior into a 'switch'.
    #
    Grim Reaper 18 years ago
    Good news, I found out how to use a 1d array instead of a 2d one, so things got a bit more simple.

    Now I'm gonna go through NetHack's source code to get the codings on checking if the arrow keys have been pressed...
    #
    Zombie 18 years ago
    I need to learn to program now...

    You all are confusing me.
    #
    Grim Reaper 18 years ago
    I'm sorry if I'm confusing you in any way, Zombie.

    Anywho, the source for NetHack was WAY too complicated for me...

    Can anyone tell me how to check if the arrow keys/WSAD(or some other character keys)/NumPad keys are pressed?
    #
    Rayben 18 years ago
    I need help!

    Here's my func:
    Card Deck::dealTop()
    {
    Card temp = _deck.front(); //_deck is a list
    _deck.pop_front();
    return temp;
    };


    But when I create a deck and call dealTop() like this:
    Deck aDeck():
    aDeck.dealTop();

    I get this cryptic message:
    request for member `dealTop' in `aDeck', which is of non-aggregate type `Deck ()()'

    Now just what the shizzle is that supposed to mean? And how can I fix it?
    Anyone?
    #
    void 18 years ago
    Try this

    Deck aDeck;


    instead of

    Deck aDeck(); 


    that.
    #
    Rayben 18 years ago
    Thanx void!

    Now I understand the error message too.
    But what I don't get is why I have to omit the "()" when declaring an instance of the Deck, even if it has default parameters.
    Or maybe I'm confusing it with Java.

    Anyway, thanx again!

    Edit: By the way, your suggestion worked
    #
    Forum » Learning C++
  • « previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • » next
  • Post Reply


    Your email:
    Your name: