<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starbasegame.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Azurethi</id>
	<title>Starbase wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starbasegame.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Azurethi"/>
	<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=Special:Contributions/Azurethi"/>
	<updated>2026-05-01T21:40:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=18304</id>
		<title>YOLOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=18304"/>
		<updated>2020-09-16T07:33:31Z</updated>

		<summary type="html">&lt;p&gt;Azurethi: Reverted a change by Totoro. &amp;quot;Not 0&amp;quot; is not the same as &amp;quot;1&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Otherlang2&lt;br /&gt;
|de=YOLOL:de&lt;br /&gt;
|zh-cn=YOLOL语言&lt;br /&gt;
|ru=YOLOL:ru&lt;br /&gt;
|ua=YOLOL:ua&lt;br /&gt;
}}&lt;br /&gt;
== Summary ==&lt;br /&gt;
YOLOL is a programming language used to control and manage electrical [[Devices and machines|devices]].&amp;lt;br&amp;gt;&lt;br /&gt;
The code is written on lines in [[YOLOL Chip|YOLOL chips]] which are then inserted into [[Chip socket|chip sockets]], that read and relay their messages.&amp;lt;br&amp;gt;&lt;br /&gt;
The programming language enables the programming and controlling of almost any device within the known universe.&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
The code is written to and executed from programmable chips, and can be used to both monitor and control electrical [[Devices and machines|devices]] connected to a [[Data networks|data network]].&amp;lt;br&amp;gt;&lt;br /&gt;
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 programmed instructions for specific line changes or stopping the execution completely.&lt;br /&gt;
&lt;br /&gt;
To put it simply:&lt;br /&gt;
&lt;br /&gt;
# Code execution starts from line 1&lt;br /&gt;
# After reading line 1, it proceeds to the next line based on the chip's time interval&lt;br /&gt;
# The process is then repeated for the line 2, 3, 4... etc.&lt;br /&gt;
# The chip will begin executing line 1 again after the last line has been executed (unless the last line contains a goto statement or execution has been paused)&lt;br /&gt;
&lt;br /&gt;
So blank lines still use 0.2 seconds, and can be used as a brief execution delay. (lines with only a comment are effectively the same as a blank line.)&lt;br /&gt;
&lt;br /&gt;
=== Related pages ===&lt;br /&gt;
&lt;br /&gt;
* [[Data networks]]&lt;br /&gt;
* [[Devices and machines]]&lt;br /&gt;
* [[Device fields]]&lt;br /&gt;
* [[Universal tool|Universal tool]]&lt;br /&gt;
* [[YOLOL Chip]]&lt;br /&gt;
* [[Memory chip]]&lt;br /&gt;
&lt;br /&gt;
== Command references ==&lt;br /&gt;
&lt;br /&gt;
=== Case insensitive ===&lt;br /&gt;
&lt;br /&gt;
The programming language is fully case '''insensitive'''.&amp;lt;br&amp;gt;&lt;br /&gt;
This means that the following two example scripts function identically to each other:&lt;br /&gt;
&lt;br /&gt;
 if '''ButtonState''' == 1 then '''DoorState''' = 1 end&lt;br /&gt;
&lt;br /&gt;
 IF '''buttonstate''' == 1 THEN '''doorstate''' = 1 END&lt;br /&gt;
