Computing > Vintage Computing

Days of Old: When Men were Men and Nerds Typed in BASIC programs

**DrG**:

Did some crate digging yesterday and found this.

It is a collection of BASIC program listings that folks could type in to show off their home computer. Copyright 1978, but the individual programs are apparently from earlier issues of Creative Computing magazine. As I recall, I picked up two of these "collections" at a used bookstore, probably in the early 1980s.

The collection is edited by David Ahl, the publisher of Creative Computing magazine [look him up]. Check out the biographical blurb.

Now, I consider myself an 'old timer', but he is definitely my senior chronologically and experientially - in fact, of all those computers listed, I have only laid hands on two (PDP 8,11).

Here were all the BASICs that the programs would run on - and what conversion issues you might encounter. It's interesting because it serves as a historical marker of what early home computers were out there at the time - qualified by the location of the intended audience.

...then, of course, were all the programs. You would type these in (line by line and tiny dot-matrix print) and you had, potentially, something amusing working on your computer! Some of the listings were quite extensive and I imagine were quite an effort (I would only type in a few short ones). Lunar Landing, BlackJack, Craps, and of course, SUPER STAR TREK!

Good Times :)

**MIS42N**:

Those days! I wrote a planet finder - put in date, time, latitude, longitude and it says where to look. In 4kbyte

--- Code: ---'

' Program to calculate position of planets

' ========================================

'

' The position of the planets are calculated in 3 dimensions, initially

' in a coordinate system using the orbit of the earth as the XY plane,

' the sun as origin (0,0,0), the mean radius of the orbit of the earth as

' 1 unit, the X+ axis passing through the earth's position at the vernal

' equinox. Most planet data is made available in this reference system.

'

' These coordinates are then recalculated with the same origin and X axis

' but with the XY plane parallel to the earth's equator. By knowing the

' earth's position and the planet's position, the direction of the planet

' is given in R.A. (right ascension) and declination.

'

' Given the latitude and longitude of the observer, it is possible to

' recalculate to azimuth and altitude.

'

' ========================================

'

' Latitude and Longitude of observer expressed as radians

' J = Longitude -- E of Greenwich is +

' K = Latitude -- N of equator is +

' N = Local time offset in hours [Local - GMT]

'

10 J = 2.641265: K = -.532325: N = 10!

'

' P = Pi; FNA - reduce radians to 0 -> 2Pi

'

20 P = 3.1415926#: DEF FNA (X) = X - INT(X / (P * 2)) * P * 2

'

' Get date, reduce to number of days in G [1/1/1900 = 1]

'

100 INPUT "Date D,M,Y"; B, C, D: IF C < 3 THEN C = C + 12: D = D - 1

110 C = C + 1: G = B + INT(C * 153 / 5) + INT(D * 1461 / 4) - 63

'

' Get time, reduce to minutes since midnight in H

'

120 INPUT "TIME (24HR CLOCK) H,M"; B, C: H = B * 60 + C

'

130 INPUT "NO. OF PREDICTIONS"; S: IF S = 1 GOTO 150

'

' TI - Time Interval in minutes

'

140 INPUT "INTERVAL H,M"; B, C: TI = B * 60 + C

'

150 INPUT "PLANET NO."; V

'

' T = time in days and a fraction used to calculate positions etc. The base

' date for calculation was midday 31/12/1899 GMT [hence the -.5]

' When calculating using the earth's rotation, it is convenient to keep

' time as whole days (G) and hours (H) also.

' O = Angle between earth's axis and earth's orbit (changes with time)

'

160 FOR TC = 1 TO S: T = G + H / 1440 - .5 - N / 24: O = .40932 - T * 6.212E-09

'

' A$ - name of planet

' A - mean distance from sun (earth = 1)

' E - eccentricity, B - time correction for E

' I - angle of planet orbit, C - time correction for I

' U - angle from X axis to where orbital plane crosses, D - time correction

' W - angle between U and perihelion, F - time correction

' L - mean longitude of planet at reference [31/12/1899]

