-
umm...
From
Hax0r@VERT/HAX0RQWK to
All on Fri Jul 13 21:19:00 2001
is it just my setup, or does the baja random function seem to be somehowãrelated to screen length/position/buffer (one of them anyways -- not 100%ãsure which one it is, but i'm leaning toward "total lines output")ãã... i found that changing ANSWER.ASC to do a @EXEC:<mybajamodulehere>@, where �the baja module generates a random number right of the bat causes the randome �number to *always* be the same thing...ããwhats the scoop?ãããã---ã þ Synchronet þ .. hax0r's palace .. you've just been hax0r'd ..ã
-
From
Digital Man@VERT to
Hax0r on Sat Jul 14 18:14:17 2001
RE: umm...ãBY: Hax0r to All on Sat Jul 14 2001 04:19 amãã > is it just my setup, or does the baja random function seem to be somehowã > related to screen length/position/buffer (one of them anyways -- not 100%ã > sure which one it is, but i'm leaning toward "total lines output")ã > ã > ... i found that changing ANSWER.ASC to do a @exec:<mybajamodulehere>@, wherã > ã > whats the scoop?ããI don't know, that's odd. What if the module runs later? What's the numberãbeing generated?ãã-Robã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Evan Elias@VERT to
Hax0r on Sun Jul 15 06:28:25 2001
RE: umm...ãBY: Hax0r to All on Sat Jul 14 2001 04:19 amãã > is it just my setup, or does the baja random function seem to be somehowã > related to screen length/position/buffer (one of them anyways -- not 100%ã > sure which one it is, but i'm leaning toward "total lines output")ã > ã > ... i found that changing ANSWER.ASC to do a @EXEC:<mybajamodulehere>@, wherã > ã > whats the scoop?ããI've found that random numbers in general seem to be a little goofy in Win32ãprograms... the first "random" number in general always seems to be the sameã(even when properly using the timer to randomize things). I have no idea whyãthis happens. In all my win32 programs that I've written, I now do a few dozenãdummy calls to the random number function, seems to fix the problem (Shrug?)ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Hax0r@VERT/HAX0RQWK to
Digital Man on Sun Jul 15 14:06:00 2001
RE: umm...ãBY: Digital Man to Hax0r on Sun Jul 15 2001 01:14 amãã > I don't know, that's odd. What if the module runs later? What's the numberã > being generated?ããbasically i'm having it generate a random number so i can display a random ãANSWER screen. it so happens that the random number generated (if no text is ãon the screen) is *always* zero. If i do a "cls" in the baja module (thus one ãscreen operation), the random number generated is always 1. its just pretty ãstrange. if i run the module after logon (and a lot of screen activity has ãoccured), i always do get a random number...ããany ideas?ãããã---ã þ Synchronet þ .. hax0r's palace .. you've just been hax0r'd ..ã
-
From
Digital Man@VERT to
Hax0r on Sun Jul 15 15:27:11 2001
RE: umm...ãBY: Hax0r to Digital Man on Sun Jul 15 2001 09:06 pmãã > > I don't know, that's odd. What if the module runs later? What's the numbeã > > being generated?ã > ã > basically i'm having it generate a random number so i can display a randomã > ANSWER screen. it so happens that the random number generated (if no text iã > on the screen) is *always* zero. If i do a "cls" in the baja module (thus oã > screen operation), the random number generated is always 1. its just prettyã > strange. if i run the module after logon (and a lot of screen activity hasã > occured), i always do get a random number...ã > ã > any ideas?ããI don't think the screen line has anything to do with it, but more likelyãtiming. Have you tried doing a small mswait before getting your random number?ãOr perhaps getting a few random numbers first (as Evan suggested).ãã-Robã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Hax0r@VERT/HAX0RQWK to
Digital Man on Mon Jul 16 12:22:00 2001
RE: umm...ãBY: Digital Man to Hax0r on Sun Jul 15 2001 10:27 pmãã > I don't think the screen line has anything to do with it, but more likelyã > timing. Have you tried doing a small mswait before getting your random numbã > Or perhaps getting a few random numbers first (as Evan suggested).ããi tried getting several random numbers in a row -- 5 to be precise, and all ãwere zero. the baja code is fairly simple -- its pasted below. I just took ãmy stock ANSWER.ASC file and replaced the logo/graphic/etc with this:ãã(at)EXEC:ANSWER(at)ããthen, ANSWER.BIN does this...ãã# ANSWER.SRC/ANSWER.BINã# random logon screen for synchronetããclsãint xãã# seed x with a random number between the fixed rangeããrandom x 3ããcompare x 0ã if_equalã pause_resetã printfile "%zANSWER1.ANS"ã end_ifããcompare x 1ã if_equalã pause_resetã printfile "%zANSWER2.ANS"ã end_ifããcompare x 2ã if_equalã pause_resetã printfile "%zANSWER3.ANS"ã end_ifãããã---ã þ Synchronet þ .. hax0r's palace .. you've just been hax0r'd ..ã
-
From
Digital Man@VERT to
Hax0r on Mon Jul 16 12:03:08 2001
RE: umm...ãBY: Hax0r to Digital Man on Mon Jul 16 2001 07:22 pmãã > RE: umm...ã > BY: Digital Man to Hax0r on Sun Jul 15 2001 10:27 pmã > ã > > I don't think the screen line has anything to do with it, but more likelyã > > timing. Have you tried doing a small mswait before getting your random nuã > > Or perhaps getting a few random numbers first (as Evan suggested).ã > ã > i tried getting several random numbers in a row -- 5 to be precise, and allã > were zero. the baja code is fairly simple -- its pasted below. I just tookã > my stock ANSWER.ASC file and replaced the logo/graphic/etc with this:ã > ã > (at)EXEC:ANSWER(at)ã > ã > then, ANSWER.BIN does this...ã > ã > # ANSWER.SRC/ANSWER.BINã > # random logon screen for synchronetã > ã > clsã > int xã > ã > # seed x with a random number between the fixed rangeã > ã > random x 3ã > ã > compare x 0ã > if_equalã > pause_resetã > printfile "%zANSWER1.ANS"ã > end_ifã > ã > compare x 1ã > if_equalã > pause_resetã > printfile "%zANSWER2.ANS"ã > end_ifã > ã > compare x 2ã > if_equalã > pause_resetã > printfile "%zANSWER3.ANS"ã > end_ifããThere's definitely a problem with random numbers currently in v3.00 and it willãbe fixed before the release of v3.10.ããIn the mean-time, I'd suggest you use the current time to generate aãpseudo-random number. Example:ãã# display answer0-3.ansãint tãstr fnameãtime t # get time (in seconds)ãand t 3 # just use lower 2 bitsãsprintf fname "%%zANSWER.%ld" tãprintfile fname # display fileãã-Robã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Hax0r@VERT/HAX0RQWK to
Digital Man on Mon Jul 16 16:16:00 2001
RE: umm...ãBY: Digital Man to Hax0r on Mon Jul 16 2001 07:03 pmãã > There's definitely a problem with random numbers currently in v3.00 and it ã > be fixed before the release of v3.10.ããheh.. glad that it just wasn't something i was doing -- has this been a known ãthing? i've used the random function before and it seemed to work ok...ãã > # display answer0-3.ansã > int tã > str fnameã > time t # get time (in seconds)ã > and t 3 # just use lower 2 bitsã > sprintf fname "%%zANSWER.%ld" tã > printfile fname # display fileããthats a lot more elegant than my solution anyways... thanks for the tip!ãããã---ã þ Synchronet þ .. hax0r's palace .. you've just been hax0r'd ..ã
-
From
Digital Man@VERT to
Hax0r on Tue Jul 17 05:41:17 2001
RE: umm...ãBY: Hax0r to Digital Man on Mon Jul 16 2001 11:16 pmãã > > There's definitely a problem with random numbers currently in v3.00 and iã > > be fixed before the release of v3.10.ã > ã > heh.. glad that it just wasn't something i was doing -- has this been a knowã > thing? ããNope, you're the first to discover/report it.ãã > i've used the random function before and it seemed to work ok...ããIt works in the sense, that it produces pseudo-random numbers. The problem isãthat it produces the SAME numbers in the SAME order for every login. This hasãbeen fixed in v3.10 (each thread has to seed the random number generator).ãã > > > # display answer0-3.ansã > > int tã > > str fnameã > > time t # get time (in seconds)ã > > and t 3 # just use lower 2 bitsã > > sprintf fname "%%zANSWER.%ld" tã > > printfile fname # display fileã > ã > thats a lot more elegant than my solution anyways... thanks for the tip!ããNo problem. Thanks for the bug report.ãã-Robã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã