Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
BASIC Programming
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===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}} }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)