Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,420 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,981 people online right now. Registration is fast and FREE... Join Now!




simple Science project

 
Reply to this topicStart new topic

simple Science project

Jingle
25 Jan, 2008 - 07:32 PM
Post #1

D.I.C Head
**

Joined: 20 Oct, 2007
Posts: 249


My Contributions
I just need to know how to make my program delay for a specific time.
I have looked into time.h but it doesn't seem to have what I want.
It needs to be platform independent.
the Idea is to find out how fast the brain computes what the eyes se and if it changes for different people.
so I have put together a quiz/survey in c++(for now latter I will put it on a website) all it dose is prints a word or frase then prints a block so the question is if you can read the word or if all you see is a blurr.

I realize i have not done a very good job of explaining it so if you want to know more just ask.

This post has been edited by Jingle: 25 Jan, 2008 - 10:08 PM
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Simple Science Project
25 Jan, 2008 - 07:41 PM
Post #2

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
are you trying to do kind of that thing that the you click the button for the screen to turn into a different color and once you see the color you hit the button again and it test how quick you responded...???
User is offlineProfile CardPM
+Quote Post

Jingle
RE: Simple Science Project
25 Jan, 2008 - 07:57 PM
Post #3

D.I.C Head
**

Joined: 20 Oct, 2007
Posts: 249


My Contributions
QUOTE(B-Boy209 @ 25 Jan, 2008 - 08:41 PM) *

are you trying to do kind of that thing that the you click the button for the screen to turn into a different color and once you see the color you hit the button again and it test how quick you responded...???

no
the idea is not to test reflexes but how fast you se stuff.

years back i heard about a guy who did some cool studies. he would take people and put a watch type thing on there wrists that blinked numbers.
it blinked them so fast the people could not se the actual number just a blurr of light. then he pushed them of buildings and found that when they were falling
their brains would go up a notch and they could actually read the numbers. when people are in a accident often they say it felt like the world went slow mow.
this was a study to prove it.

my question is if different people have different speeds that thy could see the numbers. and what might affect that.

the problem is i cant find any info on the study and have lost what I actually had to I'm just going of memory here.
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Simple Science Project
25 Jan, 2008 - 08:34 PM
Post #4

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,463



Thanked: 10 times
Dream Kudos: 325
My Contributions
QUOTE(Jingle @ 25 Jan, 2008 - 08:57 PM) *

then he pushed them off buildings

blink.gif

This post has been edited by Tom9729: 25 Jan, 2008 - 08:34 PM
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Simple Science Project
25 Jan, 2008 - 08:44 PM
Post #5

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
yeah i get it now...and yeah during accidents things go slow...once i got shot at and when i turned around i (no joke) actually remember seeing the window brake slowly and you dont see(like actually see) the bullet but you see it dont know how to explain...but yeah i get what you tryin to do...
User is offlineProfile CardPM
+Quote Post

Jingle
RE: Simple Science Project
25 Jan, 2008 - 09:51 PM
Post #6

D.I.C Head
**

Joined: 20 Oct, 2007
Posts: 249


My Contributions
I did forget to mention the safety cords and nets didn't I OOPs biggrin.gif

This post has been edited by Jingle: 25 Jan, 2008 - 10:10 PM
User is offlineProfile CardPM
+Quote Post

VernonDozier
RE: Simple Science Project
25 Jan, 2008 - 10:17 PM
Post #7

New D.I.C Head
*

Joined: 6 Jan, 2008
Posts: 46

Well, you can use the "sleep" command (or "Sleep" if you are using <windows.h> library). Sleep/sleep is one of those non-standard things, I think. I got a few errors when I put it in lower case and didn't capitalize it. It may be one of those system and compiler specific, non portable things. I did this in Dev C++ on Windows XP. But if you wanted to, say, display the word "hello" to the screen for 100 milliseconds, then clear the screen, you could do this:


CODE

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
   cout << "Hello" << endl;
   Sleep(100); //Sleep for 100 milliseconds

   // code to clear screen and ask user what word they saw

   return 0;
}


Not sure whether you are doing a console application or a GUI or what, or if this is what you're looking for.
User is offlineProfile CardPM
+Quote Post

rockey
RE: Simple Science Project
26 Jan, 2008 - 03:26 AM
Post #8

D.I.C Head
**

Joined: 2 Jan, 2008
Posts: 57


My Contributions
You can also use the delay command. It's also a non-standard keyword.
First input prototype

CODE

#include <iostream>
#include <dos.h>
using namespace std;

int main()
{
   cout << "Hello" << endl;
   delay (10)

   // code to clear screen and ask user what word they saw

   return 0;
}



User is offlineProfile CardPM
+Quote Post

Jingle
RE: Simple Science Project
26 Jan, 2008 - 07:28 AM
Post #9

D.I.C Head
**

Joined: 20 Oct, 2007
Posts: 249


My Contributions
thank you these will be very helpful but i also need something that will work on a mac so if anybody has any good ideas.

I'm not using GUI.

This post has been edited by Jingle: 26 Jan, 2008 - 10:57 AM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:26AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month