-
Notifications
You must be signed in to change notification settings - Fork 48
/
prog_examples_basic_due.h
8580 lines (8519 loc) · 279 KB
/
prog_examples_basic_due.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// -----------------------------------------------------------------------------
// Altair 8800 Simulator
//
// This file contains copies of a number of BASIC examples found in various
// places on the net, created by various authors.
//
// While the Altair 8800 simulator code itself is released under GPLv3,
// the contents of this file are excluded from that license for obvious reasons.
// -----------------------------------------------------------------------------
// [this gets included from prog_examples.cpp]
// short example list: quicker upload => easier for debugging
//#define USE_SHORT_EXAMPLE_LIST
#include "config.h"
const char basic_23_match[] =
"20 PRINT TAB(31);\"23 MATCHES\"\r"
"30 PRINT TAB(15);\"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\"\r"
"40 PRINT:PRINT:PRINT\r"
"80 PRINT \" THIS IS A GAME CALLED '23 MATCHES'.\"\r"
"90 PRINT\r"
"100 PRINT \"WHEN IT IS YOUR TURN, YOU MAY TAKE ONE, TWO, OR THREE\"\r"
"110 PRINT \"MATCHES. THE OBJECT OF THE GAME IS NOT TO HAVE TO TAKE\"\r"
"120 PRINT \"THE LAST MATCH.\"\r"
"130 PRINT\r"
"140 PRINT \"LET'S FLIP A COIN TO SEE WHO GOES FIRST.\"\r"
"150 PRINT \"IF IT COMES UP HEADS, I WILL WIN THE TOSS.\"\r"
"155 PRINT\r"
"160 REM\r"
"165 N = 23\r"
"170 Q = INT(2*RND(5))\r"
"180 IF Q = 1 THEN 210\r"
"190 PRINT \"TAILS! YOU GO FIRST. \"\r"
"195 PRINT\r"
"200 GOTO 300\r"
"210 PRINT \"HEADS! I WIN! HA! HA!\"\r"
"220 PRINT \"PREPARE TO LOSE, MEATBALL-NOSE!!\"\r"
"230 PRINT\r"
"250 PRINT \"I TAKE 2 MATCHES\"\r"
"260 N = N -2\r"
"270 PRINT \"THE NUMBER OF MATCHES IS NOW\" N\r"
"280 PRINT\r"
"290 PRINT \"YOUR TURN -- YOU MAY TAKE 1, 2 OR 3 MATCHES.\"\r"
"300 PRINT \"HOW MANY DO YOU WISH TO REMOVE\",\r"
"310 INPUT K\r"
"320 IF K > 3 THEN 430\r"
"330 IF K <= 0 THEN 430\r"
"340 N = N - K\r"
"350 PRINT \"THERE ARE NOW\";N;\"MATCHES REMAINING.\"\r"
"351 IF N = 4 THEN 381\r"
"352 IF N = 3 THEN 383\r"
"353 IF N = 2 THEN 385\r"
"360 IF N <= 1 THEN 530\r"
"370 Z = 4 - K\r"
"372 GOTO 390\r"
"380 PRINT\r"
"381 Z = 3\r"
"382 GOTO 390\r"
"383 Z = 2\r"
"384 GOTO 390\r"
"385 Z = 1\r"
"390 PRINT \"MY TURN ! I REMOVE\" Z \"MATCHES\"\r"
"400 N = N - Z\r"
"410 IF N <= 1 THEN 470\r"
"420 GOTO 270\r"
"430 PRINT \"VERY FUNNY! DUMMY!\"\r"
"440 PRINT \"DO YOU WANT TO PLAY OR GOOF AROUND?\"\r"
"450 PRINT \"NOW, HOW MANY MATCHES DO YOU WANT\",\r"
"460 GOTO 310\r"
"470 PRINT\r"
"480 PRINT\"YOU POOR BOOB! YOU TOOK THE LAST MATCH! I GOTCHA!!\"\r"
"490 PRINT \"HA ! HA ! I BEAT YOU !!!\"\r"
"500 PRINT\r"
"510 PRINT \"GOOD BYE LOSER!\"\r"
"520 GOTO 560\r"
"530 PRINT \"YOU WON, FLOPPY EARS !\"\r"
"540 PRINT \"THINK YOU'RE PRETTY SMART !\"\r"
"550 PRINT \"LETS PLAY AGAIN AND I'LL BLOW YOUR SHOES OFF !!\"\r"
"560 STOP\r"
"570 END\r"
"";
const char basic_amazing[] =
"10 PRINT TAB(28);\"AMAZING PROGRAM\"\r"
"20 PRINT TAB(15);\"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\"\r"
"30 PRINT:PRINT:PRINT:PRINT\r"
"100 INPUT \"WHAT ARE YOUR WIDTH AND LENGTH\";H,V\r"
"102 IF H<>1 AND V<>1 THEN 110\r"
"104 PRINT \"MEANINGLESS DIMENSIONS. TRY AGAIN.\":GOTO 100\r"
"110 DIM W(H,V),V(H,V)\r"
"120 PRINT\r"
"130 PRINT\r"
"140 PRINT\r"
"150 PRINT\r"
"160 Q=0:Z=0:X=INT(RND(1)*H+1)\r"
"165 FOR I=1 TO H\r"
"170 IF I=X THEN 173\r"
"171 PRINT \".--\";:GOTO 180\r"
"173 PRINT \". \";\r"
"180 NEXT I\r"
"190 PRINT \".\"\r"
"195 C=1:W(X,1)=C:C=C+1\r"
"200 R=X:S=1:GOTO 260\r"
"210 IF R<>H THEN 240\r"
"215 IF S<>V THEN 230\r"
"220 R=1:S=1:GOTO 250\r"
"230 R=1:S=S+1:GOTO 250\r"
"240 R=R+1\r"
"250 IF W(R,S)=0 THEN 210\r"
"260 IF R-1=0 THEN 530\r"
"265 IF W(R-1,S)<>0 THEN 530\r"
"270 IF S-1=0 THEN 390\r"
"280 IF W(R,S-1)<>0 THEN 390\r"
"290 IF R=H THEN 330\r"
"300 IF W(R+1,S)<>0 THEN 330\r"
"310 X=INT(RND(1)*3+1)\r"
"320 ON X GOTO 790,820,860\r"
"330 IF S<>V THEN 340\r"
"334 IF Z=1 THEN 370\r"
"338 Q=1:GOTO 350\r"
"340 IF W(R,S+1)<>0 THEN 370\r"
"350 X=INT(RND(1)*3+1)\r"
"360 ON X GOTO 790,820,910\r"
"370 X=INT(RND(1)*2+1)\r"
"380 ON X GOTO 790,820\r"
"390 IF R=H THEN 470\r"
"400 IF W(R+1,S)<>0 THEN 470\r"
"405 IF S<>V THEN 420\r"
"410 IF Z=1 THEN 450\r"
"415 Q=1:GOTO 430\r"
"420 IF W(R,S+1)<>0 THEN 450\r"
"430 X=INT(RND(1)*3+1)\r"
"440 ON X GOTO 790,860,910\r"
"450 X=INT(RND(1)*2+1)\r"
"460 ON X GOTO 790,860\r"
"470 IF S<>V THEN 490\r"
"480 IF Z=1 THEN 520\r"
"485 Q=1:GOTO 500\r"
"490 IF W(R,S+1)<>0 THEN 520\r"
"500 X=INT(RND(1)*2+1)\r"
"510 ON X GOTO 790,910\r"
"520 GOTO 790\r"
"530 IF S-1=0 THEN 670\r"
"540 IF W(R,S-1)<>0 THEN 670\r"
"545 IF R=H THEN 610\r"
"547 IF W(R+1,S)<>0 THEN 610\r"
"550 IF S<>V THEN 560\r"
"552 IF Z=1 THEN 590\r"
"554 Q=1:GOTO 570\r"
"560 IF W(R,S+1)<>0 THEN 590\r"
"570 X=INT(RND(1)*3+1)\r"
"580 ON X GOTO 820,860,910\r"
"590 X=INT(RND(1)*2+1)\r"
"600 ON X GOTO 820,860\r"
"610 IF S<>V THEN 630\r"
"620 IF Z=1 THEN 660\r"
"625 Q=1:GOTO 640\r"
"630 IF W(R,S+1)<>0 THEN 660\r"
"640 X=INT(RND(1)*2+1)\r"
"650 ON X GOTO 820,910\r"
"660 GOTO 820\r"
"670 IF R=H THEN 740\r"
"680 IF W(R+1,S)<>0 THEN 740\r"
"685 IF S<>V THEN 700\r"
"690 IF Z=1 THEN 730\r"
"695 Q=1:GOTO 830\r"
"700 IF W(R,S+1)<>0 THEN 730\r"
"710 X=INT(RND(1)*2+1)\r"
"720 ON X GOTO 860,910\r"
"730 GOTO 860\r"
"740 IF S<>V THEN 760\r"
"750 IF Z=1 THEN 780\r"
"755 Q=1:GOTO 770\r"
"760 IF W(R,S+1)<>0 THEN 780\r"
"770 GOTO 910\r"
"780 GOTO 1000\r"
"790 W(R-1,S)=C\r"
"800 C=C+1:V(R-1,S)=2:R=R-1\r"
"810 IF C=H*V+1 THEN 1010\r"
"815 Q=0:GOTO 260\r"
"820 W(R,S-1)=C\r"
"830 C=C+1\r"
"840 V(R,S-1)=1:S=S-1:IF C=H*V+1 THEN 1010\r"
"850 Q=0:GOTO 260\r"
"860 W(R+1,S)=C\r"
"870 C=C+1:IF V(R,S)=0 THEN 880\r"
"875 V(R,S)=3:GOTO 890\r"
"880 V(R,S)=2\r"
"890 R=R+1\r"
"900 IF C=H*V+1 THEN 1010\r"
"905 GOTO 530\r"
"910 IF Q=1 THEN 960\r"
"920 W(R,S+1)=C:C=C+1:IF V(R,S)=0 THEN 940\r"
"930 V(R,S)=3:GOTO 950\r"
"940 V(R,S)=1\r"
"950 S=S+1:IF C=H*V+1 THEN 1010\r"
"955 GOTO 260\r"
"960 Z=1\r"
"970 IF V(R,S)=0 THEN 980\r"
"975 V(R,S)=3:Q=0:GOTO 1000\r"
"980 V(R,S)=1:Q=0:R=1:S=1:GOTO 250\r"
"1000 GOTO 210\r"
"1010 FOR J=1 TO V\r"
"1011 PRINT \"I\";\r"
"1012 FOR I=1 TO H\r"
"1013 IF V(I,J)<2 THEN 1030\r"
"1020 PRINT \" \";\r"
"1021 GOTO 1040\r"
"1030 PRINT \" I\";\r"
"1040 NEXT I\r"
"1041 PRINT\r"
"1043 FOR I=1 TO H\r"
"1045 IF V(I,J)=0 THEN 1060\r"
"1050 IF V(I,J)=2 THEN 1060\r"
"1051 PRINT \": \";\r"
"1052 GOTO 1070\r"
"1060 PRINT \":--\";\r"
"1070 NEXT I\r"
"1071 PRINT \".\"\r"
"1072 NEXT J\r"
"1073 END\r"
"";
const char basic_baccarat[] =
"100 REM (SOURCE UNKNOWN) EDITED SLIGHTLY BY D. KURLAND 11/6/75\r"
"110 PRINT \"WELCOME TO CASINO UNIVAC 1108\" \r"
"120 PRINT \"THE GAME IS BACCARAT\" \r"
"130 H=0 \r"
"140 GOSUB 1400\r"
"150 DIM A(10),C(10) \r"
"160 PRINT \"ARE YOU READY\"; \r"
"170 INPUT X$ \r"
"180 IF X$=\"NO\" OR X$=\"N\" THEN 1390\r"
"190 PRINT \"WAGER\"; \r"
"200 D=0 \r"
"210 E=0 \r"
"220 INPUT G \r"
"230 IF G>100000! THEN 1370 \r"
"240 IF G>0 THEN 270 \r"
"250 PRINT \"HA!HA!, VERY FUNNY!!\" \r"
"260 GOTO 190 \r"
"270 B=1 \r"
"280 GOTO 740\r"
"290 A(B)=INT(RND(1)*52)+1\r"
"300 C(B)=A(B)-13*INT(A(B)/13) \r"
"310 IF C(B)=0 THEN 600 \r"
"320 ON C(B)GOTO330,350,370,390,410,430,450,470,490,510,540,570 \r"
"330 PRINT \"ACE \"; \r"
"340 GOTO 620 \r"
"350 PRINT \"DEUCE \";\r"
"360 GOTO 620 \r"
"370 PRINT \"THREE \";\r"
"380 GOTO 620 \r"
"390 PRINT \"FOUR \"; \r"
"400 GOTO 620 \r"
"410 PRINT \"FIVE \"; \r"
"420 GOTO 620 \r"
"430 PRINT \"SIX \"; \r"
"440 GOTO 620 \r"
"450 PRINT \"SEVEN \";\r"
"460 GOTO 620 \r"
"470 PRINT \"EIGHT \";\r"
"480 GOTO 620 \r"
"490 PRINT \"NINE \"; \r"
"500 GOTO 620 \r"
"510 PRINT \"TEN \"; \r"
"520 C(B)=0 \r"
"530 GOTO 620 \r"
"540 PRINT \"JACK \"; \r"
"550 C(B)=0 \r"
"560 GOTO 620 \r"
"570 PRINT \"QUEEN \";\r"
"580 C(B)=0 \r"
"590 GOTO 620 \r"
"600 PRINT \"KING \"; \r"
"610 C(B)=0 \r"
"620 IF INT(A(B)/13)<>A(B)/13 THEN 640 \r"
"630 ON A(B)/13 GOTO 660,680,700,720 \r"
"640 IF INT(A(B)/13)=0 THEN 660 \r"
"650 ON INT(A(B)/13)GOTO 680,700,720 \r"
"660 PRINT \"OF CLUBS\"\r"
"670 RETURN \r"
"680 PRINT \"OF DIAMONDS\" \r"
"690 RETURN \r"
"700 PRINT \"OF SPADES\" \r"
"710 RETURN \r"
"720 PRINT \"OF HEARTS\" \r"
"730 RETURN \r"
"740 PRINT \"YOUR FIRST CARD IS A \"; \r"
"750 GOSUB 290\r"
"760 GOSUB 1310 \r"
"770 PRINT \"YOUR NEXT CARD IS A \"; \r"
"780 GOSUB 290\r"
"790 GOSUB 1310 \r"
"800 PRINT \"DO YOU WANT A CARD\"; \r"
"810 INPUT J$\r"
"820 IF J$=\"YES\" OR J$=\"Y\" THEN 870 \r"
"830 C(3)=0 \r"
"840 D=D+C(B)\r"
"850 B=B+1 \r"
"860 GOTO 900 \r"
"870 PRINT \"THE CARD IS A \"; \r"
"880 GOSUB290 \r"
"890 GOSUB 1310 \r"
"900 PRINT \"MY FIRST CARD IS A \";\r"
"910 GOSUB 290\r"
"920 GOSUB 1340 \r"
"930 PRINT \"MY NEXT CARD IS A \"; \r"
"940 GOSUB 290\r"
"950 GOSUB 1340 \r"
"960 IF E<10 THEN 990\r"
"970 E=E-10 \r"
"980 GOTO 960 \r"
"990 IF E<6 THEN 1030 \r"
"1000 PRINT \"I DO NOT WANT A CARD\"\r"
"1010 C(6)=0 \r"
"1020 GOTO 1060 \r"
"1030 PRINT \"I TAKE CARD\" \r"
"1040 PRINT \"THE CARD IS A \"; \r"
"1050 GOSUB 290\r"
"1060 E=E+C(6)\r"
"1070 IF D<10 THEN 1100\r"
"1080 D=D-10 \r"
"1090 GOTO 1070 \r"
"1100 PRINT \"YOUR TOTAL IS\";D \r"
"1110 IF E<10 THEN 1140\r"
"1120 E=E-10 \r"
"1130 GOTO 1110 \r"
"1140 PRINT \"MY TOTAL IS \";E \r"
"1150 IF D=E THEN 1590\r"
"1160 IF D>E THEN 1200 \r"
"1170 PRINT \"I WIN $\"G \r"
"1180 G=-G\r"
"1190 GOTO 1210 \r"
"1200 PRINT \"YOU WIN $\";G \r"
"1210 H=H+G \r"
"1220 IF H>0 THEN 1290 \r"
"1230 IF H=0 THEN 1610\r"
"1240 PRINT \"YOU OWE ME $\";-H\r"
"1250 PRINT \"DO YOU WANT TO TRY AGAIN\"; \r"
"1260 INPUT K$\r"
"1270 IF K$=\"NO\" OR K$=\"N\" THEN 1390 \r"
"1280 GOTO 190\r"
"1290 PRINT \"I.O.U. $\";H \r"
"1300 GOTO 1250 \r"
"1310 D=D+C(B)\r"
"1320 B=B+1 \r"
"1330 RETURN \r"
"1340 E=E+C(B)\r"
"1350 B=B+1 \r"
"1360 RETURN \r"
"1370 PRINT \"HOUSE LIMIT IS $100000\" \r"
"1380 GOTO190 \r"
"1390 STOP\r"
"1400 PRINT \"DO YOU WANT THE RULES OF THE GAME\"; \r"
"1410 INPUT I$ \r"
"1420 IF I$=\"NO\" OR I$=\"N\" THEN RETURN \r"
"1430 PRINT \"* OFFICIAL RULES FOR THE GAME OF BACCARAT *\"\r"
"1440 PRINT \"THE COMPUTER IS SHUFFLING SIX DECKS OF CARDS\" \r"
"1450 PRINT \"TOGETHER. THE RULES ARE AS FOLLOWS: THE OBJECT\" \r"
"1460 PRINT \"IS TO BE AS CLOSE TO POSSIBLE TO NINE IN TWO\" \r"
"1470 PRINT \"OR THREE CARDS, FACE CARDS AND TENS COUNT ZERO\" \r"
"1480 PRINT \"ACES COUNT AS ONE EACH,ALL OTHER CARDS COUNT\" \r"
"1490 PRINT \"THEIR INDEX VALUE. WHEN THE TOTAL IS OVER TEN\" \r"
"1500 PRINT \"THE TENS UNIT IS DROPPED. EXAMPLE: A SEVEN AND\"\r"
"1510 PRINT \"A SIX TOTALING THIRTEEN COUNT AS THREE. THE\" \r"
"1520 PRINT \"PLAYER WITH THE HIGHER TOTAL WINS. IN CASE OF\" \r"
"1530 PRINT \"A TIE THE COMPUTER WINS. \" \r"
"1540 PRINT \"DO YOU UNDERSTAND THE RULES\"; \r"
"1550 INPUT O$ \r"
"1560 IF O$=\"YES\" OR O$=\"Y\" THEN RETURN \r"
"1570 PRINT \"TOUGH LUCK\" \r"
"1580 RETURN \r"
"1590 PRINT \"IT IS A TIE. THE COMPUTER WINS!\"\r"
"1600 GOTO 1170 \r"
"1610 PRINT \"YOU ARE EVEN-UP !!\" \r"
"1620 GOTO1250\r"
"1630 END\r"
"";
const char basic_baseball[] =
"100 REM BASEBALL SIMULATION PROGRAM\r"
"110 REM WRITTEN BY JOEL LIND & KEN BIRKMAN - NYU - JULY 1973\r"
"120 REM STOLEN AND ENHANCED DECEMBER 1973 BY R. D. KURLAND - NYU\r"
"130 DIM B(7),P$(9),W$(7),J$(8),K$(4)\r"
"140 FOR I=1 TO 7: B(I)=0:NEXT\r"
"150 B=0:T9=0:R9=0:S=0:O=0:B1=0:B2=0:T=0\r"
"160 Z1=1:Z2=1\r"
"170 PRINT \"WELCOME TO EBBETT'S FIELD\"\r"
"180 PRINT \"WHAT DO YOU WANT TO CALL YOUR TEAM\";\r"
"190 INPUT A$\r"
"200 FOR I=1 TO 7:READ W$(I):NEXT\r"
"210 FOR I=1 TO 9:READ P$(I):NEXT\r"
"220 FOR I=1 TO 4:READ K$(I):NEXT\r"
"230 FOR I=1 TO 8:READ J$(I):NEXT\r"
"240 PRINT \"FINE. THE \";A$;\" NEED A MANAGER. WHAT'S YOUR NAME\";\r"
"250 INPUT B$\r"
"260 PRINT \"WHAT DO YOU WANT TO CALL MY TEAM, \";B$;\r"
"270 INPUT C$\r"
"280 PRINT\r"
"290 PRINT \"OPENING DAY, THE \";A$;\" VERSUS THE \";C$\r"
"300 PRINT\r"
"310 PRINT \"LET'S FLIP A COIN. THE WINNER IS THE HOME TEAM.\"\r"
"320 PRINT \"HEADS OR TAILS\";\r"
"330 INPUT D$\r"
"340 IF D$<>\"HEADS\" AND D$<>\"TAILS\" THEN 320\r"
"350 FOR I=1 TO TYM\r"
"360 Y=RND(1)\r"
"370 NEXT I\r"
"380 H=1\r"
"390 Y=RND(1)\r"
"400 Y$=\"HEADS\"\r"
"410 IF Y>.5 THEN Y$=\"TAILS\"\r"
"420 IF D$=Y$ THEN 490\r"
"430 H=0\r"
"440 PRINT \"YOU LOST THE TOSS. THE \";A$;\" ARE UP FIRST.\"\r"
"450 PRINT\r"
"460 PRINT\r"
"470 A=0\r"
"480 GOTO 610\r"
"490 PRINT \"YOU WIN THE TOSS. \";A$;\" TAKE THE FIELD, AND \";\r"
"500 PRINT C$;\" ARE AT BAT.\"\r"
"510 A=1\r"
"520 R9=0\r"
"530 T=T+1\r"
"540 IF T<3 THEN GOSUB 5140\r"
"550 IF T<18 THEN 710\r"
"560 IF T>18 THEN 590\r"
"570 GOSUB 3500\r"
"580 GOTO 710\r"
"590 GOSUB 3290\r"
"600 GOTO 710\r"
"610 REM START AN INNING - WE ARE OUT ON THE FIELD\r"
"620 T=T+1\r"
"630 R9=0\r"
"640 IF T<18 THEN 690\r"
"650 IF T>18 THEN 680\r"
"660 GOSUB 3500\r"
"670 GOTO 690\r"
"680 GOSUB 3290\r"
"690 IF T>2 THEN 710\r"
"700 GOSUB 5070\r"
"710 S=0:B=0\r"
"720 PRINT\r"
"730 IF O=0 THEN PRINT \"NO OUTS\"\r"
"740 IF O=1 THEN PRINT \"THERE IS 1 OUT\"\r"
"750 IF O>1 THEN PRINT \"THERE ARE\";O;\"OUTS\"\r"
"760 P=B(1)+B(2)+B(3)\r"
"770 IF P<>3 THEN 800\r"
"780 PRINT \"BASES LOADED\"\r"
"790 GOTO 900\r"
"800 IF P=0 THEN 900\r"
"810 Y$=\"RUNNER ON \"\r"
"820 IF P>1 THEN Y$=\"RUNNERS ON \"\r"
"830 PRINT Y$;\r"
"840 IF B(1)=0 THEN 870\r"
"850 PRINT \"FIRST\";\r"
"860 IF P>1 THEN PRINT \" AND \";\r"
"870 IF B(2)=1 THEN PRINT \"SECOND\";\r"
"880 IF P>1 AND B(1)=0 THEN PRINT \" AND \";\r"
"890 IF B(3)=1 THEN PRINT \"THIRD\" ELSE PRINT \" \"\r"
"900 IF A=0 THEN 920\r"
"910 GOTO 3030\r"
"920 PRINT \"BATTER UP\"\r"
"930 IF B<>3 OR S<>2 THEN 960\r"
"940 PRINT \"FULL COUNT\"\r"
"950 GOTO 970\r"
"960 IF B>0 OR S>0 THEN PRINT \"THE COUNT IS\";B;\"AND\";S\r"
"970 PRINT\r"
"980 IF A=1 THEN 3030\r"
"990 PRINT \"WHAT WILL YOUR BATTER DO, \";B$;\r"
"1000 INPUT C\r"
"1010 IF C>0 AND C<5 THEN 1050\r"
"1020 PRINT \"HUH? \";\r"
"1030 GOSUB 5070\r"
"1040 GOTO 990\r"
"1050 Y2=RND(1)\r"
"1060 IF Y2<.56 OR Y2>.5625 THEN 1120\r"
"1070 PRINT \"WILD PITCH!\"\r"
"1080 N=1\r"
"1090 GOSUB 3540\r"
"1100 B(1)=0\r"
"1110 GOTO 1210\r"
"1120 IF Y2>.772 AND Y2<.775 THEN 4880\r"
"1130 ON C GOTO 1140,1450,2600,4450,5500\r"
"1140 C=1\r"
"1150 GOSUB 5240\r"
"1160 IF A=0 THEN Z1=Z1+1\r"
"1170 Y=RND(1)\r"
"1180 IF B<>3 OR S<>0 THEN 1200\r"
"1190 IF Y<.7 THEN 1310 ELSE 1210\r"
"1200 IF Y<.5 THEN 1310\r"
"1210 B=B+1\r"
"1220 Y=INT(RND(1)*8+1)\r"
"1230 IF Y=9 THEN 1220\r"
"1240 PRINT J$(Y);\" - BALL\";B\r"
"1250 IF B<>4 THEN 930\r"
"1260 PRINT \"WALK\"\r"
"1270 GOSUB 4950\r"
"1280 Y=RND(1)\r"
"1290 GOTO 710\r"
"1300 PRINT \"HIGH POP - FOUL DOWN THE \";Y$;\" FIELD LINE\"\r"
"1310 S=S+1\r"
"1320 IF C=2 OR C=5 THEN 1370\r"
"1330 Y=INT(RND(1)*4+1)\r"
"1340 IF Y=5 THEN 1330\r"
"1350 PRINT K$(Y);\", CALLED STRIKE\";S\r"
"1360 GOTO 1380\r"
"1370 PRINT \"SWINGING STRIKE\";S\r"
"1380 IF C=5 AND S<>3 THEN 4450\r"
"1390 IF S<>3 THEN 930\r"
"1400 PRINT \"STRUCK OUT\"\r"
"1410 O=O+1\r"
"1420 IF O=3 THEN 2850\r"
"1430 IF C=5 THEN 4450\r"
"1440 GOTO 710\r"
"1450 C=2\r"
"1460 Y=INT(RND(1)*10+1)\r"
"1470 IF Y=10 THEN 1450\r"
"1480 IF A=0 THEN Z2=Z2+1\r"
"1490 IF C<>5 THEN GOSUB 5240\r"
"1500 IF S<>2 AND Z2/Z1>7 AND A=0 THEN 1520\r"
"1510 IF S<>2 OR Z2/Z1<25 THEN 1590\r"
"1520 Y=INT(RND(1)*20+1)\r"
"1530 IF Y>7 THEN 1550\r"
"1540 ON Y GOTO 1610,1310,1310,1310,1310,1680,1610\r"
"1550 IF Y>13 THEN 1570\r"
"1560 ON Y-7 GOTO 1680,1310,1740,1850,1740,1850\r"
"1570 IF Y>18 THEN 1600\r"
"1580 ON Y-13 GOTO 1980,1980,2040,2570,1640,2570\r"
"1590 IF Y<3 THEN 1310\r"
"1600 ON Y-2 GOTO 1610,1680,1740,1850,1980,2040,2570\r"
"1610 PRINT \"FOULED INTO THE STANDS-OUT OF PLAY\"\r"
"1620 IF S<>2 THEN S=S+1\r"
"1630 GOTO 930\r"
"1640 Y=RND(1)\r"
"1650 Y$=\"RIGHT\"\r"
"1660 IF Y<.5 THEN Y$=\"LEFT\"\r"
"1670 GOTO 1620\r"
"1680 Y=INT(RND(1)*20+1)\r"
"1690 IF Y>18 THEN 1720\r"
"1700 PRINT \"FOULED BACK INTO THE STANDS\"\r"
"1710 GOTO 1620\r"
"1720 PRINT \"POPPED IT UP - CAUGHT BY CATCHER\"\r"
"1730 GOTO 1410\r"
"1740 PRINT \"INFIELD GROUNDER\"\r"
"1750 E2=RND(1)\r"
"1760 IF E2<.37 OR E2>.41 THEN 1820\r"
"1770 PRINT \"1 BASE ERROR!!\"\r"
"1780 N=1\r"
"1790 C=4\r"
"1800 GOSUB 3540\r"
"1810 GOTO 710\r"
"1820 GOSUB 4100\r"
"1830 IF O=3 THEN 2850\r"
"1840 GOTO 710\r"
"1850 PRINT \"GROUNDER - COULD BE TROUBLE\"\r"
"1860 Y=RND(1)\r"
"1870 IF Y>.75 THEN 1950\r"
"1880 Y$=\"UP THE MIDDLE\"\r"
"1890 IF Y<.5 THEN Y$=\"THROUGH THE HOLE INTO RIGHT FIELD\"\r"
"1900 IF Y<.25 THEN Y$=\"THROUGH THE HOLE INTO LEFT FIELD\"\r"
"1910 PRINT \"A SINGLE \";Y$;\"!\"\r"
"1920 N=1\r"
"1930 GOSUB 3540\r"
"1940 GOTO 710\r"
"1950 PRINT \"INFIELDER UP WITH IT!\"\r"
"1960 GOSUB 4800\r"
"1970 IF O=3 THEN 2850 ELSE 710\r"
"1980 Y=RND(1)\r"
"1990 Y$=\"LEFT\"\r"
"2000 IF Y<.6 THEN Y$=\"CENTER\"\r"
"2010 IF Y<.3 THEN Y$=\"RIGHT\"\r"
"2020 PRINT \"FLY-OUT TO \";Y$;\" FIELD\"\r"
"2030 GOTO 1410\r"
"2040 Z=RND(1)\r"
"2050 Y$=\"CENTER\"\r"
"2060 IF Z<.6 THEN Y$=\"RIGHT\"\r"
"2070 IF Z<.3 THEN Y$=\"LEFT\"\r"
"2080 PRINT \"LONG FLY TO DEEP \";Y$;\" FIELD - LOOKS GOOD!\"\r"
"2090 Z=RND(1)\r"
"2100 IF Z<.9 THEN 2130\r"
"2110 PRINT Y$;\"FIELDER CAUGHT IT AT THE WALL!\"\r"
"2120 GOTO 2180\r"
"2130 IF Z<.8 THEN 2160\r"
"2140 PRINT \"A DIVING CATCH!\"\r"
"2150 GOTO 2180\r"
"2160 IF Z<.7 THEN 2290\r"
"2170 PRINT Y$;\"FIELDER CAUGHT IT ON THE WARNING TRACK!\"\r"
"2180 O=O+1\r"
"2190 IF O=3 THEN 2850\r"
"2200 FOR I=3 TO 1 STEP -1\r"
"2210 IF B(I)=1 THEN 2240\r"
"2220 NEXT I\r"
"2230 GOTO 710\r"
"2240 B(I+1)=B(I)\r"
"2250 B(I)=0\r"
"2260 PRINT \"LEAD RUNNER TAGS UP - AND ADVANCES 1 BASE!\"\r"
"2270 GOSUB 3830\r"
"2280 GOTO 710\r"
"2290 IF Z<.5 THEN 2360\r"
"2300 PRINT \"BATTER HOLDS WITH A SINGLE.\"\r"
"2310 N=2\r"
"2320 GOSUB 3540\r"
"2330 B(2)=0\r"
"2340 B(1)=1\r"
"2350 GOTO 710\r"
"2360 IF Z<.15 THEN 2480\r"
"2370 PRINT \"DOUBLE!\"\r"
"2380 Y=RND(1)\r"
"2390 IF Y>.5 THEN 2430\r"
"2400 N=2\r"
"2410 GOSUB 3540\r"
"2420 GOTO 710\r"
"2430 N=3\r"
"2440 GOSUB 3540\r"
"2450 B(3)=0\r"
"2460 B(2)=1\r"
"2470 GOTO 710\r"
"2480 IF Z<.1 THEN 2530\r"
"2490 PRINT \"TRIPLE!\"\r"
"2500 N=3\r"
"2510 GOSUB 3540\r"
"2520 GOTO 710\r"
"2530 PRINT \"IT'S OVER THE WALL -- A H*O*M*E R*U*N!!!\"\r"
"2540 N=4\r"
"2550 GOSUB 3540\r"
"2560 GOTO 710\r"
"2570 Y=INT(RND(1)*7+1)\r"
"2580 PRINT \"LINED OUT TO \";P$(Y)\r"
"2590 GOTO 1410\r"
"2600 GOSUB 5240\r"
"2610 PRINT \"BATTER BUNTS...\"\r"
"2620 Y=RND(1)\r"
"2630 IF Y<.6 THEN 2750\r"
"2640 IF B(3)=0 THEN 2660\r"
"2650 IF Y<.8 THEN 2830\r"
"2660 PRINT \"THROWN OUT AT FIRST.\"\r"
"2670 O=O+1\r"
"2680 IF O=3 THEN 2850\r"
"2690 IF B(1)+B(2)+B(3)=0 THEN 710\r"
"2700 PRINT \"SACRIFICE - \";\r"
"2710 N=1\r"
"2720 GOSUB 3540\r"
"2730 B(1)=0\r"
"2740 GOTO 710\r"
"2750 IF Y<.2 THEN 2830\r"
"2760 IF Y<.4 THEN 2790\r"
"2770 PRINT \"BATTER MISSES PITCH\"\r"
"2780 GOTO 1310\r"
"2790 PRINT \"BEATS IT OUT! SINGLE!\"\r"
"2800 N=1\r"
"2810 GOSUB 3540\r"
"2820 GOTO 710\r"
"2830 GOSUB 4100\r"
"2840 IF O<>3 THEN 710\r"
"2850 PRINT \"3 OUTS. THE SIDE IS RETIRED\";\r"
"2860 I=B(1)+B(2)+B(3)\r"
"2870 IF I=0 THEN PRINT \".\"\r"
"2880 IF I=1 THEN PRINT \", LEAVING 1 MAN ON BASE\"\r"
"2890 IF I>1 THEN PRINT \", LEAVING\";I;\"MEN ON BASE\"\r"
"2900 PRINT\r"
"2910 PRINT\r"
"2920 PRINT \"*************\"\r"
"2930 D=T/2-INT(T/2)\r"
"2940 PRINT \"AFTER\";\r"
"2950 IF T>1 THEN PRINT INT(T/2);\r"
"2960 IF D>.3 THEN PRINT \" 1/2 \";\r"
"2970 Y$=\"INNINGS\"\r"
"2980 IF T<3 THEN Y$=\"INNING\"\r"
"2990 PRINT Y$;\" OF PLAY, THE SCORE IS\"\r"
"3000 GOSUB 3960\r"
"3010 O=0:B(1)=0:B(2)=0:B(3)=0\r"
"3020 IF A=0 THEN 510 ELSE 470\r"
"3030 REM MY TEAM IS AT BAT\r"
"3040 Y=RND(1)\r"
"3050 IF B(1)+B(2)+B(3)=0 THEN 3140\r"
"3060 REM IF O=2 AND S=2 AND B=3 THEN 4850\r"
"3070 IF B(3)=1 THEN 3110\r"
"3080 IF B(2)=0 THEN 3100\r"
"3090 IF .45<Y AND .46>Y THEN 4450\r"
"3100 IF .45<Y AND .47>Y THEN 4450\r"
"3110 IF O=2 THEN 3140\r"
"3120 IF O<2 AND Y<.333 AND B(3)=1 THEN 2600\r"
"3130 IF .45<Y AND .55>Y THEN 2600\r"
"3140 IF S=0 THEN 3240\r"
"3150 IF B<>3 THEN 3180\r"
"3160 IF Y<.6 THEN 1450\r"
"3170 GOTO 1140\r"
"3180 IF Y>.3 THEN 1450\r"
"3190 IF S<>2 THEN 1140\r"
"3200 IF B=0 AND Y<.1 THEN 1140\r"
"3210 IF B=0 THEN 1450\r"
"3220 IF Y<.2 THEN 1140\r"
"3230 GOTO 1450\r"
"3240 IF B=3 THEN 3270\r"
"3250 IF Y<.6 THEN 1140\r"
"3260 GOTO 1450\r"
"3270 IF Y<.9 THEN 1140\r"
"3280 GOTO 1450\r"
"3290 IF T<>19 THEN 3330\r"
"3300 IF R1<>R2 THEN 3340\r"
"3310 PRINT\r"
"3320 PRINT \"*** GOING INTO EXTRA INNINGS ***\"\r"
"3330 IF R1=R2 THEN RETURN\r"
"3340 IF (T-1)/2<>INT(T-1)/2 THEN RETURN\r"
"3350 PRINT \"THE BALLGAME IS OVER.\"\r"
"3360 PRINT \"*************\"\r"
"3370 PRINT \"FINAL SCORE:\"\r"
"3380 T9=1\r"
"3390 GOSUB 3960\r"
"3400 IF R1>R2 THEN 3470\r"
"3410 PRINT \"NICE TRY, \";B$\r"
"3420 PRINT \"YOU SHOULD KNOW BETTER THAN TO TRY TO\"\r"
"3430 PRINT \"OUT-MANAGE A COMPUTER. MAYBE BASEBALL\"\r"
"3440 PRINT \"JUST ISN'T YOUR SPORT...WHY DON'T YOU TRY GOLF?\"\r"
"3450 REM CHAIN GOLF\r"
"3460 STOP\r"
"3470 PRINT \"CONGRATULATIONS, \";B$\r"
"3480 PRINT \"YOU'VE BEATEN ME, BUT I WILL HAVE MY REVENGE.\"\r"
"3490 STOP\r"
"3500 REM 9TH INNING\r"
"3510 IF A=0 THEN 3530\r"
"3520 IF R2>R1 THEN 3350 ELSE RETURN\r"
"3530 IF R1>R2 THEN 3350 ELSE RETURN\r"
"3540 REM ADVANCE N BASES (SET N BEFORE GOSUB)\r"
"3550 N2=B(1)+B(2)+B(3)\r"
"3560 IF C=5 THEN N=N+1\r"
"3570 N3=N\r"
"3580 IF N2=0 THEN 3650\r"
"3590 REM FIND LAST RUNNER: MAKE SURE HE ISN\"T TRYING TO ADVANCE\r"
"3600 REM PAST HOME PLATE.\r"
"3610 FOR I=1 TO 3\r"
"3620 IF B(I)=1 THEN 3640\r"
"3630 NEXT I\r"
"3640 IF 4-I<N THEN N3=4-I\r"
"3650 FOR I=3+N TO N+1 STEP -1\r"
"3660 B(I)=B(I-N)\r"
"3670 NEXT I\r"
"3680 B(N)=1\r"
"3690 IF N=1 THEN 3740\r"
"3700 FOR P=1 TO 3\r"
"3710 IF (N-P)>1 THEN B(N-P)=0\r"
"3720 IF (N-P)<=1 THEN B(1)=0\r"
"3730 NEXT P\r"
"3740 FOR P=1 TO 7\r"
"3750 IF P=N THEN 3780\r"
"3760 NEXT P\r"
"3770 GOTO 3830\r"
"3780 IF C=4 OR N2=0 THEN 3830\r"
"3790 Y$=\"RUNNERS ADVANCE\"\r"
"3800 IF N2=1 THEN Y$=\"RUNNER ADVANCES\"\r"
"3810 PRINT Y$;N3;\r"
"3820 IF N3=1 THEN PRINT \"BASE\" ELSE PRINT \"BASES\"\r"
"3830 IF B(4)+B(5)+B(6)+B(7)=0 THEN RETURN\r"
"3840 REM AT LEAST 1 RUN HAS SCORED.\r"
"3850 N2=B(4)+B(5)+B(6)+B(7)\r"
"3860 IF A=0 THEN 3890\r"
"3870 R2=R2+N2\r"
"3880 GOTO 3900\r"
"3890 R1=R1+N2\r"
"3900 B(4)=0:B(5)=0:B(6)=0:B(7)=0\r"
"3910 IF N2=1 THEN PRINT \"** 1 RUN SCORED\"\r"
"3920 IF N2>1 THEN PRINT \"**\";N2;\"RUNS SCORED\"\r"
"3930 PRINT\r"
"3940 PRINT\r"
"3950 PRINT \"********NEW SCORE:\"\r"
"3960 IF H=1 THEN 4000\r"
"3970 IF LEN(A$)>LEN(C$) THEN PRINT A$;TAB(LEN(A$)+3);R1\r"
"3980 IF LEN(A$)<=LEN(C$) THEN PRINT A$;TAB(LEN(C$)+3);R1\r"
"3990 IF H=1 THEN 4030\r"
"4000 IF LEN(A$)>LEN(C$) THEN PRINT C$;TAB(LEN(A$)+3);R2\r"
"4010 IF LEN(A$)<=LEN(C$) THEN PRINT C$;TAB(LEN(C$)+3);R2\r"
"4020 IF H=1 THEN 3970\r"
"4030 PRINT \"*************\"\r"
"4040 PRINT\r"
"4050 PRINT\r"
"4060 IF T9=1 THEN 4090\r"
"4070 IF A=1 AND T>17 AND INT(T/2)=T/2 AND R2>R1 THEN 3350\r"
"4080 IF A=0 AND T>17 AND INT(T/2)=T/2 AND R1>R2 THEN 3350\r"
"4090 RETURN\r"
"4100 REM LEAD RUNNER OUT (FIELDER\"S CHOICE THEN ONE BASE ADVANCE)\r"
"4110 N=1\r"
"4120 I=4\r"
"4130 IF B(4)=0 AND B(3)=1 AND B(2)=1 AND B(1)=1 THEN 4220\r"
"4140 I=3\r"
"4150 IF B(3)=0 AND B(2)=1 AND B(1)=1 THEN 4220\r"
"4160 I=2\r"
"4170 IF B(2)=0 AND B(1)=1 THEN 4220\r"
"4180 REM NO ONE FORCED\r"
"4190 O=O+1\r"
"4200 PRINT \"BATTER THROWN OUT\"\r"
"4210 RETURN\r"
"4220 B(I-1)=0\r"
"4230 F=RND(1)\r"
"4240 IF O=2 OR F>.3 THEN 4290\r"
"4250 O=O+2\r"
"4260 PRINT \"DOUBLE PLAY!\"\r"
"4270 IF O=3 THEN RETURN\r"
"4280 GOTO 4910\r"
"4290 O=O+1\r"
"4300 PRINT \"RUNNER ON BASE\";I-1;\"IS OUT ON FIELDER'S CHOICE\"\r"
"4310 IF O=3 THEN RETURN\r"
"4320 GOSUB 3540\r"
"4330 RETURN\r"
"4340 REM FORCED RUNNERS ADVANCE 1 BASE, OTHERS HOLD\r"
"4350 FOR I=1 TO 3\r"
"4360 IF B(I)=0 THEN 4400\r"
"4370 NEXT I\r"
"4380 N=1\r"
"4390 GOTO 3540\r"
"4400 REM NO ONE ON BASE I\r"
"4410 FOR I2=I TO 1 STEP -1\r"
"4420 B(I2)=1\r"
"4430 NEXT I2\r"
"4440 RETURN\r"
"4450 REM LEAD RUNNER STEALS\r"
"4460 FOR I=3 TO 1 STEP -1\r"
"4470 IF B(I)=1 THEN 4510\r"
"4480 NEXT I\r"
"4490 PRINT \"NO ONE ON BASE, DUMMY!\"\r"
"4500 GOTO 990\r"
"4510 REM I IS LEAD RUNNER\"S BASE\r"
"4520 IF C<>5 THEN GOSUB 5240\r"
"4530 IF RND(1)/I<.3 THEN 4680\r"
"4540 IF B(1)+B(2)+B(3)>1 THEN 4570\r"
"4550 PRINT \"RUNNER STEALS A BASE\"\r"
"4560 GOTO 4580\r"
"4570 PRINT \"RUNNERS STEAL A BASE\"\r"
"4580 N=1\r"
"4590 C2=C\r"
"4600 C=4\r"
"4610 GOSUB 3540\r"
"4620 C=C2\r"
"4630 B(1)=0\r"
"4640 IF C=5 AND S<>3 THEN 930\r"
"4650 IF C=5 THEN 710\r"
"4660 Y=RND(1)\r"
"4670 IF Y>.5 THEN 1210 ELSE 1310\r"
"4680 PRINT \"RUNNER THROWN OUT STEALING\"\r"
"4690 O=O+1\r"
"4700 B(I)=0\r"
"4710 IF O=3 THEN 2850\r"
"4720 N=1\r"
"4730 GOSUB 3540\r"
"4740 B(1)=0\r"
"4750 IF C=5 AND S<>3 THEN 930\r"
"4760 IF C=5 THEN 710\r"
"4770 Y=RND(1)\r"
"4780 IF B=3 THEN 1310\r"
"4790 IF Y>.5 THEN 1210 ELSE 1310\r"
"4800 REM RUNNERS ADVANCE ONE BASE, BATTER THROWN OUT\r"
"4810 N=1\r"
"4820 IF O=2 THEN 4850\r"
"4830 GOSUB 3540\r"
"4840 B(1)=0\r"
"4850 O=O+1\r"
"4860 PRINT \"BATTER THROWN OUT\"\r"
"4870 RETURN\r"
"4880 PRINT \"HIT BATSMAN (OUCH!)\"\r"
"4890 GOSUB 4950\r"
"4900 GOTO 710\r"
"4910 N=1\r"
"4920 GOSUB 3540\r"
"4930 B(1)=0\r"
"4940 RETURN\r"
"4950 REM BATTER WALKED\r"
"4960 FOR I=1 TO 3\r"
"4970 IF B(I)=0 THEN 5010\r"
"4980 NEXT I\r"
"4990 N=1\r"
"5000 GOTO 3540\r"
"5010 IF I=1 THEN 5050\r"
"5020 FOR I0=I TO 2 STEP -1\r"
"5030 B(I0)=B(I0-1)\r"
"5040 NEXT I0\r"
"5050 B(1)=1\r"
"5060 RETURN\r"
"5070 PRINT \"WHEN YOUR'RE UP:\"\r"
"5080 PRINT \"1-BATTER TAKES PITCH\"\r"
"5090 PRINT \"2-BATTER SWINGS AWAY\"\r"
"5100 PRINT \"3-BATTER BUNTS\"\r"
"5110 PRINT \"4-LEAD RUNNER STEALS\"\r"
"5120 REM PRINT \"5-HIT AND RUN\"\r"
"5130 RETURN\r"
"5140 REM PITCHING ROUTINE\r"
"5150 PRINT \"YOUR PITCHER MAY THROW:\"\r"
"5160 PRINT \"1-FAST BALL\"\r"
"5170 PRINT \"2-CURVE\"\r"
"5180 PRINT \"3-SLIDER\"\r"
"5190 PRINT \"4-SINKER\"\r"
"5200 PRINT \"5-CHANGE-UP\"\r"
"5210 PRINT \"6-KNUCKLEBALL\"\r"
"5220 PRINT \"7-SCREWBALL\"\r"
"5230 RETURN\r"
"5240 IF A=0 THEN 5370\r"
"5250 IF R9=1 THEN 5300\r"
"5260 PRINT \"WHAT WILL YOUR PITCHER THROW\";\r"
"5270 INPUT W\r"
"5280 IF W<0 THEN R9=1\r"
"5290 IF R9=0 THEN 5320 ELSE PRINT \"RANDOM PITCHES FOR REST OF INNING\"\r"
"5300 W=INT(RND(1)*8+1)\r"
"5310 IF W=8 THEN 5300\r"
"5320 IF W>0 AND W<8 THEN 5470\r"
"5330 PRINT \"UH-UH, \";B$;\". \";\r"
"5340 GOSUB 5150\r"
"5350 PRINT\r"
"5360 GOTO 5260\r"
"5370 REM I MUST SELECT A PITCH\r"
"5380 W1=RND(1)\r"
"5390 W=1\r"
"5400 IF W1<.75 THEN W=2\r"
"5410 IF W1<.55 THEN W=3\r"
"5420 IF W1<.45 THEN W=4\r"
"5430 IF W1<.35 THEN W=5\r"
"5440 IF W1<.15 THEN W=6\r"
"5450 IF W1<.08 THEN W=7\r"
"5460 GOTO 5470\r"
"5470 PRINT W$(W);\r"
"5480 PRINT \"...\";\r"
"5490 RETURN\r"
"5500 REM HIT-AND-RUN\r"
"5510 IF B(1)+B(2)+B(3)=0 THEN 4490\r"
"5520 GOSUB 5240\r"
"5530 PRINT \"HIT AND RUN!\"\r"
"5540 C=5\r"
"5550 GOTO 1460\r"
"5560 DATA FAST BALL,CURVE BALL,SLIDER,SINKER,CHANGE-UP,KNUCKLEBALL\r"
"5570 DATA SCREWBALL\r"
"5580 DATA RIGHT,LEFT,CENTER,FIRST,SECOND,THIRD,SHORTSTOP,PITCHER,CATCHER\r"
"5590 DATA RIGHT OVER THE PLATE,CAUGHT THE OUTSIDE CORNER\r"
"5600 DATA OVER THE INSIDE CORNER,OVER AT THE KNEES\r"
"5610 DATA HIGH,LOW,INSIDE,OUTSIDE,HIGH AND TIGHT,LOW AND OUTSIDE\r"
"5620 DATA LOW AND INSIDE,HIGH AND OUTSIDE\r"
"5630 END\r"
"";
const char basic_basketbl[] =
"5 PRINT TAB(31);\"BASKETBALL\"\r"
"7 PRINT TAB(15);\"CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\"\r"
"8 PRINT:PRINT:PRINT\r"
"10 PRINT \"THIS IS DARTMOUTH COLLEGE BASKETBALL. YOU WILL BE DARTMOUTH\"\r"
"20 PRINT \" CAPTAIN AND PLAYMAKER. CALL SHOTS AS FOLLOWS: 1. LONG\"\r"
"30 PRINT \" (30 FT.) JUMP SHOT; 2. SHORT (15 FT.) JUMP SHOT; 3. LAY\"\r"
"40 PRINT \" UP; 4. SET SHOT.\"\r"
"60 PRINT \"BOTH TEAMS WILL USE THE SAME DEFENSE. CALL DEFENSE AS\"\r"
"70 PRINT \"FOLLOWS: 6. PRESS; 6.5 MAN-TO MAN; 7. ZONE; 7.5 NONE.\"\r"
"72 PRINT \"TO CHANGE DEFENSE, JUST TYPE 0 AS YOUR NEXT SHOT.\"\r"
"76 INPUT \"YOUR STARTING DEFENSE WILL BE\";D:IF D<6 THEN 2010\r"
"79 PRINT\r"
"80 INPUT \"CHOOSE YOUR OPPONENT\";O$\r"
"370 PRINT \"CENTER JUMP\"\r"
"390 IF RND(1)> 3/5 THEN 420\r"
"400 PRINT O$;\" CONTROLS THE TAP.\"\r"
"410 GOTO 3000\r"
"420 PRINT \"DARTMOUTH CONTROLS THE TAP.\"\r"
"425 PRINT\r"
"430 INPUT \"YOUR SHOT\";Z\r"
"440 P=0\r"
"445 IF Z<>INT(Z) THEN 455\r"
"446 IF Z<0 OR Z>4 THEN 455\r"
"447 GOTO 460\r"
"455 PRINT \"INCORRECT ANSWER. RETYPE IT. \";:GOTO 430\r"
"460 IF RND(1)<.5 THEN 1000\r"
"480 IF T<100 THEN 1000\r"
"490 PRINT\r"
"491 IF S(1)<>S(0) THEN 510\r"
"492 PRINT:PRINT \" ***** END OF SECOND HALF *****\":PRINT\r"
"493 PRINT \"SCORE AT END OF REGULATION TIME:\"\r"
"494 PRINT \" DARTMOUTH:\";S(1);\" \";O$;\":\";S(0)\r"
"495 PRINT\r"
"496 PRINT \"BEGIN TWO MINUTE OVERTIME PERIOD\"\r"
"499 T=93\r"
"500 GOTO 370\r"
"510 PRINT \" ***** END OF GAME *****\"\r"
"515 PRINT \"FINAL SCORE: DARTMOUTH:\";S(1);\" \";O$;\":\";S(0)\r"
"520 STOP\r"
"600 PRINT\r"
"610 PRINT \" *** TWO MINUTES LEFT IN THE GAME ***\"\r"
"620 PRINT\r"
"630 RETURN\r"
"1000 ON Z GOTO 1040,1040\r"
"1030 GOTO 1300\r"
"1040 T=T+1\r"
"1041 IF T=50 THEN 8000\r"
"1042 IF T=92 THEN 1046\r"
"1043 GOTO 1050\r"
"1046 GOSUB 600\r"
"1050 PRINT \"JUMP SHOT\"\r"
"1060 IF RND(1)>.341*D/8 THEN 1090\r"
"1070 PRINT \"SHOT IS GOOD.\"\r"
"1075 GOSUB 7000\r"
"1085 GOTO 3000\r"
"1090 IF RND(1)>.682*D/8 THEN 1200\r"
"1100 PRINT \"SHOT IS OFF TARGET.\"\r"
"1105 IF D/6*RND(1)>.45 THEN 1130\r"
"1110 PRINT \"DARTMOUTH CONTROLS THE REBOUND.\"\r"