How does Lightbot teach programming?

In Lightbot, players program a robot using icons.

But... does that mean players are learning 'real' programming?*

*Spoiler: Yes

Programming, or Coding, is simply the way people tell a computer what to do using instructions that the computer understands.

Let's explore what this means by looking at the commands used in Lightbot. Imagine Lightbot understood words instead of icons. The new 'language' could look like the following:


LANGUAGE


forward()

turnLeft()

turnRight()

jump()

light()


Now, we can translate the programs in Lightbot into our new language.

Example

becomes
main:
forward()
forward()
light()


The instructions are the same, just now we're using words instead of icons.

*There are also some funky characters there too, like (), that are required in this new language. They are simply an indicator to Lightbot to perform each word command.

As long as both the player and Lightbot understand what each word means, we can write any program in Lightbot with words.


Try it Yourself

Using the language provided at the top of the page, fill in the ?'s

* Make sure to include the () at the end of each line!



becomes
main:
?????????
?????????
?????????



What about the following?


Try it Yourself

Using the language provided at the top of the page, fill in the ???'s

* Make sure to include a () at the end of each line!



becomes
main:
?????????
?????????
?????????
?????????


This word language isn't really all that different, is it?

How about procedures? Let's give them a language 'specification' too.



PROCEDURES


proc1()

proc2()



The only new thing is that we'll have to write procedure code in a proc: section.

Example






becomes
main:
forward()
proc1()
proc1()

proc1:
jump()
jump()
light()



Now, you can write the equivalent of any program in Lightbot with words!



Try it Yourself

Using the language provided, fill in the ?'s

* There are multiple lines for each ?

** Make sure to include a () at the end of each line!



... becomes ...


main:
?

proc1:
?


Let's look at our definition again:

Programming, or Coding, is simply the way people tell a computer what to do using instructions that the computer understands.

Whether the instructions are icons or words, you are actually programming when you are playing Lightbot!

If you like, you can now translate any of the icon programs created in Lightbot to this word language.


Good luck in your future coding endeavours!

You can now go on and learn another programming language that can tell a computer to do other, more complex and cool things. You can apply the knowledge of what programming is and how things like Commands, Procedures and Loops work.

A great beginner language to try next is Javascript!






Bonus

Lightbot teaches a few specific coding constructs as well, common to many programming languages. The technical terms for those are:

Sequential Control Flow: Commands get executed one after the other.

Procedures: Blocks of code for taking advantage of re-usable patterns.

Loops: Blocks of code specifically used for patterns that repeat, or 'loop'.

Debugging: Running and re-running a program, testing solutions, fixing mistakes.