473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Flash a random number

14
Hi all,

How to flash a random number in c/c++?

Kindly help...

Regards,
Kishore
May 10 '09 #1
8 2129
JosAH
11,448 Expert 8TB
@APmore
flash a random number?

kind regards,

Jos
May 10 '09 #2
APmore
14
@JosAH
I mean to blink a random number on screen for every 10ms...


Ok?

Thanks,
kishore
May 10 '09 #3
boxfish
469 Expert 256MB
Blink a random number on the screen? Do you want to show this number in the console, just printed with cout?
May 10 '09 #4
APmore
14
@boxfish
yaa blink the number on console
May 10 '09 #5
boxfish
469 Expert 256MB
Pseudocode goes something like

Expand|Select|Wrap|Line Numbers
  1. while (true) {
  2.     wait for 10 ms
  3.     generate random number
  4.     display number
  5.     wait for 10 ms
  6.     backspace number
  7. }
Which of these things are you having trouble with?
May 10 '09 #6
APmore
14
@boxfish
How to wait for 10ms exactly?
May 11 '09 #7
boxfish
469 Expert 256MB
the clock() function from the <ctime> include file tells you how many clock ticks have passed since your program was launched. You can divide it by CLOCKS_PER_SEC to get this length in seconds. I would define a constant
CLOCKS_PER_10MS = CLOCKS_PER_SEC / 100;
So to wait for 10MS, Take the current clock value, add CLOCKS_PER_10MS to it, and use a while loop to wait for clock to be greater than that value. It should actually be very similar to the wait() function in the example on the page I linked to.
I hope this is helpful.
May 11 '09 #8
APmore
14
@boxfish
Yaa ..I think this is a good alternative..

Keep it up!!

Thanks,
Kishore
May 11 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Vandana Rola | last post by:
Hi Everyone, Description: I have created flash cards using html layers, jpegs, and javascript. The way I designed it is, I have words and their descriptions (meaning) as jpeg files. Each word...
1
by: Terry Haufler | last post by:
I am trying to swap/rotate random flash banners using the following Javascript code. I have 3 flash headers/banners. I can get it to open a page with a random header using...
3
by: Jess | last post by:
I have tried all of the solutions given by other members on how to load a random .swf file on the load of the page, however, none of them seem to work on my site. The problem is in embedding the...
1
by: Nawed | last post by:
We are experiencing a browser freeze when implementing a large number of javascript calls. It seems that there is a random 'hiccup' which loses some data. This causes a disparity between client-...
5
by: Ravenshield | last post by:
Hi there all. (first of all, sorry about my bad english) I need some help over here. I'm developing an asp.net application that works as an administrator site for other application built in flash....
1
by: danka21819 | last post by:
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I...
1
by: danka21819 | last post by:
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I...
1
by: danka21819 | last post by:
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.