' X - whole days + 1 to orbit the sun

' Y - radians in excess of one orbit completed in X days

' Z - angular velocity radians/day

'

170 RESTORE: FOR Q = 0 TO 8: READ A$, A, E, B, I, C, U, D, W, F, L, X, Y, Z

180 IF Q = 0 THEN GOSUB 600: EX = X: EY = Y: EZ = Z: EL = L: ER = R: GOTO 470

190 IF V > 0 AND V <> Q GOTO 470

200 GOSUB 600

210 C = G - 60: D = INT(C / 1461): C = C - D * 1461: B = INT(C / 365): IF B = 4 THEN B = 3

220 C = C - B * 365 + 31: D = D * 4 + B: B = C * 5: C = INT(B / 153): B = INT((B - C * 153) / 5) + 1: C = C + 2

230 IF C > 12! THEN C = C - 12: D = D + 1

240 PRINT : PRINT : PRINT " DATE TIME": PRINT

250 F = B: GOSUB 580: F = C: GOSUB 570: F = D: GOSUB 570

260 PRINT " "; : F = INT(H / 60): GOSUB 580: PRINT ":"; : F = H - F * 60: GOSUB 580

270 I = FNA((H / 60 - N) * P / 12 + EL - .000099): F = I: PRINT : PRINT

280 PRINT "G.M.S.T. "; : GOSUB 530

290 I = FNA(I + J): F = I: PRINT "LOCAL S.T. "; : GOSUB 530

300 PRINT : PRINT "DATA FOR "; A$: PRINT

310 B = X - EX: GOSUB 750: A = ATN((Y - EY) / B): IF B < 0 THEN A = A + P

330 PRINT "R.A. "; : F = A: GOSUB 530

340 W = (X - EX) ^ 2 + (Y - EY) ^ 2: B = SQR(W): GOSUB 750

350 E = ATN((Z - EZ) / B): F = E: PRINT "DECLINATION "; : GOSUB 500

360 C = W + (Z - EZ) ^ 2: B = (C + ER ^ 2 - R ^ 2) / (2 * ER * SQR(C)): GOSUB 750

380 F = ATN(SQR(1 - B ^ 2) / B): IF B < 0 THEN F = F + P

390 PRINT "ELONGATION "; : GOSUB 500

400 U = FNA(A - I): F = U: PRINT : PRINT "HOUR ANGLE "; : GOSUB 530

410 C = SIN(K) * SIN(E) + COS(K) * COS(E) * COS(U): B = SQR(1 - C ^ 2): GOSUB 750

420 F = ATN(C / B): PRINT : PRINT "ALTITUDE "; : GOSUB 500

430 B = COS(K) * SIN(E) - SIN(K) * COS(E) * COS(U): C = COS(E) * SIN(U)

435 GOSUB 750: F = ATN(C / B): IF B < 0 THEN F = F + P

440 F = FNA(F): PRINT "AZIMUTH "; : GOSUB 500

450 PRINT : PRINT "PRESS ANY KEY FOR MORE"

460 DO

LOOP UNTIL LEN(INKEY$) > 0

'

'

470 NEXT Q: H = H + TI: B = INT(H / 1440): G = G + B: H = H - B * 1440: NEXT TC: END

'

500 B = F * 180 / P: F = SGN(B) * INT(ABS(B)): B$ = STR$(F): C = LEN(B$)

510 FOR D = 1 TO C: C$ = MID$(B$, D, 1): IF C$ <> " " THEN PRINT C$;

520 NEXT D: PRINT CHR$(248); : GOTO 550

530 B = F * 12 / P: IF B < 0 THEN B = B + 24

540 F = INT(B): GOSUB 580: PRINT "HR";

550 B = ABS(B - F) * 60: F = INT(B): GOSUB 580: PRINT "'";

560 F = INT((B - F) * 60 + .5): GOSUB 580: PRINT CHR$(34): RETURN

570 PRINT "/";

580 PRINT MID$(STR$(F + 100), 3, 2); : RETURN

