Hell_Demon (06-01-2011),Lyoto Machida (06-01-2011)
It's not necessary to use a class there. It's just that the code could be improved (a lot), but that comes with practice and time. Don't worry too much about it. You will eventually improve with time. : )
Light travels faster than sound. That's why most people seem bright until you hear them speak.
Hell_Demon (06-01-2011),Lyoto Machida (06-01-2011)
Nice going. Again you edited my comment, I'm starting to think you have a sexual relationship to Virtual Void.
Yes, no need for classes here.
But CLEARLY, this code could be minimized to probably 300-400 lines of code easily just using for loops.
But aside from that, good job.
Favourite quotes:
Definition of computing: The use or operation of computers.Code:I don't need easy, I just need possible. ~ Me There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
Turning on my computer = computing = programming
LAWLFAIL
Lyoto Machida (06-01-2011)
Meh, it'd be a LOT neater.
But, if you really are so against using loops. I've found a few ways to remove many lines of code (at least 50-60) without loops.
But I'm at school and can't really do much right now. :P
EDIT:
Oh, and I also found a way to make the UI a bit more appealing, by adding a few more lines of code. But meh, it's a great program all in all.
And I just noticed, you use if (Player == 'x' || Player == 'X');
Why not use the toupper function?
Player = toupper(Player);
PLUS! It gave me a GENIUS idea to make an RPG on a console application.
Last edited by VvITylerIvV; 06-01-2011 at 02:13 PM.
Favourite quotes:
Definition of computing: The use or operation of computers.Code:I don't need easy, I just need possible. ~ Me There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
Turning on my computer = computing = programming
LAWLFAIL
lol nice game but its so boring
ỳô шнат’ŝ чр, §üçжа
ɳɨʛɢa
Most Trusted Buyer/Seller on MPGH is nysm1
Previous names: yoyobasha
VvITylerIvV (06-01-2011)
Nah, thank you for showing me the getasynckeystate is usable in console applications. I never realized that...
Favourite quotes:
Definition of computing: The use or operation of computers.Code:I don't need easy, I just need possible. ~ Me There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
Turning on my computer = computing = programming
LAWLFAIL
Lyoto Machida (06-01-2011)
Loops aren't slow.
Thats the proper way to check for a key press.Code:if (GetAsyncKeyState(VK_SOMETHING) & 0x800)
for loops are somewhat slow... A LITTLE slower than placing the code there, but makes the code a lot more easy to manage and read.
(seeing as they have like 2 more checks every time they do the code, it slows it down unnoticeably unless you time them both for about 40 hours or so...)
Favourite quotes:
Definition of computing: The use or operation of computers.Code:I don't need easy, I just need possible. ~ Me There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
Turning on my computer = computing = programming
LAWLFAIL
Any loop can and will be unrolled by the compiler if deemed necessary.
Originally Posted by MSDNWoops, its 0x8000 not 0x800. 0x8000 is a bit mask checking if the highest bit in the return value, which is a short, is set.Originally Posted by MSDN
Lyoto Machida (06-02-2011),WildPancake (06-02-2011)
If your using getasynckeystate in more advanced ways, not including 0x8000 will screw up your program due to this new thing called multithreading which wasn't around when getasynckeystate was created.
So if it has a chance to screw up your program, you SHOULD have enough experience to know how to fix it. Logically.
Favourite quotes:
Definition of computing: The use or operation of computers.Code:I don't need easy, I just need possible. ~ Me There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
Turning on my computer = computing = programming
LAWLFAIL