AUGUST 1988

SHORT-SHORT PROGRAM CONTEST

WINNERS

Last February we asked you to enter your best and shortest original programs in our Short-Short Program Contest. This month, we are proud to present the winners and their creations. To see how much a few lines can do, make sure you're in BASIC, then type in and RUN, in turn, each program for your particular computer. It's quick, easy, and fun!

HONORABLE MENTION

10 FORA=680TO749:READB:POKEA,B:NEXT
20 DATA169,1,162,8,160,,32,186,255,32,87,226,32,,226,1,34,44,142
30 DATA192,2,169,,141,,,162,1,164,44,32,213,255,200,132,2,32,51
40 DATA165,169,8,133,44,96,32,,226,165,123,72,165,122,72,165,58
50 DATA72,165,57,72,169,141,72,169,,133,122,134,123,76,174,167

Terrence Halloran of Garden Grove, California, submitted this handy machine-language program. After you run this program, you'll have two powerful new C-64 BASIC commands, SYS 680 and SYS 723 ("load" and "call," respectively). These let you load and call subprograms written in BASIC without overlaying your main program. For example:


SHUFFLE = 192
SYS 680 "CARDSX",SHUFFLE
DEAL = PEEK(2)
SYS 680 "CARDSZ",DEAL
SYS 723,SHUFFLE
SYS 723,DEAL
SYS 723,DEAL

        

These commands will load subprogram "CARDSX" at address block 192 and subprogram "CARDSZ" at the next available address block, temporarily naming them SHUFFLE and DEAL, then call the SHUFFLE subprogram once and the DEAL subprogram twice.

All variables are shared, giving you an easy way to pass data from one program to another. Each subprogram must finish with a RETURN command.