STOS BASIC is a dialect of the BASIC programming language for the Atari ST that is suited for creating games and other multimedia applications. The functionality of STOS can be extend by adding extensions which added more commands to the language and increased the functionality.
Originally developped by Jawx, and released in the UK 1988 by Mandarin Software, it developed a dedicated following, and is still around today. The source-code to STOS has recently been released.
Here we have some one-liners - complete games written in one line of STOS BASIC!
There are currently two - Green Things From Mars and Line C 1 6P (a 6 palyer no-AI version of Line Crash for STEs and above).
A trick to use is the property that expressions have of resolving to a
Boolean value. A statement such as (A>B)
resolves to
true
if A>B
or false
if
A<=B
.
As the value of true
is -1
and false
is 0
, these values can be used in arithmetical expressions.
An example follows:
Y=Y+(jup-jdown) and not(ISDEAD)
Here, the change in the Y direction (known as the Y-delta)
is worked out by subtracting the joystick-Boolean-value jdown
from
jup
. The Y-delta is then added to the Y
position.
not(ISDEAD)
resolves to -1
if ISDEAD=false
, and and
'ing anything with
-1
returns the same value (-1 means all bits in an integer-value
are set). But if ISDEAD=true
, then and
'ing
not(ISDEAD)
with the Y-delta always produces 0
.
1 dim A(15),B(15) : X=160 : Y=100 : set mark 3,17 : for T=1 to 15 : A(T)=rnd(250)+25 : B(T)=rnd(140)+40 : next T : repeat : ink 0 : for T=1 to 15 : ink 0 : K=A(T) : L=B(T) : polymark K,L : Q=(K>X)-(K<X) : R=(L>Y)-(L<Y) : K=K+rnd(2)-1+Q : L=L+rnd(2)-1+R : ink 11 : polymark K,L : A(T)=K : B(T)=L : next T : Q=(jleft)-(jright) : R=(jup)-(jdown) : C=point(X,Y) : ink 0 : polymark X,Y : X=X+Q : Y=Y+R : ink 10 : polymark X,Y : until C=11 : boom
Yes, I know about the redundant
ink 0
statement. I just wanted to preserve the original version.
Green Things From Mars does not require any extensions. It was written with just the original STOS commands.
1 dim X(6),Y(6),D(6) : sticks on : mode 0 : key off : flash off : hide on : palette $0,$777,$700,$770,$70,$77,$7,$707 : ink 1 : box 0,9 to 319,199 : for T=1 to 6 : X(T)=45*T : Y(T)=100 : next T : repeat : S=0 : L#=0 : for T=1 to 6 : X(T)=X(T)-(l stick(T)-r stick(T))*not(D(T)) : Y(T)=Y(T)-(u stick(T)-d stick(T))*not(D(T)) : D(T)=(point(X(T),Y(T))<>0) : ink T+1 : S=S+D(T) : L#=L#+10^(-T*(D(T)=0)) : plot X(T),Y(T) : next T : until S<=-5 : pen log(L#)+1 : print "winner"
On the downloads page, you can download both the 1-liners in .BAS format.
Give your games some extra joy - plug in some extra joysticks!
On the downloads page, you can find a .ZIP file containing the instructions for how to build adaptors for plugging extra joysticks into your ST or STE. It also contains some STOS BASIC sourcecode (in an ASCII file-format) for accessing them (the code can easily be converted to another language). However, there are some STOS extensions that add commands to access these extra joysticks that make the included code redundant. The STE Extension reads the STE joystick-port joysticks and the Control Extension reads the paralell-port joysticks.
The extra joystick adaptors come in two varieties. A paralell-port (Centronics) adaptor (which takes two joysticks) and an STE joystick-port adaptor (which takes two joysticks). The latter can only be plugged into STE/TT/Falcon machines. There is one paralell-port and two STE joystick ports. Combine this with the two standard ST joystick ports, and a total of eight joysticks can be plugged in (or four if the machine is not a STE/TT/Falcon).
Here are a few more things Wacko Software have been doing with STOS BASIC that are mentioned on the main Wacko Software homepage.
[none]
Feedback:
Use this link to leave some feedback for this webpage.
Last update: Mon 31 Jul 2006
Back to Wacko Software's homepage