Part 2 To: 999 (all members) From: D5B (Jon Ripley) Subject: Text compressor In the last issue I asked Chris if he'd like a text compressor for the magazine. Here it is! The compression routines themselves were written by Andrew Black in 1991 as part of a PD archiver. I extracted the relevant bits and added the menu and other bits. When you run the program you will be asked whether you wish you compress or decompress a text (ASCII/Teletext) file. The current directory is then catalogued, you will then be prompted for the name of the file to load and what the processed file should be savedas. The file is then compressed or decompressed as required. A reduction in size of 30%-40% is usually achieved.
The current version can only compress
ASCII files at present. If you try to
compress a different type of file you
will probably get an error.
Future versions might be able to compress all types of file. To: 999 (all members) From: D5B (Jon Ripley) Subject: Bad Program Repair 'BPrgFix' is a neat little program which can be used for repairing corrupted BASIC programs. To use the program, your corrupted program should be loaded. Enter: MODE 7 PAGE=&7000 CHAIN"BPrgFix" This loads the program into an area of memory that is hopefully out of the way of your program. You are asked to enter the PAGE value of the corrupted program, on a Master this is normally E00 (1900 on a BBC with DFS or 1D00 if you also have ADFS, 800 if you are using a second processor or 10000 when using BAS128!) The program then attempts to restore your program. When the program finishes, PAGE is set to the start of the program and you should be ready to SAVE your repaired program. To: 999 (all members) From: D5B (Jon Ripley) Subject: Formatting BASIC listings No, this isn't another programming article. But it is a great little program (originally a 1 liner) which you can use to help make reading BASIC programs easier. This program works by intercepting OSWRCH (Operating System WRite CHaracter) and each time a ':' is printed the cursor is moved to the start of the next line. This helps to visually split-up multi-line statements in a BASIC program. When you run the program, the machine code is assembled and you are asked if you want to either run the code or save it to disc. The program is disabled by pressing Break. To: 999 (all members) From: D5B (Jon Ripley) Subject: Converting View files Although View is a popular wordprocessor there are many people who do not own it. For these people it can be very difficult to read some text produced in View on another wordprocessor. This program works by removing all formatting and highlighting commands embedded in the text. Leaving you with an ASCII representation of the text which can be loaded into Wordwise or *Typed. When you run the program you will be asked to enter the filename of the View file to load and the name of the file which the converted text will be saved as. As the text is processed in memory you could use the same filename to save the text as. To: 999 (all members) From: D5B (Jon Ripley) Subject: Random Words This odd utility can be used for generating random words using a formula which generally produces words which are pronounceable. (The question is if you have to be drunk at the time...) If Superior's Speech! program has been loaded the program can attempt to say each of the words it produces. This utility is ideal for parties and making up names for stories... To: 999 (all members) From: D5B (Jon Ripley) Subject: Starship Traveller This program is very similar to one that appeared a few issues ago... This isn't a rip-off but is instead a one line game that I wrote several years ago (when tapes were still fashionable, well, not THAT long ago but you should get the idea!) The program uses up the maximum line length available in BBC BASIC. You must navigate through a field of stars. Hold SPACE to move up and release SPACE to move down. You must enter the gap at the other end of the screen. On each level the number of stars increases. What is the highest level you can complete? I hope that people will list the program and try and figure out how it works (and why it works!). You might want to load the 'FormBas' utility first as it will make reading the program a lot easier. To: 999 (all members) From: D5B (Jon Ripley) Subject: ELIZA This program is based on the famous psychology program called ELIZA. I wrote this in 1992 and have since lost my notes so I cannot tell you much about the history of ELIZA. You can have some surprising conversations with this implementation and some quite funny ones as well! Good Luck! To: 999 (all members) From: D5B (Jon Ripley) Subject: Starship Traveller Cheats If you would like to add a life counter to the game enter the following, L% is the number of lives: 45L%=3 55L%=L%-1:IF L%=0 CLS:PRINT"Game Over..." ELSE L=L-1:GOTO10 When you lose a life you will return to the start of the level you died on. Alternatively, for infinite lives enterthis instead. 60L=L-1:GOTO10 It is essential that you use GOTO10 instead of RUN, otherwise the game will not work properly. (Try it and see!) To: 999 (all members) From: D5B (Jon Ripley) Subject: New BBC screen modes It is possible to have more than the usual eight screen modes on the BBC. This program assembles short machine code routines to select these extra modes. When you run the program you will be asked which mode you want to assemble the code for, you can enter any number from 0 to 10. Modes 0 to 7 correspond the the normal BBC screen modes and modes 8 to 10 are as follows. Mode Text Graphics Colours Memory 8 10*32 80*256 16 10k 9 20*25 None 4 8k 10 10*25 None 16 8k You are asked if you would like to save the code that generates the mode or to run the code. If you are using these modes in Basic programs you should first select Mode 5 (when using mode 8) or Mode 6 (when using Modes 9 and 10). This is to ensure that HIMEM is properly set.