* Both scripts set the '''doorstate''' into 1, if '''buttonstate''' value is 1.&lt;br /&gt;
* The characters in the programming language can be written in either lowercase or uppercase letters.&lt;br /&gt;
** They are still parsed as case insensitive.&lt;br /&gt;
** This way it's possible to have the code look a bit more organized.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
* The variables in the programming language are weakly typed (don't enforce type validity), and support two data types: '''Fixed-point decimals''' (up to 0.001 precision) and '''Strings'''.&lt;br /&gt;
** To put it simply, the variables can either be introduced as strings or numbers, ignoring the earlier variable type if the previous type is not identical, without causing an error.&lt;br /&gt;
* Each variable is always of a single type, though it will be implicitly converted when required.&lt;br /&gt;
* The default value of an uninitialized variable is 0, and null values are not supported.&lt;br /&gt;
* True/False are numerical values of non-0 and 0.&lt;br /&gt;
** True =! 0&lt;br /&gt;
** False == 0&lt;br /&gt;
&lt;br /&gt;
Assigning a value to a variable always converts the variable to the newly assigned value's type.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= 128.643&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' containing a numeric value of 128.643&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= &amp;quot;Error prone&amp;quot;&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' to be a string variable &amp;quot;''Error prone''&amp;quot;, and numeric value of 128.643 is removed.&lt;br /&gt;
&lt;br /&gt;
==== Decimals ====&lt;br /&gt;
&lt;br /&gt;
Numeric values in the programming language are 64-bit fixed-point decimals.&amp;lt;br&amp;gt;&lt;br /&gt;
The variables hold decimal numbers up to three decimal accuracy.&amp;lt;br&amp;gt;&lt;br /&gt;
As a result, the maximum value range (even during operations) is [-9223372036854775.808, 9223372036854775.807]&lt;br /&gt;
&lt;br /&gt;
 pieVariable= 3.142&lt;br /&gt;
* The above script assigns a numeric value of 3.142 to the variable '''pieVariable'''.&lt;br /&gt;
** Supplying more precise values than the variables can store works, but doesn't affect the end result.&lt;br /&gt;
&lt;br /&gt;
 notPieVariable= 0.5772156649&lt;br /&gt;
* The above script attempts to assign a numeric value of 0.5772156649 to the variable '''notPieVariable'''.&lt;br /&gt;
* The end result however is notPieVariable == 0.577&lt;br /&gt;
** Here, the more precise values are cut, leaving only three decimals behind.&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
&lt;br /&gt;
To specify a string literal in the programming language, the desired string value must be surrounded with double quotation marks.&lt;br /&gt;
&lt;br /&gt;
 badRobots= &amp;quot;saltberia&amp;quot; &lt;br /&gt;
* This script assigns the string value of &amp;quot;''saltberia''&amp;quot; to the variable '''badRobots'''.&lt;br /&gt;
&lt;br /&gt;
==== Device fields / External variables ====&lt;br /&gt;
&lt;br /&gt;
External variables and device fields can be used in the programming language with the following syntax:&amp;lt;br&amp;gt;&lt;br /&gt;
* ''':variableName'''&lt;br /&gt;
**'''variableName''' being the configured device field id.&lt;br /&gt;
A colon prefix  ''':'''  is used to tell the script that an external variable is being accessed, instead of using one that may or may not be declared or used in the script.&amp;lt;br&amp;gt;&lt;br /&gt;
A programmable [[YOLOL Chip|chip]] that is connected to a [[Devices and machines|device]] has access to all the devices in the same [[Data networks|network]].&amp;lt;br&amp;gt;&lt;br /&gt;
It can then modify and listen to any device fields it has access to.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if ''':ButtonState''' == 1 then ''':DoorState''' = 1 end&lt;br /&gt;
* The script above will send the value of 1 to any devices listening to the device field '''DoorState''' if the value of '''ButtonState''' is 1 in the data network.&lt;br /&gt;
&lt;br /&gt;
== Operators and commands ==&lt;br /&gt;
&lt;br /&gt;
Note that the available operators may be limited by the type of the programmable [[YOLOL Chip|chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Basic chips have a limited selection of functions while more advanced ones can perform more complex operations natively.&lt;br /&gt;
&lt;br /&gt;
=== Basic arithmetic and assignment operators ===&lt;br /&gt;
=== Basic arithmetic and assignment ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation || Chip availability&lt;br /&gt;
|-&lt;br /&gt;
| A + B || Addition || String A is appended by String B. || All&lt;br /&gt;
|-&lt;br /&gt;
| A - B || Subtraction || The last appearance of String B in String A is removed from String A. || All&lt;br /&gt;
|-&lt;br /&gt;
| A * B || Multiplication || Runtime error. The rest of the line is skipped. || All&lt;br /&gt;
|-&lt;br /&gt;
| A / B || Division || Runtime error. The rest of the line is skipped. || All&lt;br /&gt;
|-&lt;br /&gt;
| A ++ || PostIncrement (A=A+1) || Appends a space to String A. Evaluates to the original value. || All&lt;br /&gt;
|-&lt;br /&gt;
| A -- || PostDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the original value. || All&lt;br /&gt;
|-&lt;br /&gt;
| ++ A  || PreIncrement (A=A+1) || Appends a space to String A. Evaluates to the modified value. || All&lt;br /&gt;
|-&lt;br /&gt;
| -- A || PreDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the modified value. || All&lt;br /&gt;
|-&lt;br /&gt;
| A = B || Assignment (Variable A is set to the value of variable B) || Assignment || All&lt;br /&gt;
|-&lt;br /&gt;
| A += B || Addition-assignment (A=A+B) || A is assigned the value of string-operation A+B || All&lt;br /&gt;
|-&lt;br /&gt;
| A -= B || Subtraction-assignment (A=A-B) || A is assigned the value of string-operation A-B || All&lt;br /&gt;
|-&lt;br /&gt;
| A *= B || Multiplication-assignment (A=A*B) || Runtime error. The rest of the line is skipped. || All&lt;br /&gt;
|-&lt;br /&gt;
| A /= B || Division-assignment (A=A/B) || Runtime error. The rest of the line is skipped. || All&lt;br /&gt;
|-&lt;br /&gt;
| A %= B || Modulo-assignment (A=A%B) || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| A ^ B || Exponentiation || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| A % B || Modulo || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| ABS A || Modulus (absol value) (A=A if A&amp;gt;=0, else A=-A) || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| A! || Factorial || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| SQRT A || Square root of A || Runtime error. The rest of the line is skipped. || Advanced, Professional&lt;br /&gt;
|-&lt;br /&gt;
| SIN A || Sine of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|-&lt;br /&gt;
| COS A || Cosine of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|-&lt;br /&gt;
| TAN A || Tangent of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|-&lt;br /&gt;
| ASIN A || Inverse sine of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|-&lt;br /&gt;
| ACOS A || Inverse cosine of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|-&lt;br /&gt;
| ATAN A || Inverse tangent of A (degrees) || Runtime error. The rest of the line is skipped. || Professional&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
Logical operators are checks that identify if the statement is true or false.&amp;lt;br&amp;gt;&lt;br /&gt;
All logical operations return either '''&amp;quot;0 for False&amp;quot;''' or '''&amp;quot;1 for True&amp;quot;'''. &lt;br /&gt;
The '''NOT''', '''AND''', and '''OR''' keywords consider 0 to be falsy and anything not 0 to be truthy.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation || Chip availability&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt; B || Less than || returns 1 if String A is first in alphabetical order, returns 0 if not. || All&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt; B || Greater than || returns 0 if String A is first in alphabetical order, returns 1 if not. || All&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;= B ||Less than or equal to || returns 1 if String A is first in alphabetical order or identical to String B, returns 0 if not. || All&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt;= B || Greater than or equal to || returns 0 if String A is first in alphabetical order or identical to String B, returns 1 if not. || All&lt;br /&gt;
|-&lt;br /&gt;
| A != B || Not equal to || returns 1 if String A is not equal to String B, 0 if it is. || All&lt;br /&gt;
|-&lt;br /&gt;
| A == B || Equal to || returns 1 if String A is equal to String B, 0 if not. || All&lt;br /&gt;
|-&lt;br /&gt;
| NOT A || Not || Returns 1 if A is 0, otherwise returns 0. || All&lt;br /&gt;
|-&lt;br /&gt;
| A AND B || And || Returns 1 if neither A nor B are 0, otherwise returns 0. || All&lt;br /&gt;
|-&lt;br /&gt;
| A OR B || Or || Returns 1 if either A or B is not 0, otherwise returns 0. || All&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Mixing variable types in operations ===&lt;br /&gt;
&lt;br /&gt;
Mixing variable types in an operation handles the operation using all parameters as ''strings''.&lt;br /&gt;
&lt;br /&gt;
 previouslyNumber= &amp;quot;10&amp;quot; + 15&lt;br /&gt;
* The above script results in '''previouslyNumber''' containing the string value &amp;quot;1015&amp;quot;.&lt;br /&gt;
** Note that the involved parameters themselves don't change types, their values are just cast as strings for the purpose of the operation:&lt;br /&gt;
 &lt;br /&gt;
 purelyNumber = 15&lt;br /&gt;
 purelyString = &amp;quot;10&amp;quot; + purelyNumber&lt;br /&gt;
* When this script has executed, '''purelyString''' contains the string value of &amp;quot;1015&amp;quot;, while '''purelyNumber''' still contains the numeric value of 15.&lt;br /&gt;
&lt;br /&gt;
=== Goto ===&lt;br /&gt;
&lt;br /&gt;
Goto syntax is used when the normal script reading order from 1-&amp;gt;20 is not desired, or needs to be altered.&lt;br /&gt;
&lt;br /&gt;
Goto is used with the following syntax:&lt;br /&gt;
*'''goto lineNumber'''&lt;br /&gt;
** lineNumber is the line which this command will take the script execution.&amp;lt;br&amp;gt;&lt;br /&gt;
** Any remaining script that is on the same line after the goto-command will not be executed.&lt;br /&gt;
*** using if statements before goto ignores goto syntax, assuming the if-statement is false&lt;br /&gt;
** Multiple goto commands can be added on the same line using conditionals, as '''False''' goto commands are skipped.&lt;br /&gt;
** Numeric values outside the [1,20] range are clamped to this range.&lt;br /&gt;
** Non-integer values are floored.&lt;br /&gt;
** String values will result in a Runtime Error.&lt;br /&gt;
&lt;br /&gt;
 if variable == 5 then '''goto 4''' end '''goto 6'''&lt;br /&gt;
&lt;br /&gt;
The script above will go to line number 4, if '''variable''' has a value of 5.&amp;lt;br&amp;gt;&lt;br /&gt;
Otherwise it will go to line number 6. Numerical operations can also be done &amp;quot;inside&amp;quot; the goto, e.g. &lt;br /&gt;
&lt;br /&gt;
  goto 4+1&lt;br /&gt;
&lt;br /&gt;
=== If-else conditional ===&lt;br /&gt;
&lt;br /&gt;
If-else statements are used to branch out the script into different paths.&amp;lt;br&amp;gt;&lt;br /&gt;
They use the following syntax:&lt;br /&gt;
* '''if ''condition'' then ''statement'' else ''statement'' end'''&lt;br /&gt;
** Condition is a statement that results in a numeric value (where 0 is parsed as False, anything else as True), and statements are pieces of script that are run.&lt;br /&gt;
** All If-else conditional stations must have '''end''' syntax written after statement is complete.&lt;br /&gt;
&lt;br /&gt;
If can be used to branch script execution into two possible outcomes temporarily based on variable value(s).&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable != 2 '''then''' endResult = 3 '''else''' endResult = 4 '''end'''&lt;br /&gt;
&lt;br /&gt;
* This script sets the value of '''endResult''' to 3 if '''variable''' does not have the value of 2.&lt;br /&gt;
* If '''variable''''s value is 2, '''endResult''' is set to the value of 4.&lt;br /&gt;
&lt;br /&gt;
Note that the else statement -part can be left out if not needed.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable != 2 '''then''' endResult = 3 '''end'''&lt;br /&gt;
*This script only sets the value of 3 to '''endResult''' if '''variable''' does not have a value of 2, and doesn't do anything else.&lt;br /&gt;
&lt;br /&gt;
==== Nesting if statements ====&lt;br /&gt;
&lt;br /&gt;
It is possible to place if-conditionals inside the true/false statement blocks to achieve further branching of execution.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' endResult = 1 '''else''' '''if''' variable == 1 '''then''' endResult = 2 '''end end''' &lt;br /&gt;
* This script sets '''endResult''' to 1 if '''variable''' equals 0.&lt;br /&gt;
* If '''variable''' doesn't equal 0, but it equals 1, '''endResult''' is set to 2.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' '''if''' endResult == 1 '''then''' endResult = 2 '''end''' '''else''' endResult = 1 '''end'''&lt;br /&gt;
* This script sets '''endResult''' to 2 if '''variable''' has a value of 0, and '''endResult''' equals to 1.&lt;br /&gt;
* Otherwise it sets '''endResult''' to 1.&lt;br /&gt;
&lt;br /&gt;
Note that it may be easier to plan and debug the script flow by formatting the script containing nested if-statements to a neater indented form.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note: writing the script like this won't work on the [[YOLOL Chip|chip]], but doing this can still be useful when debugging scripts.'''&lt;br /&gt;
&lt;br /&gt;
This is the second nested example formatted:&lt;br /&gt;
&lt;br /&gt;
 '''if''' variable == 0 '''then'''&lt;br /&gt;
     '''if''' otherVariable == 1 '''then'''&lt;br /&gt;
         otherVariable = 2&lt;br /&gt;
     '''end'''&lt;br /&gt;
 '''else'''&lt;br /&gt;
     otherVariable = 1&lt;br /&gt;
 '''end'''&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are useful when writing code that is used by a lot of programmers.&amp;lt;br&amp;gt;&lt;br /&gt;
Note that comments also use up space from the pre-determined 70 character line limit and are not excluded from it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commenting is used with the following syntax:&lt;br /&gt;
*// '''text'''&lt;br /&gt;
** Text can be any single-line set of characters.&lt;br /&gt;
&lt;br /&gt;
 '''//''' This is a comment. It will explain how other lines of script work.&lt;br /&gt;
* An example of a possible comment syntax&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
There are two types of errors that can happen with the programming language.&lt;br /&gt;
# Syntax errors&lt;br /&gt;
# Runtime errors&lt;br /&gt;
&lt;br /&gt;
* Syntax errors come from invalid and unparseable script and will result in the whole line not being executed.&lt;br /&gt;
* Runtime errors are only catchable while the script is being executed. They result in the execution of the line being interrupted, but any effects until the error will remain.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networks|YOLOL]]&lt;/div&gt;</summary>
		<author><name>Azurethi</name></author>
	</entry>
</feed>