Search found 5124 matches

by dodicat
Oct 18, 2018 23:26
Forum: General
Topic: Fast random integers
Replies: 34
Views: 489

Re: Fast random integers

Here are my 32 bit -O3 results 5 runs. 0.3266782851811172 x=0 1.98001706168418 x=cryptos 1.958181500206706 x=cryptos 0.2424342385153295 x=0 __________________________ 0.242853764900417 x=0 1.968862997889971 x=cryptos 1.961515811106153 x=cryptos 0.2419527755798754 x=0 __________________________ 0.242...
by dodicat
Oct 18, 2018 19:32
Forum: General
Topic: Fast random integers
Replies: 34
Views: 489

Re: Fast random integers

Same here
Win 10
64 bit
-gen gcc -Wc -O3
0.03730944660492241
1.863307968946174

I am using the official 1.05.0 build.
I don't have gcc 8.1 or 8.2, or fb 1.06
by dodicat
Oct 17, 2018 18:48
Forum: General
Topic: Fast random integers
Replies: 34
Views: 489

Re: Fast random integers

Nice Graphics example for #4 deltarho. Of course #4 is 100% predictable. randomize ,4 redim as double a(16777216) for n as long=0 to 16777216 a(n)=rnd next print "Press a key at will" dim as string key dim as long counter do counter+=1 var r=rnd key=inkey if len(key) then print "Rando...
by dodicat
Oct 17, 2018 10:02
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

Indeed I did test with a very old freepascal because that was all I had. I also tested with virtual pascal, which actually was quite fast (15 seconds). (Virtual pascal has been dead since 2005) But I now have freepascal 64 bit version 3.0.4 thanks to srvaldez.(10 seconds) Anyway, I am a little disap...
by dodicat
Oct 15, 2018 20:37
Forum: Game Dev
Topic: Retro style 3D graphics
Replies: 6
Views: 314

Re: Retro style 3D graphics

You have W,H as single, but you integer divide
Should be
H = (pointY1-240)*2
W = H/9
H = H/9
I reckon.
by dodicat
Oct 15, 2018 18:30
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

Fair enough marcov.
But I still think that you should have a portable(zip, 7Z,whatever) version of FreePascal.
Other compilers have, Dev-C++, FreeBASIC of course, Haskell, ...
You might attract more punters (sorry ... developers).
by dodicat
Oct 15, 2018 18:03
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

Thank you marcov. svarldez's zip fpc works well here. Windows: I note that If I had used the installer and agreed to put fpc.exe on path then I would also have put a 67 KB gcc.exe on path, along with a multitude of other executable files. What then If I decide to download MinGW and have a gcc proper...
by dodicat
Oct 15, 2018 15:01
Forum: General
Topic: Fast random integers
Replies: 34
Views: 489

Re: Fast random integers

Suppose you select a random number from the range 0 to 10 Do this 20000000 and keep the counts in an array(0 to 10) array(0), array(1) ... should all be the same. Of course they are not in practice. Here are some observations about the array() from randomize 1 to randomize 4 (randomize 5 is too slow...
by dodicat
Oct 14, 2018 21:42
Forum: Community Discussion
Topic: Line Input #n produces nullpointers
Replies: 10
Views: 167

Re: Line Input #n produces nullpointers

KeyPgOpStrptr is explicit about this possibility: In case of empty string (only for variable length strings), Operator Strptr returns a null pointer. Good. Maybe it should also be added to the help file, which n00bs are more likely to find and consult. So you should replace this end character at ea...
by dodicat
Oct 14, 2018 21:35
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

OK srvaldez.
I have your file.

-0.169075164
-0.169059907
10.42882303687671 seconds

I'll fix up my dev-pascal ide to use it.
Thanks again.
by dodicat
Oct 14, 2018 21:12
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

Thanks srvaldez.
I'll try that later.
The pascal code runs well on virtual pascal, with only two minor adjustments.
I copied the vp21 folder directly from my xP machine to Win 10.

I get about 15 seconds in virtual pascal.
by dodicat
Oct 14, 2018 18:57
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

I get about 10 seconds with -gen gcc -Wc -O3 I get about the same with srvaldez's c code compiling directly with gcc (obviously, it's the same thing) I get about 34 seconds with my freepascal compiler (selecting BEST speed in the ide which is O3 in the compile log) But my freepascal is old(I copied ...
by dodicat
Oct 14, 2018 14:57
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

running the actual pascal code in freepascal via

Code: Select all

dim as double t=timer
shell "test1 50000000"
print timer-t
sleep 


I get

Code: Select all

-0.169075164
-0.169059907
 34.78720054423098
 


so I have -gen gas beating freepascal (using somenumber^2 )
by dodicat
Oct 14, 2018 14:21
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 45
Views: 888

Re: [offtopic] FreePascal

srvaldez for pascal sqr did you use Somenumber*somenumber or somenumber^2 ? Here is my translation Type body ' Body = record As String body Dim As Double x, y, z, _ vx, vy, vz,mass End Type Const pi = 3.141592653589793 Const solarMass = 4 * (pi)^2 Const daysPerYear = 365.24 'type Dim shared As body ...
by dodicat
Oct 14, 2018 12:49
Forum: Community Discussion
Topic: Line Input #n produces nullpointers
Replies: 10
Views: 167

Re: Line Input #n produces nullpointers

HELP FILE; Reads a line from an open text file (opened for Input through a bound file number) and stores it in a string variable. A line of text ends at, but does not include the end of line characters. An end of line character may be the LF character (Chr(10)) or the CRLF character pair (Chr(13,10)...

Go to advanced search