• Please review our updated Terms and Rules here

DEC Basic question

Ok, let’s see if I can figure it out, quote, copy, paste. Sounds simple enough.

Code:
Rock, Scissors and Paper game for PDP-11 using RT-11/DEC Basic tested on an 11/23.

10	REM ROCK SCISSORS PAPER GAME FOR PDP11
20	PRINT” THE GAME OF ROCK, SCISSORS AND PAPER”
30	PRINT
40	REM GAME NUMBER ROUTEEN
50	PRINT” HOW MANY GAMES WOULD YOU LIKE TO PLAY “
60	INPUT Q
70	IF Q<11 GOTO 120
80	PRINT” SORRY, BUT I AM NOT ALLOWED TO PLAY THAT MANY”
90	PRINT” PLEASE ENTER A NEW NUMBER BETWEEN ONE AND TEN “
100	GOTO 60
110	G=1 + G
120	PRINT
130	PRINT” THIS IS GAME NUMBER “G
140	PRINT

150	REM RANDOM NUMBER GENERATOR
160	X=INT (3*RND(0)+1)

170	REM PLAYERS INPUT AND VALID ENTRY ROUTEEN
180	PRINT” 3=ROCK, 2=SCISSORS AND 1=PAPER “
190	PRINT” WHATS YOUR CHOICE “
200	INPUT K
210	IF K=1 GOTO 260
220	IF K=2 GOTO 260
230	IF K=3 GOTO 260
240	PRINT” INVALID ENTRY, TRY AGAIN “
250	GOTO 180
260	PRINT” MY CHOICE IS “

270	REM MY CHOICE DISPLAY LOGIC
280	IF X=1 GOTO 310
290	IF X=2 GOTO 330
300	IF X=3 GOTO 350
310	PRINT” #1 PAPER “
320 	GOTO 380
330	PRINT” #2 SCISSORS “
340	GOTO 380
350	PRINT” #3 ROCK “
360	GOTO 380

370	REM GAME LOGIC
380	IF X=K GOTO 520
390	IF X>K GOTO 500
400	IF X=1 GOTO 450
410	PRINT
420	PRINT” YOU WIN “
430	H=H+1
440	GOTO 550
450      IF K< > 3 GOTO 420
460	PRINT
470	PRINT” I WIN “
480	C=C+1
490	GOTO 550
500	IF K < > 1 GOTO 470
505 	IF X < > 3 GOTO 470
510	GOTO 420
520	PRINT
530	PRINT” TIE GAME, NO WINNER “
540	F=F+1
550	IF G < Q GOTO 110

560	REM FINAL SCORE DISPLAY
570	PRINT
580	PRINT” THE FINAL GAME SCORE IS “
590	PRINT” GAMES THAT I WON “C
600	PRINT” GAMES YOU WON      “H
610	PRINT” TIE GAMES                   “F
620	REM END OF GAME OCT 2013
630	END



Note: to save a Basic file use the “SAVE” command, just name the file and do not include the .BAS extension.
To open an existing file in Basic use the “OLD’ command along with the file name.
 
Here's a new question about DEC BASIC-11:

Does anyone know how to specify that numbers should be handled as double precision?

I am attempting to code some programs from the book: Astronomical Algorithms, by Jean Meeus. Early on is the formula for computing the Julian Day Number for any given calendar date, and for days within my lifetime, the Julian Day number is something larger than 2,400,000. In single precision, BASIC-11 seems to default to converting numbers of this size to exponential notation, like 2.4E6. that's fine, but in the middle of calculations, I am losing the precision needed to preserve a calculation that should come out to be 2,436,116.31. Instead, I am getting something like 2.4361E6.

I have looken in the following documents:

PDP-11 RT-11 Introduction
PDP-11 RT-11 User's Guide
BASIC-11 Language Reference Manual
RT-11 Basic-11 User's Guide

I have found references to both single and double precision numbers, but I have not yet found how to specify that the calculation should use double precision numbers.

Anyone out there have a hint or a pointer?

Thanks in advance...

smp
 
I looked in the following documents:

PDP-11 RT-11 Introduction
PDP-11 RT-11 User's Guide
BASIC-11 Language Reference Manual
RT-11 Basic-11 User's Guide

So, here I am again, answering my own question:

I managed to find another document:

BASIC-11 / RT-11 Installation Guide

