BASIC Programming

Revision as of 20:02, 18 May 2024 by imported>Matthias M. (Template:atarimania)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:About Template:Use dmy dates Template:More citations needed

Template:Main other{{#invoke:infobox|infoboxTemplate | child = | subbox = | bodyclass = ib-video-game hproduct {{#ifeq:|yes|collapsible {{#if:|{{{state}}}|autocollapse}}}} | templatestyles = Infobox video game/styles.css | aboveclass = fn | italic title =

| above = BASIC Programming

| image = {{#invoke:InfoboxImage|InfoboxImage|image={{#invoke:WikidataIB |getValue|rank=best|P18 |name=image |qid= |suppressfields= |fetchwikidata=ALL |onlysourced=no |noicon=yes|BASIC Programming Cover Art.jpg}}|size=|sizedefault=frameless|upright=1|alt=|border=|suppressplaceholder=yes}}

| caption = {{#if:BASIC Programming Cover Art.jpg||{{#invoke:WikidataIB|getValue|P18|qual=P2096|qualsonly=y|fwd=ALL}}}}

| label2 = Developer(s) | data2 = Atari, Inc.

| label3 = Publisher(s) | data3 = Atari, Inc.

| label4 = Director(s) | data4 = Template:If first display both

| label5 = Producer(s) | data5 = Template:If first display both

| label6 = Designer(s) | data6 = Warren Robinett<ref>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>

| label7 = Programmer(s) | data7 = Template:If first display both

| label8 = Artist(s) | data8 = Template:If first display both

| label9 = Writer(s) | data9 = Template:If first display both

| label10 = Composer(s) | data10 = Template:If first display both

| label11 = Series | data11 = Template:If first display both

| label12 = Engine | data12 = Template:If first display both

| label13 = Platform(s) | data13 = Atari 2600

| label14 = Release | data14 = 1979

| label15 = Genre(s) | data15 = Template:If first display both

| label16 = Mode(s) | data16 = Template:If first display both

| label17 = Arcade system | data17 = Template:If first display both

| data30 =

| below = Template:EditOnWikidata

}}Template:Main other{{#invoke:Check for unknown parameters|check|unknown=Template:Main other|ignoreblank=1|preview=Page using Template:Infobox video game with unknown parameter "_VALUE_"| alt | arcade system | artist | caption | border | child | collapsible | commons | composer | designer | developer | director | embedded | engine | fetchwikidata | genre | image | image_size | image_upright | italic title | modes | noicon | onlysourced | platform | platforms | producer | programmer | publisher | qid | refs | release | released | series | state | subbox | suppressfields | title | writer }}Template:Main other{{#if:BASIC Programming Cover Art.jpg|}}

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.

DetailsEdit

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.<ref>Controllers - Atari Keypad, Template:Webarchive 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 featuresEdit

VCS BASIC supports the following keywords:<ref>Template:Cite book</ref>

  • 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: Template:CodettMod2Template:CodettTemplate:Codett92
  • 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 codeEdit

The following example of a Pong game is provided. Template:Pre

See alsoEdit

Template:Portal

ReferencesEdit

Template:Reflist

External linksEdit

Template:BASIC