collapse collapse

* Who's Online

  • Dot Guests: 15
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Board Stats

  • stats Total Members: 88
  • stats Total Posts: 11163
  • stats Total Topics: 1699
  • stats Total Categories: 4
  • stats Total Boards: 76
  • stats Most Online: 248

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Luizfe

Pages: [1]
1
Beta Releases / Luizfe's Text-Based MonsterKilling BETA
« on: December 08, 2009, 08:47:40 am »
Well, I was reading the 16th C++ tutorial, and I was bored, so, I made this with the knowledge of C++ that I have so far.

It's pretty much basic.

Code: C++
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5. void Damage();
  6.  
  7. int monsterdmg = rand()%4;
  8. int playerhp=15;
  9. int monster=10;
  10. int type=1;
  11. int damage = (type==1)?(2):(1);
  12. string strSelection;
  13. string stryes = "y";
  14. string strYes = "Y";
  15.  
  16. void Damage(){
  17.      srand (GetTickCount());
  18.      cout << "\nDealing " << damage << " damage!\n";
  19.      monster -= damage;
  20.      cout << "\nThe monster has " << monster << "HP!\n\n";
  21.      cout << "The monster attacks back!\nIt deals " << monsterdmg << " damage!\n";
  22.      playerhp -= monsterdmg;
  23.      cout << "\nYou now have " << playerhp << "HP!";
  24.      if(monster>1){
  25.                   cout << "\n\nDo you want to attack again? Y/N\n";
  26.                   cin >> strSelection;
  27.                   if(strSelection==strYes, strSelection==stryes){
  28.                                            Damage();
  29.                   }
  30.                   else {
  31.                        cout << "You flee the battle.";
  32.                   }
  33.       cin.ignore();
  34.       getchar();
  35.      }
  36. }
  37.  
  38. int main(){
  39.       cout << "A monster appeared!\nIt got " << monster << "HP!\n";
  40.       cout << "Attacking monster! ";
  41.       cout << "Monster is of the type " << type << endl;
  42.       Damage();
  43.       return 0;
  44. }

P.S: Use y (small caps) for yes, n (small caps) for no.
P.S.S: It comes with the .cpp, so you can see the code and help me/suggest me new stuff, but, there's the .cpp code on the post, if you're lazy to dl it.

2
Visual Basic / Read D:
« on: November 14, 2009, 07:15:11 pm »
We have no VB tuts here.

I'll be happy if someone could help me with it, because I feel like starting from simple (VB) to more complex (C++)

Either if you could write a tutorial, link me to a good tutorial, etc.

Thanks in advance,
Luizfe.

3
2D Graphics / [Luizfe] Most recent tag.
« on: November 11, 2009, 09:19:02 pm »


fuxpro.

if you want one, hit me up.

4
Introductions / 'sup everyone?
« on: October 21, 2009, 04:35:49 pm »
Well, I've been lurking for a while now, but I just noticed I've never posted here.
'ello guise.
Isaro invited me here once, months ago, when I wanted to learn how to code, but I was lazy.
I think I'll try again.

This forum looks clean, organized, and cool.

So yeah, hi.

Pages: [1]

Donate


* Search


* Recent Posts

Image Comparison by Shishka
[May 15, 2017, 01:18:02 pm]


Re: srchub - free source code hosting by Nathan
[December 14, 2015, 11:37:02 pm]


Re: srchub - free source code hosting by Celestialkey
[November 27, 2015, 08:51:42 am]


Updates by Nathan
[October 30, 2015, 08:27:36 pm]


Re: Client-Server Messaging by Nathan
[October 25, 2015, 05:48:57 pm]