repetition within randomization

Tech-Archive recommends: Fix windows errors by optimizing your registry



A person on another pc, running my app, reported to me that in some
instances where I call rand( ), there is little or no change. For instance,
I may use

int r = rand( ) % 4;
switch(r)
{
case 0:
// draw a particular emf
break;
case 1:
// draw a particular emf
break;
case 2:
// draw a particular emf
break;
default: // case 3:
// draw a particular emf
break;
}

and get a recurring result that doesn't feel very random. I have
experienced this myself and realize that repetition happens in
randomization. I also have read that my initial call to srand(
GetTickCount() ) does not need to be repeated in a session. I guess I'm
mostly fishing for comments on this situation in which I do not want to
compare previous values as a means to avoid repetition. Is this simply what
I should expect in pseudo-randomization?


.



Relevant Pages

  • Re: repetition within randomization
    ... General advice is to use the middle bits, or use a real random number ... instances where I call rand(), there is little or no change. ... // draw a particular emf ...
    (microsoft.public.vc.mfc)
  • RE: Implementing watermarks in the print processor
    ... It is not advisable to modify spoolers EMF as the format of spool file may ... I believe you were trying to draw from DrvDocumentEvent EndPage and End Page ... event does not come in banding drivers. ... you can draw watermark on Printer DC from there. ...
    (microsoft.public.development.device.drivers)
  • Re: Multiple EMF files
    ... > See what's LastDllError is. ... > If it's BAD PARAMETERS it may come from the hDCRef parameters ... > during the draw in EMF you had probably select a GDI object and not ...
    (microsoft.public.vb.winapi.graphics)
  • Adding lines to a .emf file
    ... Our application gets an .emf (from visio). ... We need to draw some ... We would like the keep the file in an .emf format. ...
    (microsoft.public.dotnet.framework.drawing)