Statistics: Posted by Zim — Mon Dec 05, 2005 4:57 pm
Statistics: Posted by Guest — Fri Dec 02, 2005 12:52 pm
making an RNG that spits out 1 or 0 is easy,way easier than making a "proper" one that spits out.. oh.. 32bit numbers
Statistics: Posted by matt2jones — Wed Nov 09, 2005 7:47 am
Statistics: Posted by sid6.7 — Tue Nov 08, 2005 8:50 pm
Code:
x(n+1) = a*x(n)*(1-x(n))
Statistics: Posted by Xerol — Tue Nov 08, 2005 7:59 pm
Code:
DECLARE FUNCTION num$ (nm&)SCREEN 12FOR mul1% = 1 TO 4096FOR mul2% = 1 TO 4096mstr$ = num$(CLNG(mul1%) * CLNG(mul2%))nstr$ = mstr$m1$ = num$(CLNG(mul1%)): m2$ = num$(CLNG(mul2%))f% = 0FOR i% = 1 TO LEN(m1$)test% = INSTR(nstr$, MID$(m1$, i%, 1))IF test% <> 0 THENMID$(nstr$, test%, 1) = SPACE$(1)f% = f% + 1ELSEEXIT FOREND IFNEXT i%FOR i% = 1 TO LEN(m2$)test% = INSTR(nstr$, MID$(m2$, i%, 1))IF test% <> 0 THENMID$(nstr$, test%, 1) = SPACE$(1)f% = f% + 1ELSEEXIT FOREND IFNEXT i%IF f% = LEN(m1$) + LEN(m2$) THEN'PRINT mstr$ + "," + m1$ + "," + m2$'SLEEPPSET (VAL(m1$) / 10 - 1, VAL(m2$) / 10 - 1), 15END IFNEXT mul2%NEXT mul1%FUNCTION num$ (nm&)num$ = RIGHT$(STR$(nm&), LEN(STR$(nm&)) - 1)END FUNCTION
Statistics: Posted by Zamaster — Tue Nov 08, 2005 6:26 pm
Code:
function getRND (precission as uinteger = 703) as singlestatic lastnum as singledd = (((timer*1000) mod 255000)) mod 65536aa! = ddaa! = aa! mod precissionaa! = aa! / precission+lastnumwhile aa! > 1aa!=aa!-1wendlastnum = aa!getRND = aa!end function
Statistics: Posted by Z!re — Tue Nov 08, 2005 2:16 pm
Code:
dim as ulongint p, q, x0, x1, xn, numprint "Random Number Test Generator by Xerol"print "Using equation x(n) = ((x(n-1)*(x(n-2)^2) + p) mod q"input "Value to use for p:", pinput "Value to use for q:", qinput "Seed #1 (x(0)):", x0input "Seed #2 (x(1)):", x1input "Number of numbers to generate:", numopen "random.txt" for output as #1print #1, "P = "; pprint #1, "Q = "; qprint #1, "x0 = "; x0print #1, "x1 = "; x1print #1, "Generating "; num; " numbers using above parameters."for n = 1 to num xn = (x0*(x1^2)+p) mod q print xn print #1, xn x0 = x1 x1 = xnnext nsleep
Code:
P = 101Q = 2538213x0 = 300295x1 = 1828216Generating 500 numbers using above parameters.2395437249504858439371752621381103940085824793123179328099545981958796(List truncated for sake of space. I'll upload the file later.)
Statistics: Posted by Xerol — Tue Nov 08, 2005 12:25 pm
Statistics: Posted by matt2jones — Tue Nov 08, 2005 10:58 am
The Chaotic Functions I was talking about don't, that's why I brought them up... Non-periodic or something...All RND generators wrap around at some point, often far sooner than you might think..
Statistics: Posted by Z!re — Tue Nov 08, 2005 10:39 am
Statistics: Posted by matt2jones — Tue Nov 08, 2005 8:05 am
Statistics: Posted by Macric — Tue Nov 08, 2005 7:25 am
Statistics: Posted by Z!re — Tue Nov 08, 2005 7:01 am