| | |
How can i more control rand()
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
>As I can say "Build an operating system." is a single step
It is, but you have to increase the granularity of your steps to come up with reasonable milestones. I find it somewhat humorous that you compare building an operating system to a trivial twenty line homework program.
>My recent interaction with low level languages are responsible for this.
That's a bad thing. Even at the lowest level you still need to keep an abstract view of your design.
It is, but you have to increase the granularity of your steps to come up with reasonable milestones. I find it somewhat humorous that you compare building an operating system to a trivial twenty line homework program.
>My recent interaction with low level languages are responsible for this.
That's a bad thing. Even at the lowest level you still need to keep an abstract view of your design.
Last edited by Narue; Jun 9th, 2009 at 11:15 am.
I'm here to prove you wrong.
A day ago csurfer's algorithm solved the problem. That's "pipelined" version:
In addition: it's impossible to add another level of randomness by random shuffles or other tricks while we are using the same (extremely bad
) rand() generator.
c Syntax (Toggle Plain Text)
int i, j = rand()%20; for (i = 0; i < 20; i++) array[i] = (i != j)*(rand()%9 + 1);
) rand() generator. >I find it somewhat humorous that you compare building an operating system to a
>trivial twenty line homework program.
Then my purpose was solved.
>That's a bad thing. Even at the lowest level you still need to keep an abstract
>view of your design.
The program I was interacting with were very trivial ( prime number generator ). It was in a algorithm book. There, the author used a ASM, to demonstrate that what a high-level program assumes to be `a step' is actually a series of steps in machine code.
But you said it right, one should be able to `quantize' a step. It also varies from person to person and to which domain he is working.
>it's impossible to add another level of randomness by random shuffles or other
>tricks while we are using the same (extremely bad ) rand() generator.
She assumed a perfect random generator while making that remark, IMHO. And she was right too. More random calls will tend to dilate the variance. (of course, I am too, making this remark assuming a perfect random generator)
>trivial twenty line homework program.
Then my purpose was solved.
>That's a bad thing. Even at the lowest level you still need to keep an abstract
>view of your design.
The program I was interacting with were very trivial ( prime number generator ). It was in a algorithm book. There, the author used a ASM, to demonstrate that what a high-level program assumes to be `a step' is actually a series of steps in machine code.
But you said it right, one should be able to `quantize' a step. It also varies from person to person and to which domain he is working.
>it's impossible to add another level of randomness by random shuffles or other
>tricks while we are using the same (extremely bad ) rand() generator.
She assumed a perfect random generator while making that remark, IMHO. And she was right too. More random calls will tend to dilate the variance. (of course, I am too, making this remark assuming a perfect random generator)
Siddhant Sanyam
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
>^ so.... whatever happened to June 6th?
The plan stretched. Didn't bother to change the signature. (I know this is ignorance). Long story!!...
The plan stretched. Didn't bother to change the signature. (I know this is ignorance). Long story!!...
Siddhant Sanyam
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
![]() |
Similar Threads
- Unable to access my computer, my documents, and control from start bar and run!! (Windows NT / 2000 / XP)
- warning C4715: 'Wagering::wageringTest' : not all control paths return a value (C++)
- Using the rand() function in C (C)
- spyware has taken control of my pc (Viruses, Spyware and other Nasties)
- Tabbed Control Dialog (Visual Basic 4 / 5 / 6)
- Problems with control panel _>Internet options (Windows 95 / 98 / Me)
Other Threads in the C Forum
- Previous Thread: Array question
- Next Thread: fgets
| Thread Tools | Search this Thread |
#include * ansi append array arrays asterisks bash binarysearch centimeter changingto char character convert copyimagefile cprogramme creafecopyofanytypeoffileinc database dynamic execv feet fgets file floatingpointvalidation fork framework function getlogicaldrivestrin givemetehcodez grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop initialization input interest intmain() iso kernel keyboard kilometer license linked linkedlist linux list lists locate looping lowest matrix meter microsoft number oddnumber opendocumentformat openwebfoundation overwrite owf pdf pointer posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprograming socketprogramming standard strchr string suggestions systemcall test testing threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi






