User Tools

Site Tools


examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
examples [2020/02/15 23:25]
adminz
examples [2020/02/21 09:23] (current)
jtwine
Line 2: Line 2:
  
 ===== Hello World! ===== ===== Hello World! =====
-Well, no introduction to any programming language would be complete without the traditional and ubiquitous **Hello World!** example. ​ So, here 'ya go!+Well, no introduction to any programming ​(or scripting) ​language would be complete without the traditional and ubiquitous **Hello World!** example.  The basic unit of code in 10LC is called a **Program**. ​ You can have multiple programs in a single file, if you wish.  Programs are //opened// via the ''​Program''​ statement, and //closed// with the ''​EndProgram''​ statement.  So, here 'ya go!  First
  
-<​code>​+<​code ​c>
 Program HelloWorld; Program HelloWorld;
     Display "# - Hello World - ";     Display "# - Hello World - ";
 +EndProgram;
 </​code>​ </​code>​
  
Line 13: Line 14:
  
 ==== Basic Loops ==== ==== Basic Loops ====
-Loops in 10LC are constructed using Labels, Goto statements, and If statements. ​ For example, here is the implementation of a simple delay loop:+Loops in 10LC are constructed using Labels, ​''​Goto'' ​statements, and ''​If'' ​statements. ​ For example, here is the implementation of a simple delay loop:
  
 <code c> <code c>
Line 19: Line 20:
     --RegF; ​                     // Decrement Delay Counter     --RegF; ​                     // Decrement Delay Counter
     If RegF > 0 Goto Delay; ​     // If Greater Than Zero, Go Back To Start Of Loop     If RegF > 0 Goto Delay; ​     // If Greater Than Zero, Go Back To Start Of Loop
 +// End
 </​code>​ </​code>​
  
  
examples.1581830757.txt.gz ยท Last modified: 2020/02/15 23:25 by adminz