Worst random numbers ever!

Blitz3D Forums/Blitz3D Programming/Worst random numbers ever!

Floyd(Posted 2005) [#1]
I've seen some baffling bugs, but this one is something special.




sswift(Posted 2005) [#2]
Whoa...
That Mark is a sneaky one!

Now did he tell you about that, or did you find it yourself?

And just how the heck did he do that? I hope it isn't significantly impacting performance. :-)


Michael Reitzenstein(Posted 2005) [#3]
Weird... pleminary tests seem to indicate that it's closely related to this bug.


KuRiX(Posted 2005) [#4]
BUG? It shows BlitzMax!!!, hahhaah, Awesome!


Rob Farley(Posted 2005) [#5]
I found something similar..




Ziltch(Posted 2005) [#6]
Funny thing is with r,g and b = rand(0,0) displays a clear pic!


_PJ_(Posted 2005) [#7]
LOL!

This must've been planned in the last upgrade... Best April Fool's Day thingy so far though :)


_PJ_(Posted 2005) [#8]
Did get me thinking however about seeds and how they pull numbers from the pseudo-list depending on criteria defined by 'Rand' I knocked up this quick prog which dowes give some interesting values (look at the values compared the parameters defined)

Const seed = 10

SeedRnd seed
	
	x=Rand(1,20)
	y=Rand(1,20)
	z=Rand(1,50)

Print x+" "+y+" "+z

SeedRnd seed

	x=Rand(-20,1)
	y=Rand(-20,1)
	z=Rand(-50,1)
	
Print x+" "+y+" "+z

SeedRnd seed

Print Rand(100)

SeedRnd seed

Print Rand(1,100)

SeedRnd seed

Print Rand(0,100)

SeedRnd seed

Print Rand(0,101)

SeedRnd seed

Print Rand(-1,100)

WaitKey()




Rook Zimbabwe(Posted 2005) [#9]
Good one guys!


sswift(Posted 2005) [#10]
Oh you guys suck. :-)

Good job, you fooled me. I can't think of anyone who has before. :-)


puki(Posted 2005) [#11]
Hey those things are cool - I want a "puki" one.

Someone do me one


Rook Zimbabwe(Posted 2005) [#12]
OK for Puki:



puki(Posted 2005) [#13]
MINE WORKS!!!! MINE WORKS!!!!

HA, HA - I RULE THE WORLD!!!

S A U S A G E S!!!

A Larging we will go, a Larging we will go, snoop doop, puppy poop, a Larging we will go!!!

puppage


Neochrome(Posted 2005) [#14]
Hehe, classic!


Orca(Posted 2005) [#15]
heh

took me a little bit to figure it out :)


sswift(Posted 2005) [#16]
Does larging mean walking around with your chest puffed out and your arms curled inwards with clenched fists, like Popeye?

Cause I could see Puki doing that, with a vaccum sealed puppy clenched under his right armpit, and a large sausage clenched between his teeth, one and hanging out, like a floppy cigar an inch and a half in diameter.


puki(Posted 2005) [#17]
Mine worked


Storm8191(Posted 2005) [#18]
...okay, this is very strange. The only difference I can see between the first program and Puki's program is what seed was used. But if I plug that seed into the first program, it doesn't work. I copied Puki's source from above into Blitz and then it works.

What gives??


Michael Reitzenstein(Posted 2005) [#19]
Question Everything.

Heh...


DJWoodgate(Posted 2005) [#20]

What gives??



Could be your CPU can not process the necessary instructions correctly. This particlular feature that has seemingly been built into the Random number generator may rely on some undocumented Intel instructions such as

LEG - Load encryption generator
ER - Test encryption register
DEM - Double encryption multiply
AIN - Adjust Indexed Negation

and so on. I understand they intended these for high level fractal compression and encryption of visual and other data using a special register subsytem called RUBES, but they never quite got that working properly due to timing issues with certain core configurations.


Floyd(Posted 2005) [#21]
My original post has passed its freshness date but still holds some appeal.

There was an explanation, but some kind hearted moderator has removed it. This means newcomers can still experience the awe and mystery.


puki(Posted 2005) [#22]
They are mystified at my 'Godness' - how could one so Large be included within Blitz3D. I am the sausage-meister.

puppage beyond large


Damien Sturdy(Posted 2005) [#23]
I will continue to laugh at this :D


jhocking(Posted 2005) [#24]
Email me the answer! I must know! I don't see any difference between Rob's two code postings, so why do different things appear?

ADDITION: I found that replacing r = Rand(50,150) with r = Rand(50,100) in Floyd's code makes the effect even easier to see. BUT I'M NO CLOSER TO UNDERSTANDING WHY THIS IS HAPPENING! AARGH!!!

ADDITION 2: I don't know what's wrong with me; this isn't that big a deal, BUT IT'S DRIVING ME INSANE!


VIP3R(Posted 2005) [#25]
I've emailed you Joe, you're gonna kick yourself ;)


Picklesworth(Posted 2005) [#26]
Can you forward to me?
I want to kick myself too.


VIP3R(Posted 2005) [#27]
Hehe, no problem Pickles - email sent ;)


KuRiX(Posted 2005) [#28]
mmm, look for the secret, it is easy, the first post with the explanation was mine, but i am happy a moderator has erased it.

look well, thing are not what they appear...


DH(Posted 2005) [#29]
This is a gas!

Luckily I posted the code in notepad for quick review before attempting to run it.

You guys crack me up.


Picklesworth(Posted 2005) [#30]
My leg is numb from kicking :)


jhocking(Posted 2005) [#31]
Thanks Viper

*sobs with a mixture of relief and exasperation*


Floyd(Posted 2005) [#32]
The idea for this came years ago when I saw a warning about virus files with sneaky names. There was a .exe lurking in the name, but you couldn't see it.

I knew the same trick could be the basis for a 'code joke'. The combination of April Fool's Day and the impending release of BlitzMax for Windows inspired me to, at long last, implement the joke.


WolRon(Posted 2005) [#33]
The little things we don't notice...


Ross C(Posted 2005) [#34]
Very nice ;)


puki(Posted 2005) [#35]
What joke? - mine bloody worked - it is NOT a trick - "puki" is in B3D's rendering engine thing.

Don't mock the Large.


Jesse(Posted 2005) [#36]
Maybe there are two hidden lines in the code?

Nice joke It almost Had me fooled!


Andy(Posted 2005) [#37]
>Maybe there are two hidden lines in the code?

I'm not saying you are slow, but everyone realized what was going on about 5 months ago:)

Andy


Jesse(Posted 2005) [#38]
this is the first time I see this sence I was looking at the blitz newsLetter as Current News!!!! Yes and I am shure everybody got it ;).


Naughty Alien(Posted 2005) [#39]
hey folks, can someone email me too..I wanna kick myself tooo.... :))


aab(Posted 2005) [#40]
*Oh crap i just got it*
lol...


Raitsun(Posted 2005) [#41]
WOOOOAAAAHHHHH....
... nice one....


VP(Posted 2005) [#42]
You got me for a good few minutes & cup of tea later.

What option do use use with this board's CODE tag then?


Ross C(Posted 2005) [#43]
http://www.blitzbasic.com/faq/faq_entry.php?id=2


VP(Posted 2005) [#44]
doh :)

Thanks