A quick question

This is a discussion on A quick question within the Game Programming forums, part of the General Programming Boards category; Hey guys, I want to make a very basic and very simple text based game on my IDE. I am ...

  1. #1
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475

    A quick question

    Hey guys, I want to make a very basic and very simple text based game on my IDE. I am using bloodshed dev C++. I have some practice in C++ behind me.

    For this, I know I will have to use iostream and cout and endl, maybe also printf. I will not use the GOTO function but will use WHILE loops instead. Anyway, do any of you know the best way to begin? I know BASIC really well, and im excited to learn a more mature language.

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    By the sound of it you need to go through some tutorials and learn more about C/C++ first.
    Learn why loops are better than using gotos, familiarise yourself with the standard library and/or the STL and in time you will just know how to write a text-based game. If you are too eager to go back and read a book then start your project and when you have a problem show us your code and we will help you out.

  3. #3
    He's trying.
    Join Date
    Apr 2005
    Location
    Missouri, US
    Posts
    70
    I'm actually trying something like this right now - not w/ Win32 or graphics or anything crazy yet - I promise it's difficult enough already. It's a lot of fun though and I'm learning a lot.

    Do make sure you keep your code clean and organized. You usually don't notice how messy it is until you have to go back and change something (which you'll have to do often). I'd also super-heavily advise against using arrays - #include <vector> as they're a lot more flexible.

    Good luck!
    Last edited by Nazca; 05-22-2005 at 08:28 PM. Reason: @STL

  4. #4
    and the Hat of Clumsiness GanglyLamb's Avatar
    Join Date
    Oct 2002
    Location
    between photons and phonons
    Posts
    1,109
    Quote Originally Posted by Nazca
    I'd also super-heavily advise against using arrays - #include <vector> as they're a lot more flexible.
    Just a quick question on this one, i was thaught in school that vectors use much more memory then arrays because of their flexibility and therefore we should very carefully consider the use of vectors, is this true?

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    Quote Originally Posted by GanglyLamb
    Just a quick question on this one, i was thaught in school that vectors use much more memory then arrays because of their flexibility and therefore we should very carefully consider the use of vectors, is this true?
    I know little about the STL and I have never used vectors but the way I see it is, if you need to use an array, use one. If you need to use a vector, use one. There is no need to exclusively pick one over the other.

  6. #6
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by GanglyLamb
    Just a quick question on this one, i was thaught in school that vectors use much more memory then arrays because of their flexibility and therefore we should very carefully consider the use of vectors, is this true?
    No, it's not true.
    Vectors has virtually no speed overhead compared to arrays. As for size, an extra 4 bytes (or so) per vector are used to store its size and I cannot see a problem with that.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #7
    Registered User
    Join Date
    Aug 2003
    Posts
    1,198
    On any morden computer an extra 12 bytes or whatever it is wont do a difference. If that becomes a problem you are probably doing something wrong and should rethink your approach.

  8. #8
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by swgh
    I know BASIC really well, and im excited to learn a more mature language.
    What makes BASIC not mature? There was a BASIC compiler released maybe a month or two ago called FreeBASIC. Nothing about that compiler that is not mature. Last I knew it was available only for Windows, Linux, and DOS but could easily be ported to another OS. It can handle all the libraries C can which includes SDL, OpenGL, and DirectX.

    www.freebasic.net

    It is currently at version 0.13 beta. Works pretty well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM

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