Altair 680 blinkenlights

138 views
Skip to first unread message

Rob Foster

unread,
Jan 18, 2026, 6:12:36 AM (10 days ago) Jan 18
to Altair-Duino
I wanted something to keep the 680 busy while sitting there and the lights flashing away to look like it is doing something important, so I run this BASIC program to calculate digits of Pi.
The higher the number of digits you ask it to generate, the longer it takes to run, even each digit takes longer to generate. (ie, if you ask it to generate 10 digits, it might take a couple of minutes to generate the first 10 digits. If you ask for 400, it might take over an hour to generate the first 10 digits).

Four hundred digits will take it many hours to complete, given the speed the simulator is running at. You are limited by memory on the max digits it can calculate.

Code found at rosettacode.org, I just modified it to input the number of digits.

10 REM PI DIGITS GENERATOR
20 INPUT "NUMBER OF PI DIGITS";N
30 LN = INT(10*N/3)+16
40 ND = 1
50 DIM A(LN)
60 N9 = 0
70 PD = 0:REM FIRST PRE-DIGIT IS A 0
80 REM
90 FOR J = 1 TO LN
100 A(J-1) = 2:REM START WITH 2S
110 NEXT J
120 REM
130 FOR J = 1 TO N
140 Q = 0
150 FOR I = LN TO 1 STEP -1:REM WORK BACKWARDS
160 X = 10*A(I-1) + Q*I
170 A(I-1) = X - (2*I-1)*INT(X/(2*I-1)):REM X - INT ( X / Y) *
180 Q = INT(X/(2*I - 1))
190 NEXT I
200 A(0) = Q-10*INT(Q/10)
210 Q = INT(Q/10)
220 IF Q=9 THEN N9 = N9 + 1: GOTO 450
240 IF Q<>10 THEN GOTO 350
250 REM Q == 10
260 D = PD+1: GOSUB 500
270 IF N9 <= 0 THEN GOTO 320
280 FOR K = 1 TO N9
290 D = 0: GOSUB 500
300 NEXT K
310 REM END IF
320 PD = 0
330 N9 = 0
335 GOTO 450
340 REM Q <> 10
350 D = PD: GOSUB 500
360 PD = Q
370 IF N9 = 0 THEN GOTO 450
380 FOR K = 1 TO N9
390 D = 9: GOSUB 500
400 NEXT K
410 N9 = 0
450 NEXT J
460 PRINT RIGHT$(STR$(PD),1)
470 END
480 REM
490 REM OUTPUT DIGITS
500 IF ND=0 THEN PRINT RIGHT$(STR$(D),1);: RETURN
510 IF D=0 THEN RETURN
520 PRINT RIGHT$(STR$(D),1);".";
530 ND = 0
550 RETURN

Rob Foster

unread,
Jan 18, 2026, 1:37:07 PM (10 days ago) Jan 18
to Altair-Duino
My setup. A 'retro' style 3d printed teminal (running a raspberry pi and Cool-Retro-Term' software and the 680 cranking out pi digits.

IMG_1912.jpg

Tom Brusehaver

unread,
Jan 18, 2026, 1:55:58 PM (10 days ago) Jan 18
to Rob Foster, Altair-Duino
Nice, I really like the adm 3a curves 

--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/altair-duino/d3eaea10-a720-4e8e-8d78-fddb731a9653n%40googlegroups.com.

sunnybo...@gmail.com

unread,
Jan 18, 2026, 10:52:26 PM (9 days ago) Jan 18
to Altair-Duino
I'm having a problem with the BASIC Pi Generator program. Having checked my typing several times, I'm getting an error when running on line 170

170 A(I-1) = X - (2*I-1)*INT(X/(2*I-1)):REM X - INT ( X / Y) *

It does appear incomplete. Am I missing something?
-R

Tom Lake

unread,
Jan 19, 2026, 12:00:16 AM (9 days ago) Jan 19
to Altair-Duino
Whatever is missing wouldn't have any effect on the program. It's after the REM so it's ignored.
The program runs as written for me.

Tom Lake

unread,
Jan 19, 2026, 1:55:26 AM (9 days ago) Jan 19
to Altair-Duino
Screenshot 2026-01-19 015210.jpg
On Sunday, January 18, 2026 at 10:52:26 PM UTC-5 sunnybo...@gmail.com wrote:

Rob Foster

unread,
Jan 19, 2026, 5:13:31 AM (9 days ago) Jan 19
to Altair-Duino
Weird, your line 170 looks ok to me. I never type these programs in manually, I just copy and paste into my terminal program.

If you do that, set a character and new line delay in your terminal program otherwise it might not paste properly. 

Try copy / paste and see if that works.

On Sunday, January 18, 2026 at 10:52:26 PM UTC-5 sunnybo...@gmail.com wrote:

Rob Foster

unread,
Jan 19, 2026, 6:45:20 AM (9 days ago) Jan 19
to Altair-Duino
If you can't get the pi program to work, here is another 'busy' program that is much shorter if you are typing it in manually.
If calculates the prime factors of every integer from 2 to 10000.
Prime numbers are fascinating to me, the fact that every integer greater than to can be generated by multiplying prime numbers together.
This one I had google AI write the code.

10 FOR M = 2 TO 10000
15 N = M
20 PRINT N;": ";
30 D = 2
40 IF N < 2 THEN GOTO 90
50 IF N / D = INT(N / D) THEN PRINT D; : N = N / D : GOTO 50
60 D = D + 1
70 IF D * D <= N THEN GOTO 50
80 IF N > 1 THEN PRINT N
85 IF N <= 1 THEN PRINT
90 NEXT M
100 END

sunnybo...@gmail.com

unread,
Jan 19, 2026, 12:15:59 PM (9 days ago) Jan 19
to Altair-Duino
Thanks Tom,
In spite of typing line 170 in several times, I managed to make the same mistake a few times (missing parenthesis!).
Works now... though I seem to  have another error in formatting (my numbers generate newlines between each number).
-R

sunnybo...@gmail.com

unread,
Jan 19, 2026, 12:19:05 PM (9 days ago) Jan 19
to Altair-Duino
Works now. I missed the ";" in line 500 when I typed it in again this morning. 
-R

Charles Wall

unread,
Jan 20, 2026, 7:36:27 PM (7 days ago) Jan 20
to Altair-Duino
I used copy and paste with PUTTY to load the program, and it runs fine.  I had to copy and paste 2 lines of code at a time because I was unable to find how to add transmission delays in PUTTY.  Could someone tell me where to look for that functionality in PUTTY for future use?
Thank you.

Rob Foster

unread,
Jan 21, 2026, 4:27:40 AM (7 days ago) Jan 21
to Altair-Duino
I use teraterm, I asked google AI about putty and it told  me this:

To set character or line delays in PuTTY to prevent text pasting issues, specialized versions or alternative clients like Tera Term are typically required because native PuTTY often lacks this feature.


Reply all
Reply to author
Forward
0 new messages