From 088a4a2998e5ff84a02b67caef26a87894a3bc70 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Thu, 18 Apr 2024 15:17:07 +0800 Subject: [PATCH] Add first port to EDUSystem 50 and expect script to upload code for testing. --- docs/index.html | 7 ++++ expect/tss8-basic | 53 ++++++++++++++++++++++++++ port/ACEYDU.BAS | 95 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 expect/tss8-basic create mode 100644 port/ACEYDU.BAS diff --git a/docs/index.html b/docs/index.html index 6348701..ddb5fc5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -13,6 +13,13 @@

BCG101: 101 BASIC COMPUTER GAMES

+

Methodology:

+ +

Book Covers:

1973 $5
1974 $7.50
1975 $7.50
diff --git a/expect/tss8-basic b/expect/tss8-basic new file mode 100644 index 0000000..48f7f42 --- /dev/null +++ b/expect/tss8-basic @@ -0,0 +1,53 @@ +#!/usr/bin/expect -- +# tss8-basic -- start a BASIC session on tss8 by uploading a file +# Copyright (c) 2021-2024 Renaud Fivet + +if { $argv == "" } exit +if [catch { set file [open $argv "r"]}] { puts $input ; exit } +close $file + +spawn telnet 192.168.1.6 4000 +#log_file session.log +set timeout 10 +expect "TTIX device, line " { sleep 1 ; send "\002s\r" } +while 1 { + expect { + "LOGIN PLEASE\r\n." { send "login 2003 tss8\r" ; break } + "\r\n." { send "KJ\r" } + timeout { send "\002s\r" } + } +} + +expect "\r\n\r\n." +send "r basic\r" +expect "NEW OR OLD--" { send "new\r"} +expect "NEW PROGRAM NAME--" { send "upload\r"} +expect "READY\r\n\r\n" { + set file [open $argv] + while 1 { + if {[gets $file line] == -1} break + set line [string trimleft $line] + set line [string toupper $line] + set len [string length $line] + while {$len > 40} { + set outs [string range $line 0 39] + set line [string range $line 40 end] + incr len -40 + send -- $outs + expect -ex $outs + } + + if {$len > 0} { + send -- $line + expect -ex $line + } + + send "\r" + expect "\r\r\n" + } + + close $file +} + +puts ">>>" +interact diff --git a/port/ACEYDU.BAS b/port/ACEYDU.BAS new file mode 100644 index 0000000..d1a0b66 --- /dev/null +++ b/port/ACEYDU.BAS @@ -0,0 +1,95 @@ + 10 REM *** GAME OF ACEY-DUCEY WRITTEN BY BILL PALMBY + 20 REM *** ADLAI STEVENSON HIGH SCHOOL, PRAIRIE VIEW, ILL + 30 REM *** TRANSLATED TO RSTS/E BY DAVE AHL, DIGITAL + 40 REM *** QUICK PORT TO EDUSYSTEM 50 BY RENAUD FIVET + 100 RANDOMIZE + 101 PRINT "ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER:" + 102 PRINT "THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP." + 103 PRINT "YOU HAVE THE OPTION TO BET OR NOT TO BET DEPENDING" + 104 PRINT "ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAVE" + 105 PRINT "A VALUE BETWEEN THE FIRST TWO." + 106 PRINT "IF YOU DO NOT WANT TO BET, INPUT A 0." + 110 PRINT + 160 Q=100 + 190 PRINT "YOU NOW HAVE"Q"DOLLARS." + 195 PRINT + 200 GOTO 260 + 210 Q=Q+M + 220 GOTO 190 + 240 Q=Q-M + 250 GOTO 190 + 260 PRINT "HERE ARE YOUR NEXT TWO CARDS..." + 270 A=INT(14*RND(1))+2 + 280 IF A<2 THEN 270 + 290 IF A>14 THEN 270 + 300 B=INT(14*RND(1))+2 + 310 IF B<2 THEN 300 + 320 IF B>14 THEN 300 + 330 IF A>=B THEN 270 + 350 IF A<11 THEN 400 + 360 IF A=11 THEN 420 + 370 IF A=12 THEN 440 + 380 IF A=13 THEN 460 + 390 IF A=14 THEN 480 + 400 PRINT A + 410 GOTO 500 + 420 PRINT "JACK" + 430 GOTO 500 + 440 PRINT "QUEEN" + 450 GOTO 500 + 460 PRINT "KING" + 470 GOTO 500 + 480 PRINT "ACE" + 500 IF B<11 THEN 550 + 510 IF B=11 THEN 570 + 520 IF B=12 THEN 590 + 530 IF B=13 THEN 610 + 540 IF B=14 THEN 630 + 550 PRINT B + 560 GOTO 650 + 570 PRINT "JACK" + 580 GOTO 650 + 590 PRINT "QUEEN" + 600 GOTO 650 + 610 PRINT "KING" + 620 GOTO 650 + 630 PRINT "ACE" + 650 PRINT + 660 PRINT "WHAT IS YOUR BET";\INPUT M + 670 IF M>0 THEN 680 + 675 PRINT "CHICKEN!!"\PRINT + 677 GOTO 260 + 680 IF M<=Q THEN 730 + 690 PRINT "SORRY, MY FRIEND, BUT YOU BET TOO MUCH" + 700 PRINT "YOU HAVE ONLY"Q"DOLLARS TO BET." + 710 GOTO 650 + 730 C=INT(14*RND(1))+2 + 740 IF C<2 THEN 730 + 750 IF C>14 THEN 730 + 760 IF C<11 THEN 810 + 770 IF C=11 THEN 830 + 780 IF C=12 THEN 850 + 790 IF C=13 THEN 870 + 800 IF C=14 THEN 890 + 810 PRINT C + 820 GOTO 910 + 830 PRINT "JACK" + 840 GOTO 910 + 850 PRINT "QUEEN" + 860 GOTO 910 + 870 PRINT "KING" + 880 GOTO 910 + 890 PRINT "ACE" + 910 IF C>A THEN 930 + 920 GOTO 970 + 930 IF C>=B THEN 970 + 950 PRINT "YOU WIN!!!" + 960 GOTO 210 + 970 PRINT "SORRY, YOU LOSE." + 980 IF M