Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Randomiz X

Author
Message
Incandescant
21
Years of Service
User Offline
Joined: 5th Sep 2002
Location: United Kingdom
Posted: 29th Oct 2002 20:31
Greetings all, although I have posted here before I have only just recently started programming in DBPro.
Heres my dilemma:
I am trying to program a small program to randomize numbers as a virtual dice pool.
The problem is the RND() command is not entirely random and the RANDOMIZE X command requires a differnet value evry time to make it entirely random. I would like to make it so that the X value fore the randomize command is different every time the program starts and therefore generates truly random numbers.
Any help would be greatly appreciated.
The code goes something like this (the original is at home and not with me where I'm posting from)


Another problem is I would like the code to loop so that once a user has had a result printed to the screen it will then start again (after a key has been pressed) from the input prompt.
Thirdly note the wait command at the end, the option to terminate the program with a key stroke and keep the display open till then woul;d be useful. I know it would be done with the sendkey() command but can't figure out how.

I know this may seem simple to most and that I am asking you to basically code the program foe me but it is my first DB program and I am stuck. I also intend to add a lot more functionality, flair etc such as rolling dice animations and the feature of rolling multiple die.

Thanks to anyone who helps!!!

Incandescant
System: Athlon TBird 800Mhz, 320MB RAM, GeForce 2MX440, DX8.1
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 29th Oct 2002 21:27
Randomize timer()

Should do the trick. Gives you the time in milliseconds!

I love Star Trek.
Especially the Episodes with Starships in.
Incandescant
21
Years of Service
User Offline
Joined: 5th Sep 2002
Location: United Kingdom
Posted: 30th Oct 2002 12:32
thanks, i'll give it a go!

System: Athlon TBird 800Mhz, 320MB RAM, GeForce 2MX440, DX8.1

Login to post a reply

Server time is: 2024-04-18 20:18:10
Your offset time is: 2024-04-18 20:18:10