Santa’s been playing too much Angry Birds…

Santa's been playing too much Angry Birds

On Saturday the Scratch and Advanced Scratch were merged into one.  It worked out well as most of the people that were new to Scratch in September are ready for the more advanced stuff anyway.
We continued working on the Santa “Gift Toss” programme – getting into the code that will throw the present.

We should be able to finish it at our next session on the 14th December – the last one before Christmas.

More Sorting! This time insertion sort…

To cut a long story short Insertion Sort works along the list sorting as it goes. At each position, it checks the value there against the largest value that it knows in the sorted list (which happens to be next to it, that is the previous position checked). If this number is larger, it leaves the number in place and moves to the next. If smaller, it finds the correct position within the sorted list, shifts all the larger values up to make a space, and “inserts” into that correct position.

But as a picture says a thousand words – take a look at this gif for insertion sort in action…

Insertion-sort-example

Advanced Scratch: Bubble Sort

In Saturday’s Scratch class we tacked Bubble Sort.  See http://www.youtube.com/watch?v=BMZ6MF_l3vw for a quick introduction to how it works.

Coders were also introduced to pseudocode (even though they may not know it), an informal language independent text-based way programmers use to describe algorithms.

There were two parts to the algorithm, firstly generate a list of 10 random numbers between 1 and 100 then sort those numbers from lowest to highest using Bubble Sort.

What language should you learn?

Zach at Codecademy <contact@codecademy.com> has written a useful post on what language is best for what —

People often ask me what programming language they should learn, and I always say the same thing: “It depends.”

Want to be more web savvy, or build a website? — start with Web Fundamentals. This covers all the basic HTML and CSS you’ll need to know to understand the web.

Want to make a game or app? — give JavaScript a try. This dynamic language will let you create interactive apps that you can use on a smartphone.

Want to process data or explore databases?Ruby or Python are your best bet.

That’s it! Like what you’re learning now? Click here to continue learning.

— Zach

SCRATCH – Week 1

scratchWe had a packed house at our first week of Scratch which put a little pressure on the availability of the computers and also the mentors!

Here are a number of links to the Scratch download and a couple of the game turorials that we got to:

We’ll be covering these games in more detail at the next sessions and also we’ll be doing a longer game called “Escape the room”.

If anyone has a laptop at home that they could bring to the next Dojo it would help free up a space for someone that doesn’t have one.

How many sides?

Inspired by the robots demonstration last week where we saw a robot draw a triangle using a Scratch program we thought we’d have a go at the code.

What if we were to interact with a shape-drawing-robot and tell it what to draw by answering the simple question “How many sides?”

We didn’t get a chance to finish it off so I’ve copied my version onto the Scratch site.

http://scratch.mit.edu/projects/10943044/

Sprites – are you ready for a new challenge?

We going to build a naughts and crosses game over a couple of weeks with the computer as a player! This week we’ll create a sprite which changes to X or O depending on who’s turn it is. Then next we’ll build the 3×3 grid that two humans can play. Next, we will have the computer determine if there is a winner and with any luck we will introduce our first simple computer player.

For the next couple of weeks we’ll have a go at building a naughts and crosses game with the computer as a player!  This week we’ll create a sprite which changes to X or O depending on who’s turn it is.  Then next we’ll build the 3×3 grid that two humans can play.  Next, we will have the computer determine if there is a winner and with any luck we will introduce our first simple computer player.

There are as usual loads of examples on the Scratch site if you want a sneak peak http://scratch.mit.edu/tags/view/tic-tac-toe.

What is Scratch?

Scratch is a programming language that makes it easy to create your own interactive stories, animations, games, music, and art — and share your creations on the web.

As young people create and share Scratch projects, they learn important mathematical and computational ideas, while also learning to think creatively, reason systematically, and work collaboratively.

Download Scratch for free from http://info.scratch.mit.edu/.