'

'

' time adjust E, I, U, W

'

600 E = E + B * T: I = I + C * T: U = U + D * T: W = W + F * T

' Calculate mean position of planet at time T, relative to its perihelion

' To avoid rounding errors, we remove most or all the whole orbits of the

' sun, by removing from the time component a multiple of the number of days

' in which a whole orbit and a bit was completed (X), but generating an

' an angle which is the residuals of the orbits (residual is Y). The mean

' position at time T relative to perihelion is in M

610 B = INT(T / X): C = T - B * X: L = B * Y + C * Z + L: M = FNA(L - U - W): X = M

' successively approximate X the difference between M and the actual position

620 Y = (M - X + E * SIN(X)) / (1 - E * COS(X)): X = X + Y: IF ABS(Y) > .0000005 GOTO 620

'

630 B = COS(X / 2): GOSUB 750: F = 2 * ATN((SQR((1 + E) / (1 - E)) * SIN(X / 2)) / B)

650 R = A * (1 - E * COS(X)): Y = W + F

660 B = R * (COS(U) * COS(Y) - SIN(U) * SIN(Y) * COS(I))

670 C = R * (SIN(U) * COS(Y) + COS(U) * SIN(Y) * COS(I))

680 D = R * SIN(Y) * SIN(I)

690 X = B: Y = C * COS(O) - D * SIN(O): Z = C * SIN(O) + D * COS(O)

700 RETURN

750 IF B = 0 THEN B = 1E-10

760 RETURN

800 DATA EARTH,1,.016751,-.114E-8,0,0,0,0,1.766637,.8215E-6,1.740035,366,.0130363,.01720279

810 DATA MERCURY,.3870986,.205614,.56E-9 ,.122223,.889E-9,.822915,.5663E-6,.501785,.177E-6,3.109812,88,.00225458,.07142545

820 DATA VENUS,.7233316,.006821,-.131E-8,.05923,.481E-9,1.322602,.43E-6,.949185,.2428E-6,5.982413,225,.00851648,.02796311

830 DATA MARS,1.523692,.093313,.282E-8,.032294,.323E-9,.851484,.3684E-6,4.981723,.5112E-6,5.126863,687,.6438E-3,.009146767

840 DATA JUPITER,5.2028,.048332,.449E-8,.022842,-.272E-8,1.735536,.4823E-6,4.77105,.2171E-6,4.16936,4333,.5989E-3,.00145022

850 DATA SATURN,9.538843,.05589,-.945E-8,.04350,-.186E-8,1.968489,.4152E-6,5.9044,.5254E-6,4.666956,10760,.5051E-3,.5839825E-3

860 DATA URANUS,19.18195,.0471,0,.013483,.398E-9,1.282478,.2515E-6,1.668002,.5137E-6,4.26205,30686,.1616E-3,.2047626E-3

870 DATA NEPTUNE,30.0578,.0085,0,.031052,-.451E-8,2.280806,.525E-6,4.767997,-.2006E-6,1.498626,1,.10439E-3,.1E-3

880 DATA PLUTO,39.4387,.2494,0,.29915,0,1.902409,.7053E-6,2.009925,0,1.648242,1,.69454E-4,.7E-4

--- End code ---

**tggzzz**:

Learning to program in Algol on a Burroughs machine in 1956 is quite an achievement.

Algol was designed between 1958 and 1960.

**rfclown**:

I typed in some of those programs. I was (am still am) fascinated with the Amazing program that printed out a random maze. I never tried to figure out how it worked.

**AndrewNorman**:

Spent many hours typing programs into my BBC Model B and trying to figure out why it wasn't working.

There were the standard programs that calculated biorhythms and the text-based pace invaders.

Managed to get a big program to run an RPG game typed in by my friend's mother who was a typist from a pool who was used to typing stuff without understanding what she was typing :D.

Now spend all my days writing code to pay for my evenings playing with electronics :)

Navigation

[0] Message Index

[#] Next page

Go to full version