pm21-dragon/lectures/lecture-01/2 - Deconstructing blockly.ipynb
Andrew Straw a254b5cb90 lecture 1
2024-10-18 09:44:25 +02:00

1.8 KiB

None <html> <head> </head>

Blockly deconstructed

Consider this blockly program.

blockly-bird

This is actually a full computer program! When you succesfully complete it, you can see the automatic translation to Javascript. (Javascript is obviously a different programming language than Python, but the important points we can discuss anyway.)

if (noWorm()) {
  heading(0);
} else {
  heading(90);
}

if we would re-write this in Python, it would be:

if noWorm():
    heading(0)
else:
    heading(90)

Let's discuss what is going on here.

(Discussion of computer program, computer, operating system, external world.)

Consider this blockly program.

blockly

The main conceptual new thing is the use of functions.

</html>