Finite State
Machines in
MakeCode
Finite State
Machines in
MakeCode
Yesterday, we talked about the concept of
finite state machines. Today, we'll implement
this concept into the MakeCode environment.
Completed
Basics of HTML & CSS
Block-based Programming
Today
Continue Microsoft MakeCode; Zookeeper Skillmap
Update your .html MakeCode Learning page
Upcoming
More HTML
More Programming
First, let's talk a bit more about the concept, but in how it related to things we've already done in MakeCode.
Next, to try to make sure you understand it, let's look at an example I've created in MakeCode. This ended up taking more time to program than I intended, so I'll walk you through how to make something else.
Now, we'll make our own. We talked about a traffic light yesterday, so that's what we'll create today.
I made a video on how to create the hungry star as an FSM, but it took longer than expected. It's here and you can check it out if you want, but I'm not expecting you to.
Follow along with my video to create an FSM of a traffic light. Use your remaining time to customize it or change things. Maybe you could make it flash yellow for caution when the a button is pressed, or flash red when the b button is pressed. Maybe you add a little car that goes by when it turns green. Maybe you make your own version of redlight greenlight where the player has to move around while its green, but if you move when its red the game ends. You can decide how to modify the program.