/Code-Railway

Teaching 3-4yo kids basic programming skills using trains (especially Duplo)

OtherNOASSERTION

Code-Railway

Teaching 3-4yo kids basic programming skills using trains (especially Duplo) - an idea I had while playing with my kid

(English is not my native language, so please excuse the grammar for now)

Although this is using Duplo tracks, trains and bricks, it goes way beyond what LEGO's "Coding Express" is doing and it's not limited to LEGO products.

  • The tracks are the program flow. You can use tracks and switches to form control structures (if-then, if-then-else, while, do-while, for).

  • Operations happen on tracks (flow control, stop, start) or in the stations (variable assignments, add/remove items from a list, sort lists, etc).

  • Train cars can be (1) data holders (variables, constants) or (2) functions:

  1. The content of the train car is the value (fixed for constants and variable for... variables). Values can be booleans (e.g. if a car has 0 or 1 passengers/goods), integers (the actual number of passengers/goods or the number written on a brick), chars (bricks with letters), lists/arrays/strings/sets (multiple number/letter bricks).

  2. There is a special type of train car that holds multiple instructions (action bricks, or, on a more abstract level, minifigures that can perform certain tasks on/with data). These train cars are actually functions and these can be executed on the track (in the case of action bricks) or in the station (with people from the "function" car manipulating the data from the "variable/constant" cars.

Example control structures

Green is "in" and yellow is "out".

Example control structures

...to be continued. Please feel free to participate.