Jump to content

BASIC Programming: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m External links: stub sorting using AWB
 
(48 intermediate revisions by 32 users not shown)
Line 1: Line 1:
{{about|the Atari 2600 cartridge|programming in other BASICs|BASIC|other uses|Basic programming (disambiguation)}}
{{About|the Atari 2600 cartridge|programming in other BASIC dialects|BASIC|other uses|Basic programming (disambiguation){{!}}Basic programming}}
{{Use dmy dates|date=July 2017}}
{{Infobox video game
{{more citations needed|date=October 2017}}
|title = Basic Programming
|image = Basicprogramming.png


{{Infobox video game
|developer = [[Warren Robinett]]<ref>[http://www.dadgum.com/halcyon/BOOK/ROBINETT.HTM Interview:Warren Robinett], By James Hague, Halcyon Days, ''How long did it take to write?...I had "Adventure" sort of done in the fall of 1978, but I wasn't satisfied. I sort of put it on the shelf for the next six months while I did the "BASIC Programming" cartridge, and finished them both simultaneously, in June 1979.''</ref>
|publisher = Atari
|title = BASIC Programming
|image = BASIC Programming Cover Art.jpg
|designer = [[Warren Robinett]]
|developer = [[Atari, Inc.]]
|released = {{Start date and age|1979}}
|publisher = Atari, Inc.
|designer = [[Warren Robinett]]<ref>[https://dadgum.com/halcyon/BOOK/ROBINETT.HTM Interview:Warren Robinett], By James Hague, ''Halcyon Days'', "How long did it take to write?...I had ''Adventure'' sort of done in the fall of 1978, but I wasn't satisfied. I sort of put it on the shelf for the next six months while I did the ''BASIC Programming'' cartridge, and finished them both simultaneously, in June 1979."</ref>
|released = 1979
|platforms = [[Atari 2600]]
|platforms = [[Atari 2600]]
|Notes = One of the few games to use the keypad controllers
}}
}}


'''BASIC Programming''' (Model# CX2620) attempted to teach simple computer programming on the [[Atari 2600]]. It was released in 1979, and it was one of only a few non-gaming cartridges ever designed for the 2600. The programming language was superficially similar to dialects of [[BASIC]], but differed in many important aspects. The extremely small [[RAM]] size of the Atari 2600, 128 bytes, severely restricted the possibilities of this cartridge for writing programs.
'''''BASIC Programming''''' is an Atari Video Computer System (later called the [[Atari 2600]]) cartridge that teaches simple computer programming using a dialect of [[BASIC]]. Written by [[Warren Robinett]] and released by [[Atari, Inc.]] in 1979, this [[BASIC interpreter]] is one of a few non-game cartridges for the console. The Atari VCS's [[Random-access memory|RAM]] size of 128 bytes restricts the possibilities for writing programs.


==Details==
==Details==
[[Image:Basicprogramming.png|thumb|upright=2|Main display]]
The BASIC Programming display was divided into six regions:


The ''BASIC Programming'' display is divided into six regions:
* '''Program''' where instructions are written (maximum of nine (or eleven) lines of code).
* [[Call stack|Stack]] shows temporary results of what your program does.
* [[Variable (programming)|Variables]] displays the values of any variables your program is using.
* '''Output''' displays any output values your program is creating.
* '''Status''' displays the amount of available memory remaining
* '''Graphics''' contains two colored squares that can be manipulated by your program.


* '''Program''' is where instructions are typed. It has a maximum of eleven lines of code.
Input is given through two Atari keypad controllers, which came with special overlays to show how to type the different commands and letters.<ref>[https://atariage.com/controller_page.html?ControllerID=4&SystemID=2600 Controllers - Atari Keypad], Atari KeypadSystem: Atari 2600, Model Number: CX50, ''Sold in pairs, functionally identical to the Kid's Controller and the Video Touch Pad. Included overlays with commands, meant to be used with Basic Programming.''</ref> Programs were restricted to 64 characters in size and 9 lines of code, severely limiting the programs that could be written. Users could disable all windows except Program and keep selecting "New Line" until over nine empty lines had been entered and thus their program could use 11 lines of code using this trick.
* '''[[Call stack|Stack]]''' shows temporary results of what the program does.
* '''[[Variable (computer science)|Variables]]''' stores the values of any variables that the program is using.
* '''Output''' displays any output values that the program creates.
* '''Status''' shows the amount of available memory remaining.
* '''Graphics''' contains two colored squares that can be manipulated by the program.

Input is given through two Atari keypad controllers, which came with special overlays to show how to type the different commands and letters.<ref>[https://atariage.com/controller_page.html?ControllerID=4&SystemID=2600 Controllers - Atari Keypad], {{Webarchive|url=https://web.archive.org/web/20150615042830/https://atariage.com/controller_page.html?ControllerID=4&SystemID=2600 |date=15 June 2015 }} Atari KeypadSystem: Atari 2600, Model Number: CX50, ''Sold in pairs, functionally identical to the Kid's Controller and the Video Touch Pad. Included overlays with commands, meant to be used with Basic Programming.''</ref> Programs are restricted to 64 characters in size and normally 9 lines of code, limiting the programs that can be written (users can disable all windows except Program and keep selecting "New Line" until 11 lines of code are present).

===Language features===

VCS BASIC supports the following keywords:<ref>{{cite book|title=BASIC Programming: Atari Game Program Instructions|date=1979|publisher=Atari, Inc.|location=Sunnyvale, CA}}</ref>
* Statements: <code>Print</code>
* Structure: <code>Goto</code>, <code>If-Then-Else</code>
* Graphics: <code>Clear</code>
* Functions: <code>Hit</code>, <code>Key</code>
* Math: <code>+ - × ÷ Mod</code>
* Relational operators: <code>< > =</code>

Unlike most BASIC implementations of the time:
* VCS BASIC uses ← instead of = for assignment; e.g., <code>A←A+1</code>.
* Statements can be strung together on a line without a delimiter; e.g., <code>Note←APrintA</code>.
* An <code>If</code> statement can be used as a function, returning a value: <code>{{codett|2=cbmbas|Ver1←Ver1+IfVer1}}[[Modulo operation|Mod]]2{{codett|2=cbmbas|Then8}}{{codett|2=monkey|Else}}92</code>
* <code>If</code> statements can take an <code>Else</code> clause.

Special variable names:
* <code>Note</code> sounds a musical note, assigned numbers from 0 to 7
** Numbers assigned to <code>Note</code> are implicitly assigned modulus 8, thus 8 becomes 0, 9 becomes 1, etc.
* <code>Hor1</code>, <code>Hor2</code> - the horizontal coordinate of one of two squares
* <code>Ver1</code>, <code>Ver2</code> - the vertical coordinate of one of two squares

The language supports 26 unsigned integer variables A to Z. VCS BASIC supports integers from 0 to 99. Math operations wrap, so 99+1 becomes 0, 99+2 becomes 1, etc.

====Sample code====
The following example of a ''[[Pong]]'' game is provided.
{{pre|
1 Hor2←2+Key
2 {{codett|2=cbmbas|IfVer1>90ThenVer1←88}}
3 {{codett|2=cbmbas|IfHit}}{{codett|2=cbmbas|ThenVer1←9}}
4 {{codett|2=cbmbas|Ver1←Ver1+IfVer1}}[[Modulo operation|Mod]]2{{codett|2=cbmbas|Then8}}{{codett|2=monkey|Else}}92
5 Hor1←Hor1+7
6 {{codett|2=cbmbas|Goto1}}
}}


==See also==
==See also==
{{Portal|Video games}}
* [[CompuMate|Spectravideo CompuMate]] Basic Keyboard Enhancer - Atari 2600 cartridge
*[[List of Atari 2600 games]]
* [[CompuMate|Spectravideo CompuMate]]
* [[Family BASIC]]


==References==
==References==
Line 33: Line 74:


==External links==
==External links==
* {{atarimania|id=20194}}
*''[http://www.atariage.com/software_page.html?SoftwareLabelID=15 Basic Programming]'' at [[AtariAge]]
*{{wayback|date=20040123023347|url=http://www.mindspring.com/~sidartha/Basic%20and%20Compumate%20Programming.htm|title=Compumate FAQ:BASIC PROGRAMME EXAMPLES FOR ATARI 2600 (BASIC PROGRAMMING & CompuMate). AUTHOR: Graham.J.Percy, Version 1.0, 25th September, 1998.}}
* {{webarchive |url=https://web.archive.org/web/20040123023347/http://www.mindspring.com/~sidartha/Basic%20and%20Compumate%20Programming.htm |date=January 23, 2004 |title=Compumate FAQ:BASIC PROGRAMME EXAMPLES FOR ATARI 2600 (BASIC PROGRAMMING & CompuMate)}}


{{BASIC}}
{{BASIC}}


[[Category:1979 video games]]
[[Category:1979 software]]
[[Category:Atari games]]
[[Category:Atari 2600]]
[[Category:Atari 2600 games]]
[[Category:BASIC interpreters]]
[[Category:Programming games]]
[[Category:BASIC programming language family]]
[[Category:Discontinued BASICs]]
{{Videogame-stub}}
[[Category:Video game development software]]

Latest revision as of 20:02, 18 May 2024

BASIC Programming
Developer(s)Atari, Inc.
Publisher(s)Atari, Inc.
Designer(s)Warren Robinett[1]
Platform(s)Atari 2600
Release1979

BASIC Programming is an Atari Video Computer System (later called the Atari 2600) cartridge that teaches simple computer programming using a dialect of BASIC. Written by Warren Robinett and released by Atari, Inc. in 1979, this BASIC interpreter is one of a few non-game cartridges for the console. The Atari VCS's RAM size of 128 bytes restricts the possibilities for writing programs.

Details

[edit]
Main display

The BASIC Programming display is divided into six regions:

  • Program is where instructions are typed. It has a maximum of eleven lines of code.
  • Stack shows temporary results of what the program does.
  • Variables stores the values of any variables that the program is using.
  • Output displays any output values that the program creates.
  • Status shows the amount of available memory remaining.
  • Graphics contains two colored squares that can be manipulated by the program.

Input is given through two Atari keypad controllers, which came with special overlays to show how to type the different commands and letters.[2] Programs are restricted to 64 characters in size and normally 9 lines of code, limiting the programs that can be written (users can disable all windows except Program and keep selecting "New Line" until 11 lines of code are present).

Language features

[edit]

VCS BASIC supports the following keywords:[3]

  • Statements: Print
  • Structure: Goto, If-Then-Else
  • Graphics: Clear
  • Functions: Hit, Key
  • Math: + - × ÷ Mod
  • Relational operators: < > =

Unlike most BASIC implementations of the time:

  • VCS BASIC uses ← instead of = for assignment; e.g., A←A+1.
  • Statements can be strung together on a line without a delimiter; e.g., Note←APrintA.
  • An If statement can be used as a function, returning a value: Ver1Ver1+IfVer1Mod2Then8Else92
  • If statements can take an Else clause.

Special variable names:

  • Note sounds a musical note, assigned numbers from 0 to 7
    • Numbers assigned to Note are implicitly assigned modulus 8, thus 8 becomes 0, 9 becomes 1, etc.
  • Hor1, Hor2 - the horizontal coordinate of one of two squares
  • Ver1, Ver2 - the vertical coordinate of one of two squares

The language supports 26 unsigned integer variables A to Z. VCS BASIC supports integers from 0 to 99. Math operations wrap, so 99+1 becomes 0, 99+2 becomes 1, etc.

Sample code

[edit]

The following example of a Pong game is provided.

1 Hor2←2+Key
2 IfVer1>90ThenVer188
3 IfHitThenVer19
4 Ver1Ver1+IfVer1Mod2Then8Else92
5 Hor1←Hor1+7
6 Goto1

See also

[edit]

References

[edit]
  1. ^ Interview:Warren Robinett, By James Hague, Halcyon Days, "How long did it take to write?...I had Adventure sort of done in the fall of 1978, but I wasn't satisfied. I sort of put it on the shelf for the next six months while I did the BASIC Programming cartridge, and finished them both simultaneously, in June 1979."
  2. ^ Controllers - Atari Keypad, Archived 15 June 2015 at the Wayback Machine Atari KeypadSystem: Atari 2600, Model Number: CX50, Sold in pairs, functionally identical to the Kid's Controller and the Video Touch Pad. Included overlays with commands, meant to be used with Basic Programming.
  3. ^ BASIC Programming: Atari Game Program Instructions. Sunnyvale, CA: Atari, Inc. 1979.
[edit]