programming:smilebasic:api_reference
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programming:smilebasic:api_reference [2024-08-08 21:58] – Correct intra-call LOCATE behavior zlg | programming:smilebasic:api_reference [2024-08-09 03:11] (current) – [Value Ranges] remove redundancy zlg | ||
---|---|---|---|
Line 38: | Line 38: | ||
===== Operators ===== | ===== Operators ===== | ||
+ | |||
+ | Every programming language has operators, and // | ||
+ | |||
+ | ==== Arithmetic ==== | ||
+ | |||
+ | These operators are your standard addition, subtraction, | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * ''/'' | ||
+ | * '' | ||
+ | |||
+ | ==== Comparison ==== | ||
+ | |||
+ | Comparison operators allow you to make decisions when you need to branch the behavior of a program with '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * ''>'' | ||
+ | * ''<'' | ||
+ | * ''> | ||
+ | * ''< | ||
+ | |||
+ | These same operators can be used stand-alone in expressions to generate boolean values, which are typically '' | ||
+ | |||
+ | ==== Logical ==== | ||
+ | |||
+ | Logical operators are often combined with expressions that contain comparison operators in order to make meaningful decisions in the program. This means most " | ||
+ | |||
+ | < | ||
+ | Solution = Logical operations of expressions, | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | If you can abstract a problem into this framework, you are mastering logical operators. | ||
+ | |||
+ | * ''&&'' | ||
+ | * '' | ||
+ | |||
+ | The more legible '' | ||
===== Logic and Control Flow ===== | ===== Logic and Control Flow ===== | ||
- | ===== Input ===== | + | These functions or constructs are used to manipulate the flow, or structure, of your programs. |
+ | |||
+ | * [[# | ||
+ | * [[# | ||
+ | |||
+ | ===== Input/ | ||
+ | |||
+ | * [[# | ||
+ | * [[# | ||
===== Graphics Layering ===== | ===== Graphics Layering ===== | ||
Line 52: | Line 102: | ||
This section is where all the " | This section is where all the " | ||
+ | |||
+ | ==== At sign (@) ==== | ||
+ | |||
+ | The sigil for a label for [[# | ||
==== CLEAR ==== | ==== CLEAR ==== | ||
Line 60: | Line 114: | ||
TODO: Does this also erase/ | TODO: Does this also erase/ | ||
+ | |||
+ | ==== GOTO ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | Jump to the specified label in the code, and continue execution. | ||
+ | |||
+ | // | ||
+ | |||
+ | ==== INPUT ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | Accepts keyboard input and stores it into the given variable; an optional message can be included as a quoted string, followed by a semicolon ('';'' | ||
==== LOCATE ==== | ==== LOCATE ==== | ||
Line 74: | Line 142: | ||
| Z | -256-1024 | | | Z | -256-1024 | | ||
- | The Z axis is remembered from the last LOCATE call if not specified, and defaults to 0. | + | The Z axis defaults to 0. |
Any missing axes from a LOCATE call will be filled in with the last value used for that axis. All axes default to 0 if LOCATE is called after a CLEAR. | Any missing axes from a LOCATE call will be filled in with the last value used for that axis. All axes default to 0 if LOCATE is called after a CLEAR. | ||
Line 88: | Line 156: | ||
<code freebasic> | <code freebasic> | ||
?(7 + 2) ' outputs 9 | ?(7 + 2) ' outputs 9 | ||
+ | </ | ||
+ | |||
+ | String values can be concatenated with either the semicolon ('';'' | ||
+ | |||
+ | <code freebasic> | ||
+ | A$ = "beep " | ||
+ | B$ = " | ||
+ | ?(A$+B$) ' outputs "beep boop" | ||
</ | </ |
programming/smilebasic/api_reference.1723154283.txt.gz · Last modified: 2024-08-08 21:58 by zlg