Difference between revisions of "YOLOL"
Line 50: | Line 50: | ||
Assigning a value to a variable always converts the variable to the value's type. | Assigning a value to a variable always converts the variable to the value's type. | ||
'''Example:''' | |||
ultimateAutopilot = 128.6432 | ultimateAutopilot = 128.6432 |
Revision as of 09:20, 18 March 2019
Summary
YOLOL is the programming language used to control and manage electric devices.
The code is written on lines in chips which are then inserted to chip sockets, that read and relay their messages.
With YOLOL, it's possible to program and control almost any device within the known universe.
Basic information
How it works?
YOLOL code is written to and executed from YOLOL chips, and can be used to monitor and control electrical devices connected to the data network the chip is connected to.
Lines of code are executed in sequence from top to bottom, repeating the cycle of the chip after the last line has been executed, unless the script includes instructions for specific line changes, or stopping code completely.
To put it simply:
- Code execution starts from line 1
- After reading line 1, it proceeds to the next line based on the chip time interval
- The process is repeated
- If there are no special cases, the chip will begin executing line 1 again after the last line has been executed
Related pages
Command references
Case insensitive
YOLOL is fully case insensitive.
This means that the following two example scripts function identically to each other:
if ButtonState == 1 then DoorState = 1 end
IF buttonstate == 1 THEN doorstate = 1 END
The characters can however be written in either lowercase or uppercase letters.
This way it's possible to have your YOLOL code look a bit more organized.
Variables
The variables in YOLOL are weakly typed (don't enforce type validity), and support two data types: fixed-point decimals(up to 0.001 precision) and strings.
To put it simply, the variables can either be introduced as strings or numbers at any point, ignoring the earlier variable type.
Each variable is always of a single type, though it will be implicitly converted when required.
The default value of an uninitialized variable is 0, and nil values are not supported.
True/False are numerical values of non-0 and 0.
Assigning a value to a variable always converts the variable to the value's type.
Example:
ultimateAutopilot = 128.6432
This results in the variable ultimateAutopilot containing a numeric value of 128.6432
ultimateAutopilot = "Error prone"
This results the variable ultimateAutopilot to be a string variable "Error prone", and numeric value of 128.6432 is removed.