save me from getting "F"

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: save me from getting "F"

 
0
  #11
Apr 24th, 2006
You have two options.

You can use the <time.h> file.

Or Sleep from <windows.h>

Although, you haven't told us how you're handling the GUI...

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 7
Reputation: neno14me is an unknown quantity at this point 
Solved Threads: 0
neno14me neno14me is offline Offline
Newbie Poster

Re: save me from getting "F"

 
0
  #12
Apr 24th, 2006
well what functions i have to use in time.h and i like to dispaly timer constantly in the same place..tell me what functions display timers like i have to start timer when the game starts and end it when it ends..
i have made cell class and made it friend of the main minesweeper class and then i`ve made input class and it is a friend too of the minesweeper class.plz reply me about the time.h class
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: save me from getting "F"

 
0
  #13
Apr 24th, 2006
>i like to dispaly timer constantly in the same place

If you're using windows, you have to clear the screen to give the illusion of a constantly updating timer.

I assume you're doing this from a console window... although you haven't said. And you haven't told us which operating system you are using, so I'm assuming you're using windows.

>tell me what functions display timers like i have to start timer when the game starts and end it when it ends.

I would rather use the Sleep function than the stuff from <time.h>...

When you eventually decide to answer these questions...

How are you handling the GUI components of the game?

1. Use a rather hackish console display with <windows.h> commands
2. Use win32 -yuck
3. Use mfc - yucky
4. Use C# - yay.

What operating system are you using?

Then I can proceed to try answer your questions more specifically.

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: save me from getting "F"

 
0
  #14
Apr 24th, 2006
Originally Posted by iamthwee
I would rather use the Sleep function than the stuff from <time.h>...
Use the
  1. clock
function. If you use the
  1. sleep
function you will have to implement a clock function from scratch.

Originally Posted by iamthwee
1. Use a rather hackish console display with <windows.h> commands
2. Use win32 -yuck
3. Use mfc - yucky
4. Use C# - yay.
A more reasonable comparison will be
1. Use a rather hackish console display with <windows.h> commands
        Adv - Simple, use C++
        Disadv - Ugly

2. Use win32 -yuck ( for newbies perhaps )
        Adv - faster, smaller executable, better control of the program, use C++
        Disadv - difficult if you don't have the guts and time

3. Use mfc
        Adv - Easier than using Win32 API, same look and feel, use C++, a lot of examples in the internet especially www.codeproject.com 
        Disadv - A slightly larger executable, less control on the program

4. Use Managed C++
        Adv - Easier than using Win32 API and perhaps MFC, same look and feel, use C++
        Disadv - Don't know much about this, but less number of examples in the net.

5. Use C# -
        Adv - None that I can think of but Iamthwee is welcome to disagree ;) 
        Disadv - Learn C#, port your C++ program to C#...
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 7
Reputation: neno14me is an unknown quantity at this point 
Solved Threads: 0
neno14me neno14me is offline Offline
Newbie Poster

Re: save me from getting "F"

 
0
  #15
Apr 24th, 2006
Hey Fellas,

I was wondering if I could write a simple code that erases the input display information once a user enters it. For example, I was going to write a simple program that asks for the user's name and then have the trailing display information erased from the program. Here's the code that I wrote:


#include <iostream>
using namespace std;

int main ()

{

char name [10];

cout << "May I have your name please?" << endl;

cin >> name;

cin.ignore();

cout << "Hey, " << name;

cin.get();

return 0;

}
When the user enters their information their screen would look like this:

May I have your name please? You
Hey, You

....so my question basically is how do I get rid of "May I have your name please?" so that it looks like this on their screen:

Hey, You

____
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: save me from getting "F"

 
0
  #16
Apr 24th, 2006
>I was going to write a simple program that asks for the user's name and then have the trailing display information erased from the program.

You need to clear da screen... Tee he he. So you're using a console based GUI then?

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: save me from getting "F"

 
0
  #17
Apr 24th, 2006
Check this exampleby Dave Sinkula. It is fairly simple. If you want a more complicated one, there is an example by me in the same thread. But I think Dave's example will do.

Edit: Looks like Dave's example will work only for overwriting the same line. Not sure though. You can find out yourself. If that is the case, maybe my example will be the only way.
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: save me from getting "F"

 
0
  #18
Apr 24th, 2006
If you come over to the java forums I'll show you how to make it pretty.
:lol:

[tries to recruit a java newbie]

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 244
Reputation: Drowzee is an unknown quantity at this point 
Solved Threads: 5
Drowzee Drowzee is offline Offline
Posting Whiz in Training

Re: save me from getting "F"

 
0
  #19
Apr 24th, 2006
I knew there was something evil about you...
Explainer of control logic and some basics.
"If you seek to drink from a fountain of knowledge, make sure your cup is big enough."
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: save me from getting "F"

 
0
  #20
Apr 25th, 2006
Originally Posted by Drowzee
I knew there was something evil about you...
Little ol' me, no?

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC