Ns Res Calculator

2»

Comments

  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    ah ok lol

    but you did this program at home, right?
    I think you should try BCC...

    ps: buy a book and read it if you're moving slow lol
  • SnappleSSnappleS Join Date: 2002-11-17 Member: 9073Members
  • SoBe_DragonSoBe_Dragon Join Date: 2002-12-04 Member: 10465Members
    i got the same thing as viper
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    <!--QuoteBegin--FireStorm+Jan 20 2003, 09:35 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (FireStorm @ Jan 20 2003, 09:35 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->ah ok lol

    but you did this program at home, right?
    I think you should try BCC...

    ps: buy a book and read it if you're moving slow lol<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Yea, but I still only have Turbo C++ 3.1 and Microsoft Visual Basic C++. I used Turbo since I don't have MVB installed yet (can't find the CD) and I don't know how to use MVB yet.
  • Eater1Eater1 Join Date: 2002-12-18 Member: 11106Members
    <!--QuoteBegin--{DoA}DrunkMonkey+Jan 19 2003, 10:06 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> ({DoA}DrunkMonkey @ Jan 19 2003, 10:06 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->You'd be crazy to write that in raw C or even delphi. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    man what you talking about, VB and delphi are practically the same apart from delphi doesn`t need 7 meg of run times and doesn`t stop working after a couple of days and works whenever and whatever.

    Dude, its just a simple maths how could you not do that in raw c? you could do it in asm if you really wanted!<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    I think he means coding the GUI, not the formula... It's actually not hard, as the function to open a window is basically the same no matter what your program does, so if you're doing GUI's in C++, just write one entry function (hell, you don't even have to write it yourself, just find some windows programing tutorial, copy it, and change the dimensions/window name/etc) and then use it in each of your programs. Of course, in VB you get that nifty graphical interface for placing the controls, and unless you really really hate VB for ideological reasons (or don't want to use Delphi), there is really no reason to do such simple programs in C++ (although with more complex programs, such as graphical or 3D editors, or something fancy and windowed like that, you may have to do a GUI in C++).

    Eater.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    <!--QuoteBegin--s_viper3+Jan 18 2003, 07:07 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (s_viper3 @ Jan 18 2003, 07:07 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->If you want its source, email me <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> you can keep it and work on it.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    I did, but you never responded. Still have it? This will be helpful in out-shining everyone else in my class with my good looking programs. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • Dan_ForeverDan_Forever Join Date: 2002-08-02 Member: 1054Members
    VB is great because it has the graphical editor so you don't have to manually program everything in, so you can make quick proggies that do simple things, plus anyone with a bit of common sense could probably read it and make out what some/most of it does

    Problem is, it's useless when you try moving it to a different computer due to all the dependencies <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    <!--QuoteBegin--Dan Forever+Jan 22 2003, 12:00 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Dan Forever @ Jan 22 2003, 12:00 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->VB is great because it has the graphical editor so you don't have to manually program everything in, so you can make quick proggies that do simple things, plus anyone with a bit of common sense could probably read it and make out what some/most of it does

    Problem is, it's useless when you try moving it to a different computer due to all the dependencies <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    VB graphic editor SUCKS !!!

    look at Borland C++ Builder (Delphi has the same)

    <img src='http://hlpbm.free.fr/fs/bcb.jpg' border='0' alt='user posted image'>
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    This is what I'm used to...... This is part of the code from my RPG game. (Which is over 4,000 lines of code. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> Crappy code I might add..... <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' valign='absmiddle' alt='confused.gif'><!--endemo--> )
    cpp2.JPG 102.1K
  • mojojojomojojojo Join Date: 2002-11-01 Member: 2017Members
    No ones mentioned java - which is free! Runs on any computer! No fancy gui for gui design, but its fairly easy to write gui's.
    Eh, maybe I'm the only one who cannot afford to buy expensive software writting programs...
    ... any ns fansite webmasters want some sort of res calculator java applett on their web page? I might chuck one together. I'm trying to think of a way of putting some pretty charts in one, but I cannot think of any which would have any point to them.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    I prefer ActiveX <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo-->
    I don't like java
  • Eater1Eater1 Join Date: 2002-12-18 Member: 11106Members
    Bah... I hate Java. For one thing, it requires the Java VM thing to run (which means your typical user will probably have to run it from their web browser, which it makes it appear pretty amateur), and it's also SLOW. Very slow. Really, C++ GUI's are not that hard to write if you need something stronger than VB. Oh, and Unknown: here is a tip - when you're getting user input and don't want to check for capitalization, just convert the input string to all lower caps (or upper caps).

    Eater.
  • that_swanky_kidthat_swanky_kid Join Date: 2002-11-18 Member: 9257Members
    <!--QuoteBegin--Unknown+Jan 22 2003, 06:25 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Unknown @ Jan 22 2003, 06:25 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->This is what I'm used to...... This is part of the code from my RPG game. (Which is over 4,000 lines of code. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> Crappy code I might add..... <!--emo&???--><img src='http://www.unknownworlds.com/forums/html/emoticons/confused.gif' border='0' valign='absmiddle' alt='confused.gif'><!--endemo--> )<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Crappy code I might add<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    You got that right. Did your books and classes describe neither indentation nor comments? If not object orientation (which is admittedly at least a little beastly for C++ tho far more manageable in either Java or C#), why haven't you modularized your code?
    You definitely need to look into whitespace, indentation, commenting and modularization for a start. Either start now or learn the hard way when you go back to look at your code after putting it down for a week and not knowing where to start sucking the spaghetti...
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    This is my code... so I don't need commenting since I know what everything does and why its there. Also, I started this about 1 month after I started learning C++ and I have not had time to slim it down. I am currently in the process of making it a class and its looking pretty nifty.

    I'm only in HighSchool with the worst resources for programmers possible. We never use the book, only for refrence if we forget something. So I don't even know why I mentioned it.

    This is my style of programming.... sure, it maybe messy to your standards, but I can read it just fine. Since its just a crappy text-based RPG, there is no reason for me to make it look nice nor easily readable for others.

    I know whitespacing, indentation, and commenting, but no one said I had to use them, and as long as I know what everything means, I don't need it. I did prevously have comments in there, but the compiler was giving me a linker error because I had too much written in my files. So I got rid of all the comments, 1st year code, and created functions to stop repeated code.

    I don't know what modularization is, so I can't comment on that. I might have done something like it, but I don't know.

    This screen shot that I showed is not even 10% of the program. I showed the <b>int</b> main(), which is about 2 years old. I did not show my 11 include files though.





    As you can tell, I'm not a person to be telling constructive criticism too, so please, keep it to yourself. TY <img src='http://www.unknownworlds.com/forums/style_images/2/icon10.gif' border='0' alt='user posted image'>
  • MoonMoon Join Date: 2002-11-16 Member: 8873Members
    Hi there <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    Everyone has to start somewhere, so I wouldn't pay too much attention to negative comments. I would think it unlikely that'd you find GUI development a priority in any high-school, because there are important issues to tackle such as developing methods for breaking a problem down into components.

    Functions are a form of modularization...basically breaking a problem up into manageable pieces.

    Having said that, posting samples of your code here...probably not such a good idea because people will tend to anaylze

    <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->

    Anyways, Good luck with your studies <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    edited January 2003
    Whoops posted twice, look at the post below...
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    yeah, indent is REALLY useful...

    look at this code: this function is over 300 lines (yeah, crappy). That's some HL client code that parses a file...

    !!I WOULD BE DEAD WITHOUT THE INDENTS!!

    You don't even see the end...

    <img src='http://hlpbm.free.fr/fs/pbmparsefile.jpg' border='0' alt='user posted image'>
  • mojojojomojojojo Join Date: 2002-11-01 Member: 2017Members
    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->For one thing, it requires the Java VM thing to run (which means your typical user will probably have to run it from their web browser, which it makes it appear pretty amateur), and it's also SLOW. Very slow.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    Pah! Horses for courses, really. Its rare that the slow speed of Java is really a problem. True, you wouldn't want to write FPS or some numerical modeling algorithm in it, but how many people do that very often. The fact its a memory hog is more of disadvantage really.
    The VM thing is a bit of a pain, admitidly, but there is a free installer you can get (can't remember the name) that installs a JVM with it - and makes it easy to make several different versions of your installer for different platforms. At the cost of of having a 30meg executable. Microsoft & Sun have to just come to a behind the scence deal to put java in windows again too.

    My main argument would be that Java is the best FREE programming environment for doing GUIs and stuff.
  • JammerJammer Join Date: 2002-06-03 Member: 728Members, Constellation
    If you ever plan to code in the real world, you'll need to be able to write clean, well documented code. "But it works" is not a valid reason for crappy coding.

    And also you can streamline the gorgecheck:
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    //where you delcare the gorge data
    bool isGorge = //true or false

    if(isGorge)
    {
       //....
    }
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    W0rd.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    Also, i'd reccomend using a naming convention, like this:

    precede all class members by m_
    example: m_bIsGorge

    then, precede the names with the type:
    i = int
    fl= float
    b = bool
    sz = zero terminated string
    p = pointer
    ...

    Then the first letter of each word is in uppercase.

    for example m_pPlayer would be a class member pointer to a player.

    use the prefix g with globals; for example gEngfuncs

    This is the convention used in HL, it's called... ehm... I can't remember but I think it's good <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->
  • mojojojomojojojo Join Date: 2002-11-01 Member: 2017Members
    Its called Hungarian notation, (or its very similar).
    It is pointless, and much touted by Microsoft. I suspect it is simply to make the APIs harder to understand.
    The variable name end up discribing the type of the variable, which is the whole point of a having a typed compiler - it keeps track of the types so you don't have to.
    Give variables meaningful names. Stick to some conventions, like lower case first letter, then intercaps for word boundaries. Other than that, try and give your variable names meaning would be my advice.
    Just my opion, but I do do a fair bit of programming and have never found any advantage in hungarian notation.

    Anyway, while this thread didn't start Off-topic, I certainly think it is now.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    oh yeah it's something like that, hungarian or swedish or dutch.... something like that

    Some programmers use it, others don't...

    I prefer using it so I know what each variable really means.

    the m_ prefix is very useful if you have a lot of classes (like in HL) because you never know what the **** is that pPointerToSomething in big functions...

    And I'll tell you something: Once, I was coding an energetic shield for my mod that drains your energy (the armor value, but I changed it to energy). And sometimes, when you use all your energy and continue to hold the shield button the shield remained as long as you wanted...
    I really couldn't find why, everything seemed OK. But someone on irc told me "check of what type is the armor value". I was convinced it was an integer, but I checked to be sure... It vas:
    float armorvalue;
    great... If it were something like flArmorValue I wouldn't be trapped... you see what I mean?
    so, sometimes it can be very useful.

    I think this notation is pretty useless in small projects, but if you have milions of lines of code, believe me, it helps.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    edited January 2003
    I do use indents, but mostly only for nested loops, classes, structs, etc...

    I did have comments in that full screen pic program before, but I was getting a linker error (about the _TEXT was too big or something like that.... I don't use projects very often because most of the things I need to do for school are only 1 or 2 files big), so I got rid of some comments and copied and pasted the rest into another file with the same name (different extention though).


    so instead of something like
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->void hi //prints out the word "hi"
    {
    cout<<"hi"<<endl;
    } //end void hi<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    I would do something like this
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->void hi //prints out the word "hi"
    {
    // ...
    } //end void hi<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    Except for longer functions, I would put the first and last lines of code so I can find it a bit easier.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    and it depends on your editor. for example VC++ has a real good indenting system (for example if you write } it will unindent this line, and if you don't write ; at the end of a line it will automatically indent the next one). i don't like borland system (each line return puts the cursor below the first non-blank letter of the previous line).
    I don't know your editor, I never used it, and it probably doesn't help you with the indents... if it doesn't, try EditPlus, it has the same system than VC++.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    I believe my editor uses something like the borland system that you were talking about.


    If you press enter, it goes under your last indent. I find it ok, but sometimes it gets annoying.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    ah, ok it's bearable...

    BCB is a good prog but its code editor sucks... too bad...

    You should get used to it. It'll help you. Do indents everywhere.
  • that_swanky_kidthat_swanky_kid Join Date: 2002-11-18 Member: 9257Members
    <!--QuoteBegin--mojojojo+Jan 23 2003, 12:15 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (mojojojo @ Jan 23 2003, 12:15 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Its called Hungarian notation, (or its very similar).
    It is pointless, and much touted by Microsoft.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    For whatever it's worth, with the advent of .Net, Microsoft has deprecated Hungarian notation in favor of CAML casing. Basically Pascal notation with locals/statics/instance variables declared with lowercases. Makes sense enough as editors quickly tell you what type this and that are.
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    VC++ is quick, yes, but borland... eehhh it takes 10 seconds to display the function/variables list when you type . or -> after a variable...

    and yes, locals can be declared in lowercase that's not a problem but I prefer using this notation for class members.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    [totally off-topic post]

    LOL This thread started out as a simple NS res calculator and its become a programming class. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> I'm surprised that so many ppl downloaded the program. This topic even has over 1,000 views!

    <img src='http://www.unknownworlds.com/forums/style_images/2/icon6.gif' border='0' alt='user posted image'><img src='http://www.unknownworlds.com/forums/style_images/2/icon6.gif' border='0' alt='user posted image'><img src='http://www.unknownworlds.com/forums/style_images/2/icon6.gif' border='0' alt='user posted image'>
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    lol, yes it's completely off-topic

    ad maybe these people are interested by programming :]
Sign In or Register to comment.