`
ijavagos
  • 浏览: 1248093 次
  • 性别: Icon_minigender_2
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Bill Gates写的QBASIC程序(1981)

IBM 
阅读更多
' =======================================
' Bill Gates写的QBasic程序(1981-1982)
' (老古董了。没准它的年纪不比你小! :)
' 文件名: DONKEYQB.BAS
' 运行: QBasic /RUN DonkeyQB.BAS
'=======================================
REM The IBM Personal Computer Donkey
REM Version 1.10 (C)Copyright IBM Corp 1981, 1982
REM Licensed Material - Program Property of IBM
DEF SEG : POKE 106, 0
SAMPLES$ = "NO"
DIM CAR%(900)
GOTO 1010
SAMPLES$ = "YES"
1010 KEY OFF: SCREEN 0, 1: COLOR 15, 0, 0: WIDTH 40: CLS : LOCATE 5, 19: PRINT "IBM"
LOCATE 7, 12, 0: PRINT "Personal Computer"
COLOR 10, 0: LOCATE 10, 9, 0: PRINT CHR$(213) + STRING$(21, 205) + CHR$(184)
LOCATE 11, 9, 0: PRINT CHR$(179) + " DONKEY " + CHR$(179)
LOCATE 12, 9, 0: PRINT CHR$(179) + STRING$(21, 32) + CHR$(179)
LOCATE 13, 9, 0: PRINT CHR$(179) + " Version 1.10 " + CHR$(179)
LOCATE 14, 9, 0: PRINT CHR$(212) + STRING$(21, 205) + CHR$(190)
COLOR 15, 0: LOCATE 17, 4, 0: PRINT "(C) Copyright IBM Corp 1981, 1982"
COLOR 14, 0: LOCATE 23, 7, 0: PRINT "Press space bar to continue"
1100 IF INKEY$ <> "" THEN GOTO 1100
1110 CMD$ = INKEY$
IF CMD$ = "" THEN GOTO 1110
IF CMD$ = CHR$(27) THEN GOTO 1298
IF CMD$ = " " THEN GOTO 1160
GOTO 1110
1160 DEF SEG = 0
IF (PEEK(&H410) AND &H30) <> &H30 THEN DEF SEG : GOTO 1291
WIDTH 80: CLS : LOCATE 3, 1
PRINT "HOLD IT!"
PRINT "YOU'RE NOT USING THE COLOR/GRAPHICS MONITOR ADAPTER!"
PRINT "THIS PROGRAM USES GRAPHICS AND REQUIRES THAT ADAPTER."
PRINT "PRESS THE SPACE BAR TO CONTINUE."
DEF SEG
1240 IF INKEY$ <> "" THEN GOTO 1240
1250 CMD$ = INKEY$
IF CMD$ = "" THEN GOTO 1250
IF CMD$ = CHR$(27) THEN GOTO 1298
IF CMD$ = " " THEN GOTO 1298
GOTO 1250
1291 KEY OFF
ON ERROR GOTO 1295
PLAY "p16"
GOTO 1300
1295 COLOR 31, 0, 0
PRINT "THIS PROGRAM REQUIRES ADVANCED BASIC -- USE COMMAND 'BASICA'": COLOR 15, 0, 0: FOR I = 1 TO 9000: NEXT: RESUME 1298
1298 ON ERROR GOTO 0
SCREEN 0, 1: COLOR 7, 0, 0: CLS : END
1300 REM
COLOR 0
DEFINT A-Y
SCREEN 1, 0: COLOR 8, 1
DIM Q%(500)
DIM D1%(150), D2%(150), C1%(200), C2%(200)
DIM DNK%(300)
GOSUB 1940
GOSUB 1780
CLS
DIM B%(300)
FOR I = 2 TO 300: B%(I) = -16384 + 192: NEXT
B%(0) = 2: B%(1) = 193
1540 REM
CX = 110: CLS
LINE (0, 0)-(305, 199), , B
LINE (6, 6)-(97, 195), 1, BF
LINE (183, 6)-(305, 195), 1, BF
LOCATE 3, 5: PRINT "Donkey"
LOCATE 3, 29: PRINT "Driver"
LOCATE 19, 25: PRINT "Press Space ";
LOCATE 20, 25: PRINT "Bar to switch";
LOCATE 21, 25: PRINT "lanes ";
LOCATE 23, 25: PRINT "Press ESC ";
LOCATE 24, 25: PRINT "to exit ";
FOR Y = 4 TO 199 STEP 20: LINE (140, Y)-(140, Y + 10): NEXT
CY = 105: CX = 105
LINE (100, 0)-(100, 199): LINE (180, 0)-(180, 199)
1670 LOCATE 5, 6: PRINT SD: LOCATE 5, 31: PRINT SM
CY = CY - 4: IF CY < 60 THEN 2230
PUT (CX, CY), CAR%, PRESET
DX = 105 + 42 * INT(RND * 2)
FOR Y = (RND * -4) * 8 TO 124 STEP 6
SOUND 20000, 1
A$ = INKEY$: IF A$ = CHR$(27) THEN 1298 ELSE POKE 106, 0: IF LEN(A$) > 0 THEN LINE (CX, CY)-(CX + 28, CY + 44), 0, BF: CX = 252 - CX: PUT (CX, CY), CAR%, PRESET: SOUND 200, 1
IF Y >= 3 THEN PUT (DX, Y), DNK%, PSET
IF CX = DX AND Y + 25 >= CY THEN 2060
IF Y AND 3 THEN PUT (140, 6), B%
NEXT: LINE (DX, 124)-(DX + 32, 149), 0, BF: GOTO 1670
1780 CLS
DRAW "S8C3"
DRAW "BM12,1r3m+1,3d2R1ND2u1r2d4l2u1l1"
DRAW "d7R1nd2u2r3d6l3u2l1d3m-1,1l3"
DRAW "m-1,-1u3l1d2l3u6r3d2nd2r1u7l1d1l2"
DRAW "u4r2d1nd2R1U2"
DRAW "M+1,-3"
DRAW "BD10D2R3U2M-1,-1L1M-1,1"
DRAW "BD3D1R1U1L1BR2R1D1L1U1"
DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
DRAW "BD2BL2D1R1U1L1BR2R1D1L1U1"
LINE (0, 0)-(40, 60), , B
PAINT (1, 1)
REM DIM CAR%(900)
GET (1, 1)-(29, 45), CAR%
RETURN
1940 CLS
DRAW "S08"
DRAW "BM14,18"
DRAW "M+2,-4R8M+1,-1U1M+1,+1M+2,-1"
DRAW "M-1,1M+1,3M-1,1M-1,-2M-1,2"
DRAW "D3L1U3M-1,1D2L1U2L3D2L1U2M-1,-1"
DRAW "D3L1U5M-2,3U1"
PAINT (21, 14), 3
PRESET (37, 10): PRESET (40, 10)
PRESET (37, 11): PRESET (40, 11)
GET (13, 0)-(45, 25), DNK%
RETURN
2060 SD = SD + 1: LOCATE 14, 6: PRINT "BOOM!"
GET (DX, Y)-(DX + 16, Y + 25), D1%
D1X = DX: D1Y = Y: D2X = DX + 17
GET (DX + 17, Y)-(DX + 31, Y + 25), D2%
GET (CX, CY)-(CX + 14, CY + 44), C1%
GET (CX + 15, CY)-(CX + 28, CY + 44), C2%
C1X = CX: C1Y = CY: C2X = CX + 15
FOR P = 6 TO 0 STEP -1: Z = 1 / (2 ^ P): Z1 = 1 - Z
PUT (C1X, C1Y), C1%: PUT (C2X, C1Y), C2%
PUT (D1X, D1Y), D1%: PUT (D2X, D1Y), D2%
C1X = CX * Z1: D1Y = Y * Z1: C2X = C2X + (291 - C2X) * Z
D1X = DX * Z1: C1Y = C1Y + (155 - C1Y) * Z: D2X = D2X + (294 - D2X) * Z
PUT (C1X, C1Y), C1%: PUT (C2X, C1Y), C2%
PUT (D1X, D1Y), D1%: PUT (D2X, D1Y), D2%
SOUND 37 + RND * 200, 4: NEXT
FOR Y = 1 TO 2000: NEXT
CLS : GOTO 1540
2230 SM = SM + 1: LOCATE 7, 25: PRINT "Donkey loses!"
FOR Y = 1 TO 1000: NEXT
CLS : GOTO 1540
分享到:
评论

相关推荐

    Bill Gates shares the 5 books

    根据提供的文件信息,我们可以提取出比尔·盖茨推荐的书籍及其相关知识点。以下是对每本提及书籍的详细解析: 1.《达芬奇传》沃尔特·艾萨克森著 知识点:沃尔特·艾萨克森所著的《达芬奇传》是一本关于文艺复兴...

    Richard Feynman and Bill Gates ---An imaginary encounter

    这篇文章是关于一个虚构的相遇,将理查德·费曼(Richard Feynman)和比尔·盖茨(Bill Gates)这两位在不同领域有着重大影响力的人物联系在一起。费曼是一位杰出的物理学家,获得了诺贝尔奖,而盖茨则是微软公司的...

    bill_gates the_road_ahead.pdf

    - **作者背景**:比尔·盖茨(Bill Gates),微软公司的创始人之一,在信息技术领域具有深远的影响力。他在十三岁时就编写了自己的第一个计算机程序,并对计算机产生了浓厚的兴趣。 #### 二、计算机早期经历 - **...

    Bill Gates 2.rar_Billgates EA_ea

    【标题】"Bill Gates 2.rar_Billgates EA_ea" 暗示着这是一个与外汇交易自动交易系统(Expert Advisor,简称EA)相关的文件,可能是由比尔·盖茨(Bill Gates)命名或启发的。在外汇交易中,EA是一种自动化策略,...

    Bill Gates下次的疫情暴发我们还没准备好.doc

    Bill Gates下次的疫情暴发我们还没准备好.doc

    未来时速-BILL GATES名作

    GATES的名作,互联网时代由此拉开。这本书里提到的众多概念现在正在逐步被大众接受并成为实际。还有很多科技方向的思考对我们的社会发展技术进步仍有前瞻意义。

    简单易懂的sql安全设置和基础

    1. 假设有一个名为email_table 的表,包含名字和地址两个字段,要得到Bill Gates 的e_mail地址,你可以使用下面的查询: SELECT email from email_table WHERE name=’Bill Gates’ 2. 前面说过,查询可以在查询条件...

    优课UOOC 深圳大学 大学英语3 - 第6章 Unit 5 General Reading exercises 答案

    这道题考察的是Bill Gates对计算机的看法,他认为计算机是最令人惊叹的工具,因为它们可以帮助我们解决智能人无法单独解决的问题。 2. How does Bill Gates feel about future?答案:A.He feels very hopeful. 这...

    Inside The Deal That Made Bill Gates 350,000,000 (1986)-计算机科学

    Inside the deal that made Bill Gates $350,000,000. by Bro Uttal:copyright: COPYRIGHT 1986 Time, Inc.Going public is one of capitalism’s major sacraments, conferring instant superwealth on a few ...

    计算机程序设计艺术第三版第二卷:半数值算法.pdf[中文版]

    ―― Bill Gates 《计算机程序设计艺术》重译自Donald E. Knuth(汉名高德纳)的三卷著作:"The Art of Computer Programming: 1. Fundamental Algorithms; 2. Seminumerical Algorithms; 3. Sorting and Searching...

    C++学习代码(实例)

     640K ought to be enough for everybody — Bill Gates 1981  程序员们经常编写内存管理程序,往往提心吊胆。如果不想触雷,唯一的解决办法就是发现所有潜伏的地雷并且排除它们,躲是躲不了的。本文的内容比...

    高中英语晨读英语美文60篇31BILLGATESINHISBOYHOOD素材

    在信息技术日新月异的时代,比尔·盖茨的名字无疑成为了创新与创业精神的代名词。纵观这位微软创始人的一生,从童年时期便展露出了与众不同的个性和才华,以及对计算机的深厚兴趣,这些因素共同塑造了他非凡的成功...

    Linus和Bill.pdf

    3. **Linus Torvalds与Bill Gates的对比**:与比尔·盖茨相比,Linus Torvalds以其开源精神和对技术社区的贡献而闻名。他并不追求个人财富的积累,而是致力于提供一个强大而可靠的操作系统。他的工作风格和对开放源...

    判断程序是否为WIN32程序

    在DOS程序中,文件头通常包含MZ标记,这是早期DOS可执行文件的标志,来源于它的创始人之一,Bill Gates和Paul Allen的姓氏首字母。而在WIN32程序中,文件头通常包含PE(Portable Executable)标记,这是Windows操作...

    bill-bill-bill:产生重复的文字模因

    右图是使用./bill-bill-bill bill.jpg "bill gates" "blil gaaaaatesssss" -o bill-pb-morphed.jpg用法Usage: bill-bill-bill [OPTION...] &lt;in&gt; &lt;base_string&gt; &lt;meme&gt; -d, --display Display the image, even...

    操作sql语句

    - 示例: `SELECT Nam e, EmailAddress FROM Contacts WHERE Nam e = 'Bill Gates';` 这条命令将从Contacts表中选择姓名为“Bill Gates”的记录的姓名和电子邮件地址。 2. **创建新表** - 使用`CREATE TABLE`语句...

    Introduction to Computing Systems From bits &amp; gates to C &amp; beyond

    Patt'Introduction to Computing Systems: From bits & gates to C & beyond', now in its second edition, is designed to give students a better understanding of computing early in their college careers in...

    第一本BASIC教程

    Bill Gates就是因为掌握BASIC语言成立了Microsoft! BASIC语言具有如下特性: 1.一行代码,一条语句。 2.代码行号就是GOTO目标,面向过程组织程序。 3.所有的运算都使用浮点。 4.变量无需定义直接使用。一个数就是一...

    sql入门高级,SQL教程,数据库教程[收集].pdf

    例如,`SELECT * FROM Contacts WHERE Name = 'Bill Gates'`会返回所有名字为"Bill Gates"的记录。 4. **更新数据**:若需修改已存在的数据,使用`UPDATE`语句。例如,`UPDATE Contacts SET Email = 'newemail@...

    Gates on the fly用户手册

    ### Gates on the Fly (GOF)用户手册:芯片数字电路ECO详解 #### 一、简介 **Gates on the Fly (GOF)**是一款由NanDigits Design Automation开发的先进电子设计自动化(EDA)工具,专门用于处理数字集成电路的设计...

Global site tag (gtag.js) - Google Analytics