Short introduction to Randomizer V1.1 ===================================== **** <-- The four stars indicate a change from V1.0 to V1.1 0. If you are not familiar in working with a shell, forget this program !!! 1. Find the file Randomizer. 2. Copy it to C: for your convenience. 3. It takes 2 (optional) parameters: HI or HIGH, and LO or LOW. You can use both the english or the american spelling, you can even mix it. a. HI/HIGH limits the random number to an upper bound. Do not overdo it, it generates it's numbers from the timer ! You are totally safe, if you keep it below 500 000 000, provided, your clock is set to the actual time and not at some random value. It has a default value of 1 (one). **** There is a theoretical problem, if you never used your Amiga before, and if it has no hardware clock (like a stock A1200): AmigaDOS saves the time of the last session to the boot disk. If this value is zero, because you never used your boot disk before. your system time is very low. With Randomizer Version 1.1 you can safely specify a MAX value of 999999, because it now adds system seconds and microseconds (Thanx go to Jens Granseuer, who suggested this). b. LO/LOW raises the lower bound to the specified value. You NEVER get a number below this value. If the timer generated a value below it, it is lifted to this low value. Looking closer, this means, that there is a much higher percentage of this low value, than of any other number. If you use the LOW keyword, you BREAK the RANDOMNESS. By default, it has a value of 0 (null), and I advise you, to leave it there ! **** The problem described above is finally solved. Randomizer just pulls down the range defined by HIGH and LOW to zero, creates a random number and adds the LOW value again. **** c. Randomizer now also checks for a LOW value equal to or higher than HIGH to avoid Division By Zero. Thanx again to Jens Granseuer. Additionally I added the error message "LOW >= HIGH : ", where is automagically replaced by the OS with a string describing the error in detail. 4. Where is the number, then ? As the program is intended for use in scripts, it seemed most convenient for me, to store it in a local shell variable. So it creates a new variable by the name of "RANDOM", which holds the random number. You can easily use it with "eval", tag it before or behind filenames, and so on. 5. How can I get rid of the number after use ? Simply type "Unset RANDOM" ! 6. Can you give me an example ? Yes, here it is. Let's say, you have a backdrop picture located in SYS:Prefs/Patterns named "BackDropPic.iff". Your WBPattern preferences settings include this path. Furthermore you have 25 other pictures to be used as backdrops randomly, which are named "picture.0" to "picture.24". Then you would write something like this in your startup sequence: ... C:AddDataTypes ... ;example starts here C:Randomizer HIGH 24 C:Copy SYS:Prefs/Patterns/picture.$RANDOM SYS:Prefs/Patterns/BackDropPic.iff QUIET Unset RANDOM ;example ends here ... C:IPrefs ... Please notice, that you would want to practise this example between the AddDataTypes and IPrefs call ! Also note, that "Unset" is NOT A PROGRAM LOCATED IN C: !!! It is shell private ! Further note, that the above example overwrites whatever the file "BackDropPic.iff" is. If it was a 26th picture, you have lost it ! 7. I would kindly like to appreciate you to read the copyright files provided in this archive. If there are none, DO NOT USE THE PROGRAM ! Mail me for an original copy. I am releasing the sourcecode, too, so there might be fakes or even viruses ! If in doubt, email me for the original: T.Heinrich@t-online.de 8. Don't dump your Amiga. It still is the best home computer there is ! Thomas "Hoin" Heinrich April, 5th 1997 **** V1.1: July, 16th 1997