aboutsummaryrefslogtreecommitdiffstats
path: root/day6/part1.bas
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-12-06 08:29:28 -0500
committerClyne Sullivan <clyne@bitgloo.com>2022-12-06 08:29:28 -0500
commit63cb27c091a8b4b419846f64aa7d541375944703 (patch)
treebfbf1aa02df879eb7e43ce7375933dc3abc7fa4b /day6/part1.bas
parent9be1e181be4cd58c0d6dd0f1c53d8d009cf0d147 (diff)
day6: basic for both parts
Diffstat (limited to 'day6/part1.bas')
-rw-r--r--day6/part1.bas61
1 files changed, 0 insertions, 61 deletions
diff --git a/day6/part1.bas b/day6/part1.bas
deleted file mode 100644
index cb04c43..0000000
--- a/day6/part1.bas
+++ /dev/null
@@ -1,61 +0,0 @@
-REM Advent of Code 2022: Day 6, part 1
-REM Written in Applesoft BASIC
-
- 5 HOME
- 10 A = 1000
- 20 R = 0
- 50 PRINT CHR$ (4),"OPEN INPUT"
- 60 PRINT CHR$ (4),"READ INPUT"
- 70 ONERR GOTO 900
- 100 PRINT "INITIALIZING COMMUNICATION SYSTEM";
- 105 A = 350
- 110 FOR I = 0 TO 6
- 120 GOSUB 1000
- 130 PRINT ".";
- 140 NEXT I
- 150 PRINT
- 200 PRINT "OPENING SIGNAL DATASTREAM";
- 210 FOR I = 0 TO 6
- 220 GOSUB 1000
- 230 PRINT ".";
- 240 NEXT I
- 250 PRINT
- 260 PRINT
- 300 PRINT "SCANNING FOR START-OF-PACKET MARKER:"
- 310 HTAB 1
- 320 VTAB 8
- 330 PRINT "||||";
- 340 HTAB 1
- 350 VTAB 10
- 360 PRINT "||||";
- 400 HTAB 1
- 410 VTAB 9
- 420 PRINT S$;
- 430 IF LEN (S$) > = 4 GOTO 500
- 440 GET C$
- 450 S$ = C$ + S$
- 455 IF LEN (S$) > 40 THEN S$ = MID$ (S$,1,40)
- 460 A = 80
- 470 GOSUB 1000
- 475 R = R + 1
- 480 GOTO 400
- 500 HTAB 1
- 510 VTAB 7
- 530 IF MID$ (S$,1,1) = MID$ (S$,2,1) THEN PRINT "/\ ";: GOTO 600
- 540 IF MID$ (S$,1,1) = MID$ (S$,3,1) THEN PRINT "/-\ ";: GOTO 600
- 550 IF MID$ (S$,1,1) = MID$ (S$,4,1) THEN PRINT "/--\";: GOTO 600
- 560 IF MID$ (S$,2,1) = MID$ (S$,3,1) THEN PRINT " /\ ";: GOTO 600
- 570 IF MID$ (S$,2,1) = MID$ (S$,4,1) THEN PRINT " /-\";: GOTO 600
- 580 IF MID$ (S$,3,1) = MID$ (S$,4,1) THEN PRINT " /\";: GOTO 600
- 590 PRINT " ";
- 595 GOTO 700
- 600 GOTO 440
- 620 VTAB 14
- 700 HTAB 1
- 710 VTAB 13
- 720 PRINT "MARKER FOUND AT INDEX ";R;"."
- 900 PRINT CHR$ (4),"CLOSE"
- 910 END
- 1000 FOR Z = 0 TO A: NEXT Z
- 1010 RETURN
-