Coding with Microbit

This week, I decided to try out a different program called microbit. Although it is similar to scratch, it has the benefit of being able to switch to javascript which shows the actual coding that is happening. This feature helps me to understand the relationship between the blocks and the written code. 

Similar to the module that we completely last week on scratch, I created another game using step-by-step instructions. This was called “rock, paper scissors“. There were many other lessons to choose from to program the microbit however you want, as well as a section for educators that contains curriculum materials and resources to teach students. 

For the most part, the instructions to the lesson were easy to follow. However, because it was not the most descriptive and mainly showed where to put the blocks through pictures, it took me some time to find which blocks to use. There was one section where I had to create a new block that wasn’t already provided for me, so I spent a while trying to figure this out as the instructions did not state to do this. Overall, I had fun with this program and it’s a great way for students to use their creativity and develop skills in coding to make different games and animations. Click here to watch a video of us playing the game we created!

Password: microbit

Advertisements

Scratch.com

This week we worked more in depth with scratch.mit.com to create a game. I discovered modules that can be dowloaded with checklists for how to create lots of different games. I started with the basic backdrop and the uncoded “sprite,” which is the character that can be coded.

From there, I followed the instructions for what codes should go where. It goes some-what in depth to outline what the code will do. I thought this was a great way to learn more about coding instead of self-discovery because I could see more advanced, multi-step codes and understand how it works. For Example, to add a timer to the side I needed the block “wait 0.1 sec” above the “go up by 0.1.” If the waiting block was not there the time went up significantly faster by 0.1 because it was not waiting 0.1 seconds like normal time would. The game I worked on consists of a boat that travels along the water wherever you move your mouse. The goal is to bring the boat to the island without hitting the wooden structure. It was cool to see the changes that were being made to the game just by adding more steps and controls to the code.

Although the instructions that were given for the module were clear and easy to follow, they seemed to be missing key points and I ran into some complications half-way through when creating a “hit” boat. When the boat goes through the obstacle and hits a wooden structure, it should break into pieces. I created a second boat and gave it a “broken” appearance, however it did not work when we hit the wooden structure. The instructions for this part were vague and so I were unsure whether or not to add controls for the “normal” boat as well as the “broken” boat. After much time and thought, I thought it was best to move on and add more features to the game.

Some of these features I added include a timer to keep track of how long it takes to move the boat to the island, speed bumps to give the boat a bit of a boost, and seaweed to make the boat spin around. Adding these features made the game more fun and complex.

Overall, completing this module was a great learning experience and a lot of fun!! Not only did we learn more in depth about coding patterns but we also had to use our problem solving skills.

All photographs in this post are licensed by Creative Commons

Coding Board Game for Students

https://www.gamingrules.co.uk/2016/02/08/robot-turtles-review/

This past week I found an amazing resource to have in the classroom to help students learn coding. Robot Turtles is a game where students have to use code cards to direct a robot turtle to the centre of the board to receive a jewel. Once this is done the board becomes more challenging by adding obstacles. Students learn coding patterns and sequences by moving their robot forwards, left, or right on the board and around certain obstacles. If they notice a mistake they simply have to say “bug” and the last code card is removed and thus the command given is reversed.

This game is ideal for younger grades, even preschool aged children are encouraged to play. However, any age can play this game as it is a fantastic and engaging way to learn the basics of coding. This game is great because kids will have fun playing it and not even realize that they are learning the fundamentals of programming and coding.

This game is good for learning coding because the adult acts as a real life computer while the student is the programmer. This helps students because it is a good simulation of how real coding works. Students give direct instructions to the adult and the adult does whatever they say, much like how programming is about “bossing” around computers. Click here for the full instructions of the game.

Coding: True and False

Coding in its simplest form can be broken down into 1’s and 0’s. A 1 means it is TRUE and a 0 means it is FALSE. One thing to always keep in mind is that if something is not true then it is false. This system is called Boolean algebra.

When coding it is important to remember that computers have no intuition, so you must state everything and be very specific.

Below is some statements of true and false. It is similar to basic algebra where is you multiply a negative with a negative you get a positive and if you multiply a negative with a positive you get a negative. We are using “!” as the meaning NOT. So if…

  • (!(True)) = False –> Not true (-) x True (+) = –
  • (!(False)) = True –> Not true (-) x False (-) = +

*When working with loops it must always be true to work.

Truth Tables show the outcomes when you combine 2 different coding expressions using “and”, “or”, and “and or”. For example, if the first statement is true OR the second statement is false than the overall statement is true. If the first statement is true AND the second statement is false than the statement must be false, this is because the statement cannot be true if one is true and the other is false. If the first statement is true AND OR the second statement is false than the statement is true. The “and or” table combines the “or” and the “and” so all possibilities are true and will run with the only exception of if both are false.

“OR” Table

A StatementB StatementTrue
TRUEFALSEYES
TRUETRUENO
FALSETRUEYES
FALSEFALSENO

“And” Table

A StatementB StatementTrue
TRUEFALSEFALSE
TRUETRUETRUE
FALSETRUEFALSE
FALSEFALSE*FALSE

“And” “OR” Table

A StatementB StatementTrue
TRUEFALSETRUE
TRUETRUETRUE
FALSETRUETRUE
FALSEFALSEFALSE

RESOURCES USED

Coding 101

I’ve decided to do Coding as my Tech Inquiry project because I see the increasing value in the role technology has in our society and in our classrooms. It is no longer acceptable to just be tech competent, students must learn to be tech fluent. To help me along in this process I have recruited a friend of mine, a 3rd year engineer student at UVIC who has experience in coding, mainly C++.

In this first week I focused on the basic terminology and concepts. I learned that in a coding sense, algorithms are a series of patterns. My friend used an analogy that helped me better understand this. He said, “when you take a shower, what order do you do things in.” I also learned that there were different types of coding languages that they are used for different things.

PROGRAMMING LANGUAGES

  • Java: used for servers
  • Javascript: used for online
  • C++: used for every interface but more complex. Term that defines this language is “Verbose” which means there is more writing involved to do simple tasks
  • Blocky: used to see basic, visual language. Once mastered the user can move onto harder languages
  • Python: used for game development and newer software

I started my coding experience off by using a very simple interface called “Scratch.” The form of coding on scratch is called blocking. This means that the codes are made into blocks that the user can manipulate into doing what they want the program to do. I found this site easy to use because the shape of the codes matches where they can be inputed and all the blocks are colour coated. Although the user can’t see the actual codes, I found this blocking website was an excellent first step to learning the basic logic behind coding, which is highly transferable to other coding languages and platforms. With scratch.mit.edu I was able to learn and practice first hand producing algorithms. I practiced different types of loops and got to learn the ways in which they are used. This included the if, for, and while loops. I also learned about a “nested loop” which means that it is a loop in another loop.

LOOPS

  • If: “If (blank) happens then (blank)”
  • For: (repeat block)
  • While: (repeat until block)
  • Nested: It is used for multiple responses.

Here are some photos of what the interface looks like. While learning how to program I ran into an error where it copied my polar bear and my first challenge became how to delete them….

RESOURCES USED