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
Dartmouth BASIC
(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!
===First Edition=== The original version, retroactively known as version one, supported the commands <code>LET</code>, <code>PRINT</code>, <code>END</code>, <code>FOR...NEXT</code>, <code>GOTO</code>, <code>GOSUB...RETURN</code>, <code>IF...THEN</code>, <code>DEF</code>, <code>READ</code>, <code>DATA</code>, <code>DIM</code>, and <code>REM</code>. It included basic math instructions, {{key|+}}, {{key|-}}, {{key|*}} and {{key|/}}, as well as the up-arrow for exponents "...since on a teletype typewriter it is impossible to print superscripts."{{sfn|Kurtz|1981|p=523}} In modern varieties, the up-arrow is normally replaced by the "hat" character, {{key|^}}. Exponents took the absolute value of the number before calculation, so to calculate {{code|-X^3}}, one had to use {{code|X*X*X}}. There was a further problem in the exponent function that treated {{code|-X^2}} as {{code|(-X)^2}} as opposed to the correct [[order of operations]] {{code|-(X^2)}}, which was not corrected until the third release.{{sfn|Kurtz|1981|p=523}} The <code>INT()</code> function always truncated towards zero.{{sfn|Kurtz|1981|p=524}} The language had a number of idiosyncrasies of its own. In contrast to later versions, the <code>LET</code> command was required on all statements lacking another command, so {{code|2=basic|1=10 A=5*5}} was not valid in this version.{{sfn|Kurtz|1981|p=524}} The <code>PRINT</code> statement used the comma when printing multiple variables, advancing to the next of five "zones". The comma was not needed in the case where one was printing a prompt and single value, so {{code|2=basic|PRINT "value of A is "A}} was valid. A somewhat hidden feature was that all variables were capable of representing arrays (vectors) of up to ten elements (subscripts 1 to 10, changed to 0 to 9 in the Second Edition) without being declared that way using <code>DIM</code>. <code>DIM</code> was only needed if a different vector size was required.{{sfn|Kurtz|1981|p=525}}{{efn|This feature was found on most BASICs based on Dartmouth, but was rare on those that were created independently.}} Variable names were limited to a single letter or a letter followed by a digit (286 possible variable names). User functions could only have a single letter, thus {{code|FNA}} through {{code|FNZ}}. All operations were done in [[floating point]]. On the GE-225 and GE-235, this produced a precision of about 30 bits (roughly ten digits) with a base-2 exponent range of -256 to +255.<ref>{{cite web|last=Kurtz|first=Thomas|title=BASIC Commands: The Original-Original Version|url=https://www.dartmouth.edu/basicfifty/commands.html#:~:text=All%20arithmetic%20was%20done%20in,of%20%2D256%20to%20%2B255.&text=Ten%20numeric%20functions%20were%20provided.}}</ref> Additionally, due to the GE-235's word size being 20-bits and using a [[six-bit character code]], the language enshrined the use of three-letter function names because that allowed the storage of three six-bit characters in a 20-bit word (using 18 bits). This is why BASIC functions are three letters, like <code>INT</code> or <code>SQR</code>, something that remained in the many varieties of the language long after they left the GE-235.{{sfn|Kurtz|1981|p=524}}
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)