WHEEL.INF [73300,2772] By George Flanders Offered free for enjoyment - no rights claimed June 2, 1988 Here's a diversion for people who can't get enough of the "Wheel of Fortune" TV game. The BASIC program "WHEEL.100" (with some built-in ML) is a game based on the popular television program, but changed enough so one player can amuse him/herself for quite a while by guessing combinations of words which make up a phrase, person, thing, place, people or event. To keep things simple, the database consists of three-word combinations. In the sample database, in this DL as "WHEEL1.DTA", there are 60 different combinations: ten for each category. After a while, you'll find that you will recognize the word patterns, and it'll get too easy. That's the time to change the database. Better yet - exchange database files with other players to test one another's skill! Or, you could write more than one database file. More about that presently. There's no way to compensate you for the absence of Pat, Vanna and announcer Jack with his "studio full of valuable prizes"; nonetheless, WHEEL.100 has its own charm. It presents a game screen which contains the following elements, in addition to the title: (1) a value for the letter chosen, (2) your winnings for the current round (3) the number of guesses you have left (4) your cumulative winnings for the current session (series of rounds, as you opt to continue) and maybe best of all, reminders of which letters you've chosen incorrectly during the round. I've programmed seven turns for each round, not counting bought vowels. You can choose each time to SPIN or SOLVE the puzzle. If your current round's earnings are at least $100, and until you use up two vowel selections, you also get the choice BUY A VOWEL. When you get so good that seven turns are too many, you can simply edit line 0 to say "PRINT@115,--" (number of your choice); and edit line 5 to say "EL=--" (same number). It may be that for youngsters you'd like to increase the number of turns, and that's easily done. Much of the variation of the game depends on the pseudo random number generated in line 9. Like most computers, the M-100 doesn't output a truly "random" number with its RND function. In fact, you almost always get the same pattern of numbers at start-up. One solution that works well for this game is to poll address -1745 (63791 decimal, F92F hex), which continuously counts down from 125 to 0 as part of the background task. Line 9 sets the counter "Q" to a value of 1 plus PEEK(-1745)MOD60. When the subroutine in line 9 is called, there's no telling what value (0-125) is held in -1745. We perform the modulus arithmetic to be sure that the variable Q always ends up having a value between 1 and 60. A similar thing might be done by making Q=1+VAL(RIGHT$(TIME$,2)); but considering that each turn may consume about the same amount of time, after testing I found the first method to be more "random". To be sure the same number doesn't come up twice in any round, the array U(60) rejects repeats. When you start up, the database file is read Q number of times to determine which word combination will be presented, and which of the six types it represents. If you assemble additional database files, be sure that each file contains not fewer than 60 records, or a read error could halt the game. It doesn't make sense to have more than 60 combinations in the file, unless you want to fiddle with the dimensioning of U(-) in line 5 and the MOD... value in line 9. However, it doesn't matter how many of each of the six types of word combinations are in the file - you might do all phrases (type 1), or more of one type than another, just so long as there are 60 entries. Each entry in the file must contain a "T" value (type) and three following words; for example: 6,NEW,YEAR'S,EVE is type 6 (event). Valid three-word combinations can ONLY be comprised of the alphabet plus an apostrophe. The machine language routines which receive your inputs are coded to reject any other keystroke, and the small character set the game uses only supports those characters. For user convenience, every letter you type in appears (and is interpreted) as a capital letter. You don't have to be concerned about having the CAPS LOCK key on. You SHOULD, however, be sure that the NUM key is NOT down, or else you'll lose the ability to enter seven letters of the alphabet! Once you have entered a letter in a particular round, entering the same letter again doesn't penalize you. It will simply be rejected - contrary to the TV game, where memory failure costs you a turn. You'll be glad to know that there are neither "LOSE A TURN" nor "BANKRUPT" spaces on this "wheel". Although they play an important part in a competitive game, they would serve only to frustrate the player in this "solitaire" version. Most of the TV rules apply, as do the sequence of events in a round. Even if you're not a "Wheel Watcher", you may get hooked on the real thing by playing the M-100 version! Finally, about exchanging database files - of your own invention or someone else's. The previous comments about the contents of a valid file apply, of course. It need only be an ordinary sequential .DO file, with the entries separated by commas (or carriage returns, although that results in a larger number of bytes used). The file looks like BASIC "DATA", without line numbers and the "DATA" statements. It would be a simple matter for players to develop some tough files for transfer via modem. It may also be tempting for the recipient to examine the file before using it. You'd have to be on the honor system! Well, there you have it. WHEEL.100's checksum is 364,811. The sample database file, WHEEL1.DTA, has a checksum of 92,178. Have fun!