This document covers how to link together a BASIC-11 instance for your particular computer system. It appears that there was a software kit, which contained a number of .OBJ modules, as well as some configuration scripts (actually they were also BASIC programs) which led one through the process of linking together the appropriate elements to form a version of BASIC-11 by answering a series of questions.

In the instructions are details indicating that one could generate a BASICD.SAV file, which would be BASIC-11 working with double precision arithmetic. The vanilla flavor of BASIC-11 found in BASIC.SAV (this is the one that I have) worked in single precision arithmetic. It also appears that there could be different versions of BASICD.SAV depending on what hardware you indicated.

I believe that is the kicker for me. I do not have floating point hardware in my processor. I think that to operate in double precision requires floating point hardware, so I guess I'm out of luck with this - unless I obtain another processor that does have the floating point hardware installed.

smp
 
Last edited:
The executable Basic file that I have has several options when started; also the entire Basic set occupies two disks and has a ton of .SAV and .OBJ files. I just stick with simple files and little programs and never use all that stuff.
 
The executable Basic file that I have has several options when started; also the entire Basic set occupies two disks and has a ton of .SAV and .OBJ files. I just stick with simple files and little programs and never use all that stuff.

Yeah, I do not have the "software kit." I only managed to get four .SAV files from a blogger named Dave out on the Internet:

BAS8K.SAV - seems to be a version designed to run if you have only 8K of memory
BASIC.SAV - this is the one I was using when I first encountered my issue
BASICD.SAV - by the installation instructions, this seems to be a double precision version, but it does not run on my system
BASICS.SAV - I don't know what this one is, but it seems to have better precision arithmetic than the BASIC.SAV (I just tried it today)

Does anyone have an idea about what the file BASICS.SAV might be? Upon first try, it seems to have better precision arithmetic than the BASIC.SAV does.

smp
 
Just put an video on youtube of the Rock, Scissors, Paper program running on the 11/34, it’s a bit long while I am attempting to try to explain the components of the program and am certain that I said several things wrong but if you want to see it go to:

http://www.youtube.com/watch?v=MVIkWoX8IwM

Happy Holidays!
Ray F, AKA Qbus
 
Actually Ray, I think that's a very nice, well done video. It serves to offer those unfamiliar with Vintage operations a look into what it's like to use those tools and systems in an early 80's time frame. I like that you kept the human element in it, talking about various points you learned along the way - as a user.
 
Hello Reinhard - We see from your posted video that you run BASIC v2.1 for RT11. Is there a way you could share that version for the participants of this thread?

The full BASIC v2.0 kit seems to be difficult to locate and yours is the first v2.1 we've seen. The full kit is necessary to re-configure BASIC to use hardware floating point (if it isn't set that way already)

Thank you.
 
Can't attach the file (BASIC.DSK.zip = 143.4 KB ) with following problem: Sorry, the file exeeds the forum limit of 97.7 KB.
 
Thanks to Reinhard, this file may now be downloaded here.

I'll mount it later today and comment on it's contents.

UPDATE:

I was able to mount the disk as an MSCP (DU0) under E11 and verify it's contents are accessable and confirm that indeed it is BASIC. At first glance, it appears to be the complete BASIC-11 v2.1 kit for RT-11 - plus some additional files not associated with the kit.

The installation/configuration (SUCNFG.BAS) appeared to run correctly. I need to dig out the install docs again however, because my answers did not produce the expected output. (a double-precision Hardware Floating Point dependent version of BASIC) This is probably because I was working from 30 year old memories of an RSX system.

UPDATE2:

CONFIRMED: Garbage in, Garbage out. I put in the right answers and got a working FPU dependent Double Precision package out.



Thank you again Reinhard - I think this will be very helpful to those interested in this thread.
 
Last edited:
I'm going to add this recollection, because it is specific and concerns Lunar Lander.

Back in the day, when our PRO-380 based product was being developed, Lunar Lander was a popular diversion overworked team members often ran on the development machine between product test runs. The team had to do a number of things to customize the PRO for our needs, including an RSX Sysgen to produce some components we needed to supplement POS. (which was RSX based)

In all this exercise, the team got to dig pretty deeply into the system. One of the specifics they learned about their particular version of Lunar Lander was that it required Hardware Floating Point. (a speed issue?) I suspect this was learned when they tried to transplant it. I don't recall any reports of success in the effort - but when there was talk in this thread of Lunar Lander - it came to mind.

Not sure if the information's relevant - but hope it helps.
 
Back
Top