Search found 1229 matches

by dafhi
Nov 02, 2018 2:33
Forum: Tips and Tricks
Topic: my next RNG .. CSG 3
Replies: 0
Views: 474

my next RNG .. CSG 3

' Complex Sequence Generator 3 by dafhi - 2018 Nov 13 ' high period, high configurability PRNG ' breezes PractRand to 32TB type CSG3_LITERAL as ubyte 'ulongint dim shared as CSG3_LITERAL csg3_mul = 255 ' non-ideal (32TB: 1645) dim shared as CSG3_LITERAL csg3_add = 1 ' 2^bits co-prime? (&H5851F4...
by dafhi
Oct 30, 2018 2:23
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 3785

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

Int() is notoriously slow. even gcc -O 3 doesn't optimize it out

use this instead

Code: Select all

dim as integer result = rnd*(hi+1 - lo) - .5 + lo
by dafhi
Oct 27, 2018 19:26
Forum: Tips and Tricks
Topic: Simple Smoke Simulation build 2018-11-02
Replies: 10
Views: 811

Re: Simple Smoke Simulation build 2018-10-26

those clouds.

[update] totally forgot. happy birthday :-)
by dafhi
Oct 27, 2018 7:09
Forum: Tips and Tricks
Topic: RPG level stats
Replies: 0
Views: 399

RPG level stats

' ------------------------------------------------------------------- ' RPG level stats by dafhi ' ' release date: 2018 Oct 26 ' ' Based upon my journey through World of Warcraft ' coded sometime around 2015 ' ------------------------------------------------------------------- type stat_literal as ...
by dafhi
Oct 26, 2018 21:33
Forum: Tips and Tricks
Topic: Simple Smoke Simulation build 2018-11-02
Replies: 10
Views: 811

Re: Simple Smoke Simulation build 2018-10-26

one cannot deny the benefit of knowing asm. thanks for sharing
by dafhi
Oct 26, 2018 0:30
Forum: General
Topic: Squares
Replies: 6836
Views: 392659

Re: Squares

working on my newest random number generator, i thought i'd try a multiplier of 4, which produces a cool reflection pattern function CSG_ii as double '' 2018 Sep 17 '' produces a cool pattern const as ulongint mul = 4 static as ulongint a, state = 0 a += 1 - (state = 0) state = state shl 57 or state...
by dafhi
Oct 25, 2018 5:32
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 3785

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

@deltarho - the point is that luck isn't a factor.

anyway, again, thanks for this cool framework
by dafhi
Oct 24, 2018 20:33
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 3785

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

However, your LCV managed to get to 1MB and failed have a look at a plain jane LCG's low bits function CSG as ulong const mul = 6364136223846793005ull '' Knuth's const add = 1442695040888963407ull static as ulongint state = 1 state = mul * state shr 0 + add return (state and 4294967295) End functio...
by dafhi
Oct 24, 2018 1:29
Forum: General
Topic: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)
Replies: 106
Views: 3785

Re: Bernard Widynski's Middle Square Weyl Sequence RNG (MsWs)

thanks for sharing the framework

Knuth LCG experiment

Code: Select all

  state = mul * (state shr 9) + add

my "CSG_ii"

Code: Select all

    a += 1 - (state = 0)
  state = (mul * (state shl 52 or state shr 12) + add) xor a
by dafhi
Oct 23, 2018 17:10
Forum: Projects
Topic: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated March 25, 2019)
Replies: 516
Views: 63052

Re: WinFBE Editor and FreeBASIC Compiler (All-in-One Package) (Updated October 7, 2018)

when i hit ctrl-R and press tab, hi-lighted source gets replaced (by a tab)

expected: move to the 'replace with' field
by dafhi
Oct 22, 2018 3:43
Forum: Community Discussion
Topic: my best effort
Replies: 123
Views: 8547

Re: my best effort

here's a quick thing you can look at type tType as string s = "-" declare constructor(as string = "") end type constructor tType(i as string) if i = "" then exit constructor s = i end constructor sub test_byref(byref t as tType) t.s = "ByRef" end sub sub test_...
by dafhi
Oct 22, 2018 0:33
Forum: Projects
Topic: monte-carlo weights
Replies: 1
Views: 802

Re: monte-carlo weights

short animation https://www.youtube.com/watch?v=BkOm0KFjie4 /' code smashed together for a quick .. ----- test scene ------ '/ #include "rand.bas" #undef rnd #define rnd csg_ii #include "pathtracer.bas" '' https://www.freebasic.net/forum/viewtopic.php?f=14&t=18491 #include &q...
by dafhi
Oct 21, 2018 0:22
Forum: Projects
Topic: Gameboy emulator written in FreeBasic
Replies: 15
Views: 1612

Re: Gameboy emulator written in FreeBasic

could u b more specific?
by dafhi
Oct 13, 2018 22:09
Forum: General
Topic: How to make glitter paint
Replies: 10
Views: 525

Re: How to make glitter paint

rnd * range - .5 + bas will give a balanced distrib. I shoulda used those instead. You can mod if u want. Otherwise i'll make the change tomm.

- updated

Go to advanced search