Jump to content
  • Advertisement

Kalner

Member
  • Content Count

    23
  • Joined

  • Last visited

Community Reputation

120 Neutral

About Kalner

  • Rank
    Member
  1. Kalner

    What games to create first?

    Well you can try a text based RPG (basics atleast) and then build onto it with new stuff you want to try out.
  2. Well Steam is a huge one. Other than that you can make a website and do stuff from there with paypal or whatnot.
  3. So I noticed that both for and while loops have a infinite loop option, is there any difference between them? 
  4. Kalner

    Java or C++?

    Listen to evreybody here, I made the mistake of starting with c++, probably going to c# because I will probably forget all syntax's for c++ if I go java. If you wanna go c++ later c# would probably be better because you will have a headstart with the different syntax's.
  5. Say I have a switch statement with certain parameters, but when someone doesn't input what it ask's, I want the default to go back to the switch statement instead of making another one.
  6. Just asking if it is possible to declare variables outside int main, any functions and outisde classes?
  7. Kalner

    Where can I learn C++

    i used thenewboston's tutorials they are fun but he doesn't teach as much as "boring" websites do.
  8. Kalner

    Wierd Code 0.o

    still dont get it...
  9. Kalner

    Wierd Code 0.o

    So today I was getting into reading more on classes and I read on classes in seperate files and it was like Myclass::Myclass or something so.. what does the "::" mean??
  10. Kalner

    Switch and If/else C++

    Thanks alot guys, especially nife87 and rip-off, you guys got me to fix it then mkae the whole think smaller. =D my first game is complete EDIT: forgot to mention you Jebbles =D
  11. Kalner

    Switch and If/else C++

    sorry I was rushing to get it finished but I get no error messages when I put break points after 'M' and 'D' also when I put semi colons. Th eproblem is that the if statement completely doesnt work. Example: I choose E as difficulty I press 6 as my geuss Than if I am right it says "You Lost" " The number was 6" when I chose 6 and if I choose 7 it will proerly display 6 beacuse I got it wrong.
  12. Kalner

    Switch and If/else C++

    Here it is. #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; class Win{ public: void setWin(string x){ win = x; } string getWin(){ return win; } private: string win; }; class Loss{ public: void setLoss(string z){ loss = z; } string getLoss(){ return loss; } private: string loss; }; int main() { int number = 0; char gn; char dif; srand(time(0)); Win wo; wo.setWin("You Won!"); Loss lo; lo.setLoss("You Lost, the number was "); cout << "Welcome to Guess The Number 3.0" << endl; cout << "Please choose your difficluty. E = Easy M= Medium H = Hard" << endl; cin >> dif; switch(dif){ case 'e': case 'E': number = 1+(rand()%10); cout << "Guess a number beetween 1 and 10" << endl; cin >> gn; if(gn == number){ cout << wo.getWin()<<endl; system("PAUSE"); } else{ cout << lo.getLoss() << number << endl; system("PAUSE"); } break; case 'm': case 'M': number = 1+(rand()%25); cout << "Guess a number beetween 1 and 25" << endl; cin >> gn; if(gn == number){ cout << wo.getWin()<<endl; system("PAUSE"); } else{ cout << lo.getLoss() << number << endl; system("PAUSE"); } case 'd': case 'D': number = 1+(rand()%50); cout << "Guess a number beetween 1 and 50" << endl; cin >> gn; if(gn == number){ cout << wo.getWin()<< endl; system("PAUSE"); } else{ cout << lo.getLoss() << number << endl; system("PAUSE"); } default: number = 1+(rand()%100); cout << "Fine I made it hard for you." cout << "Guess a number beetween 1 and 100!" cin >> gn; if(gn == number){ cout << wo.getWin() << endl; system("PAUSE"); } else{ cout << lo.getLoss() << number << endl; system("PAUSE"); } } }
  13. Kalner

    Switch and If/else C++

    ah ok.. lemme get to you on that in a few minutes
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!