VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Absolute randomization. We use the mouse position and the last keypress to generate an absolutely r

by Chaitanya Dhareshwar (4 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 29th November 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Absolute randomization. We use the mouse position and the last keypress to generate an absolutely random value. The user can never be trusted

Rate Absolute randomization. We use the mouse position and the last keypress to generate an absolutely r



Private Sub Form_Click()
'This is the function where you 'use' the randim value.
'This can be for a Dice-based game also.
'The normal VB function leaves out a few points
'when a graph of RND vs RND is plotted. This doesn't
Randomize Timer
MsgBox Int(Rnd * 6)
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
RandomSeed = RandomSeed * KeyAscii / 255
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RandomSeed = RandomSeed * X / Y
End Sub


Download this snippet    Add to My Saved Code

Absolute randomization. We use the mouse position and the last keypress to generate an absolutely r Comments

No comments have been posted about Absolute randomization. We use the mouse position and the last keypress to generate an absolutely r. Why not be the first to post a comment about Absolute randomization. We use the mouse position and the last keypress to generate an absolutely r.

Post your comment

Subject:
Message:
0/1000 characters