Page 1 of 1

RANDOM() visual

Posted: Tue Jun 23, 2020 6:07 am
by AUGE_OHR
hi,

i want to generate "random Point"

Code: Select all

   mX := RANDOM( aSize[1]-2 )
   mY := RANDOM( aSize[2]-2 )
   ::Circle(mX,mY,3,nColor,,.T.)

Code: Select all

METHOD DemoDlg:Circle(X0,Y0,R0,nColor,nLineType,lFill)

   draw ellipse in window MainForm ;
   at Y0,X0 to Y0+3,X0+3 ;           //  X0,Y0 to X0+3,Y0+3    
   pencolor {random(255),random(255),random(255)} penwidth 2 fillcolor {random(255),random(255),random(255)}

RETURN NIL
now look at Picture ... Point are NOT "random" ...
RANDOM.jpg
RANDOM.jpg (85.93 KiB) Viewed 1366 times
i have made a Logfile with data and that "seems random" but if you "visualize" it you see this Result
RANDOM.ZIP
(23.43 KiB) Downloaded 114 times
so how to generate "random" Number under harbour / HMG :idea:

Re: RANDOM() visual

Posted: Tue Jun 23, 2020 7:42 am
by AUGE_OHR
have use Data in Excel
Random_Excel_Chart.JPG
Random_Excel_Chart.JPG (95.52 KiB) Viewed 1354 times
why does RANDOM() Data have that Look :(

Re: RANDOM() visual

Posted: Tue Jun 23, 2020 8:50 am
by AUGE_OHR
hi,

have now use hb_RandomInt() instead of RANDOM() and got this
hb_RandomInt.jpg
hb_RandomInt.jpg (266.46 KiB) Viewed 1348 times
so it seems RANDOM() is not working as expect ...

Re: RANDOM() visual

Posted: Wed Jun 24, 2020 12:30 am
by AUGE_OHR
hi,

why is

Code: Select all

mt=yes
HbDTL_MT.JPG
HbDTL_MT.JPG (83.31 KiB) Viewed 1304 times
slower than

Code: Select all

mt=no
HbDTL_NOMT.JPG
HbDTL_NOMT.JPG (313.27 KiB) Viewed 1304 times
in this Sample :idea: