mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-17 23:56:24 -05:00
Add first port to EDUSystem 50 and expect script to upload code for testing.
This commit is contained in:
parent
8af42944bc
commit
088a4a2998
@ -13,6 +13,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>BCG101: 101 BASIC COMPUTER GAMES</h1>
|
||||
<h3>Methodology:</h3>
|
||||
<ul>
|
||||
<li>Proof read code from 1975 3rd printing.</li>
|
||||
<li>Quick port to EDUSystem 50 for testing.</li>
|
||||
<li>Refactor to take adantage of BASIC implementation.</li>
|
||||
</ul>
|
||||
<h3>Book Covers:</h3>
|
||||
<img src="img/1973.jpg" /> 1973 $5<br>
|
||||
<img src="img/1974.jpg" /> 1974 $7.50<br>
|
||||
<img src="img/1975.jpg" /> 1975 $7.50<br>
|
||||
|
53
expect/tss8-basic
Normal file
53
expect/tss8-basic
Normal file
@ -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
|
95
port/ACEYDU.BAS
Normal file
95
port/ACEYDU.BAS
Normal file
@ -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<Q THEN 240
|
||||
1000 PRINT
|
||||
1010 PRINT "SORRY, FRIEND, BUT YOU BLEW YOUR WAD."
|
||||
1020 PRINT "TRY AGAIN (YES OR NO)";\INPUT A$
|
||||
1030 IF A$="YES" THEN 110
|
||||
1040 PRINT\PRINT "O.K. HOPE YOU HAD FUN!!"
|
||||
1050 END
|
Loading…
Reference in New Issue
Block a user