Herb’s BASIC One-Liners

Author(s): Herb Bowers
Pub Details: Time Designs Magazine v3 n6 (Volume 3, Issue 6)
Date: September/October 1987
Pages: 7

Here are a couple of nifty one-liners from the “ABBA SOFT Super Sub Shop”, that some of you may be interested in. “We gotta million of ’em folks” and from time to time we would like to share them with you.

There are a few draw backs in the use of PAUSE 0 on the TS2068. First of all, PAUSE cannot be released with the joystick button, and second, if you are using a color TV for your monitor, you get a lot of distortion in a color program display during PAUSE.

On the TS1000 PAUSE 0 can be simulated with PAUSE 4E4, but the disadvantage is the annoying “jump” when any PAUSE is used.

On mult-player games on the TS2068, a function is activated by a player using a key or button (to activate a one armed bandit, spin or stop a “wheel”, etc.). It is necessary for all participants to hover over the keyboard waiting for their turn. It is so much better to have one player at the keyboard making the needed keyboard entries and the other player(s) using a joystick button to initiate their turns.

The system I use on my TS2068 is a one line “catch all” simulated PAUSE 0 sub-routine, that not only allows release with the right or left joystick button, but also from the keyboard, along with a “count down” timer option.

PSEUDO PAUSE 0 SUB:

“` 1 FOR f=0 TO 1: LET f=1* STICK (2,1)<>0 OR STICK (2,2)<>0 OR INKEY$=” “: NEXT f: RETURN “`

After you have keyed-in the above line, enter as a direct command GOSUB 1. Now press either the right or left joystick button or the space bar. You will get an “ok” code at the bottom of the screen. You can change the INKEY$=” ” to any character you want, to release the pause, or to INKEY$=CHR$ 13 and only ENTER will release the pause.

If you are a little “heavy fingered”, you can put a delay in using the following instead.

PSEUDO PAUSE 0 SUB WITH DELAY:

“` 1 FOR f=1 TO 20: NEXT f: FOR f=0 TO 1: LET f=1* STICK (2,1)<>0 OR STICK (2,2)<>0 OR INKEY$=” “:NEXT f “`

Perhaps you had better type in the following test module to illustrate this.

“` 100 GOSUB 1:PRINT “ok”:GOTO 100 “`

Now enter the command GOTO 100.

There are times when it is nice to have a count-down timer to limit the amount of time the player has to make up his/her mind. Try the following.

PSEUDO PAUSE 0 SUB WITH TIMER:

“` 1 LET t=11:FOR f=0 TO 1: LET t=t-.041:PRINT AT 0,0;INT t;” “: LET f=* STICK (2,0)<>0 OR STICK (2,1)<>0 OR INKEY$=” ” OR t<0 : NEXT f:RETURN “`

This gives you a 10 second count down. To change count-down time, change the value of “t” in the first statement to 1 more than the number of seconds you want. The decimal -.041 can be adjusted to speed up or slow down the count according to your area, program length or the heat and humidity. Use the same test routine as above to test this sub.

Ok, now for the good old TS1000. I don’t have mine anymore (sure wish that I did), but here is the one-liner for a pseudo PAUSE 0 without the “jump”. Sure you can accomplish it with a FOR/NEXT loop, but that takes a minimum of 3 lines. Let’s do it with one.

NO JUMP PAUSE 0 FOR THE T/S 1000

“` 10 GOTO 10+(INKEY$<>””) “`

That’s it! Now RUN [ENTER]. See it really works. The above routine will drop thru to the next program line. Always change the numeric value to the line you put the routine on.

So maybe you don’t want to drop to the next program line. Let’s say that you want to skip to line 100. Ok! Use the following.

“` 10 GOTO n+((INKEY$<>””)*n2) “`

In the above, n=current line. n2=line to be jumped too -n. So you want to jump to line 100 from line 10, then make n=10 and n2=90…

I really hope that you can put the above one-liners to good use. Let us know if you would like to see more.

Editor: Herb Bowers is chief owner and programmer for ABBA SOFT. Write to him c/o TDM or direct to: 2588 Woodshire Circle, Chesapeake, VA 23323.