Short: Generate random numbers for scripts Author: T.Heinrich@t-online.de (Thomas Heinrich) Uploader: T.Heinrich@t-online.de (Thomas Heinrich) Version: 1.0 Type: util/cli Requires: OS2.04+, MC68020+ **************************** * OPTIMIZED FOR MC68020+ ! * **************************** While I was browsing through the web, iI collected looots of photos of phantastic women. So I really could not decide which one to use as the workbench backdrop. Using WBPattern to create multiple preferences files was easy, but how get them changed after every reboot ? So I renamed all the prefs as Backdrop.xx, where xx is a number from 0 to 51 ;^). But how do I generate a random number in a shell ? Finally I quickly wrote a program, which used the system seconds, and masked out the lower few bits, being able to use first 16 then 32 backdrops. I was not to satified with that, as it only produced fixed steps to use as numbers (16, 32 the next would have been 64). I spent half an afternoon, then, to produce this program here: Randomizer ! What it does: ------------- It also reads the seconds from the timer of your Amiga and then produces a CONFIGURABLE number of random numbers. For script convenience, it stores the number in a local shell variable named "RANDOM". So you can access it e.g. by typing WBPattern Backdrop.$RANDOM USE This loads a random backdrop picture, given you prepared the prefs in the first place. What it can NOT do: ------------------- It does not save the random number permanently. Obviously it is a RANDOM number, so there is no sense in storing it. I also aborted the number to be delivered as a return value to the shell. I was annoyed, when my startup-sequence stopped, saying the program failed. Silly me forgot to set the FailAt value higher ! No fiddling with FailAt in this version anymore. It just works. What YOU should do: ------------------- READ THE DOCS BEFORE USING THE PROGRAM ! To be honest, there are no docs... Search for the file "ReadMeFirst" in this distribution, to figure out how to make Randomizer work. One more, at last: It is FREEWARE ! And it comes with the complete C source !!! Have fun, Thomas "Hoin" Heinrich. VISIT MY HOMEPAGE: http://home.t-online.de/home/T.Heinrich/homepage.htm ============================= Archive contents ============================= Original Packed Ratio Date Time Name -------- ------- ----- --------- -------- ------------- 4333 2080 51.9% 28-Feb-97 20:46:06 Freeware_deutsch.txt 3890 1838 52.7% 26-Mar-97 13:08:32 Freeware_english.txt 1524 1069 29.8% 05-Apr-97 16:07:32 Randomizer 3103 1390 55.2% 05-Apr-97 20:32:16 Randomizer.c 2275 1229 45.9% 05-Apr-97 19:18:48 Randomizer.readme 3013 1515 49.7% 05-Apr-97 20:05:40 ReadMeFirst 3848 587 84.7% 05-Apr-97 20:07:02 ReadMeFirst.info -------- ------- ----- --------- -------- 21986 9708 55.8% 06-Apr-97 23:16:30 7 files