Showing posts with label scratch. Show all posts
Showing posts with label scratch. Show all posts

Sunday, 11 December 2016

Thomas's Tangle updated - plugged and unplugged


This simplifies the algorithm Thomas' Tangles (named after my son who helped develop it) in Chapter 3 of the book discussed in http://compuationalthinking.blogspot.co.uk/2016/11/how-to-be-unplugged-artist.html

Using crayons, pencils or pens, we are going to follow an algorithm to create a random drawing. This could be done in pairs and you will need squared paper.

Person A: Rolls the dice and reads out the instructions - their role is to roll the dice, interpret the algorithm and tell the 'robot' what to do.
Person B: Is the ‘robot carrying out the instructions'. The lines are solid blocks of colour so move four squares does also mean colour in the squares between the start and finish in the direction of movement.

IMG_0226.JPG


When a new central square is needed the roles of A and B swap (so A is the ‘robot’ and B rolls the dice and reads out the instruction). The roles keep swapping.


Algorithm

Start from a random square – call it the centre square
Repeat until end of game
If die roll = 1
Roll die for number of moves
move die roll number of steps up the page
If die roll = 2
Roll die for number of moves
move die roll number of steps down the page
If die roll = 3
Roll die for number of moves
move die roll number of steps to the left
If die roll = 4
Roll die for number of moves
move die roll number of steps to the right
If die roll = 5
Roll die
If die = 1 change colour to Red
If die = 2 change colour to Blue
If die = 3 change colour to Black
If die = 4 change colour to Green
If die = 5 change colour to Orange
If die = 6 change colour to Yellow
If die roll = 6
Roll die
Return to current centre square
If the second die roll=6
randomly select new centre square
if block is off the page
randomly select new centre square

The Scratch version can be here https://scratch.mit.edu/projects/135816631/  if you wish to see the code or by clicking below to play it.





All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Monday, 28 November 2016

Training a Neuron using Scratch

In a previous post http://compuationalthinking.blogspot.co.uk/2016/11/artificial-neuron-in-scratch.html I used Scratch to build a working artificial neuron.

In this post, the training of a neuron all written in Scratch is tackled. The video shows it action and you can have a go at using the software yourself at the end of the post. The Scratch code can be found at https://scratch.mit.edu/projects/132915502/




All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Tuesday, 22 November 2016

Artificial Neuron in Scratch




Instructions:

  • Set the inputs by pressing the buttons marked input 1 and input 2 (Red is off(False or 0) and Green is on(True or 1))
  • Change the weights by changing weights 1 to 3, wx goes with input x and weight 3 is the bias.
  • To activate the neuron you need to click on the the yellow ball ('the neuron').




The video below show it in action and explains the code.



All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Monday, 30 May 2016

10 lines of code challenge - my examples

The 10 lines of code initiative is a challenge to write code with only ten lines of code to encourage efficient coding, whilst still having fun - the choice of language is up to you. The video from amazingict.co.uk outlines the idea:






Here are a three simple Scratch projects only using 10 lines of code - very happy for someone to take and  improve them, especially if you comment and share your results. Click on the Green Flags below to see them in action.


 
The code is available at https://scratch.mit.edu/projects/111834277/



 
The code is available at https://scratch.mit.edu/projects/110952076/




 
The code is available at https://scratch.mit.edu/projects/111835204/



All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Saturday, 12 March 2016

3 'Art' Scratch Projects





Grid painting - Simple system that allows images made up on 8 x 8 grid. Click on the Green flag to start. For the code go to: https://scratch.mit.edu/projects/101415120/


Whirleygig 1 - straight random lines. Click on the Green flag to start. Foe the code go to: https://scratch.mit.edu/projects/99053538/


Whirleygig 2 - random lines. Click on the Green flag to start. For the code go to: https://scratch.mit.edu/projects/100924783/



The last two are loosely based on the idea of Generative Art. A good book, in my view, on this is available from Amazon at Generative Art


 All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Tuesday, 8 March 2016

Random picture Generator using Scratch

This short post is about a simple idea that was turn into a Scratch solution. I had developed a computational thinking based paper game with my son around following an algorithm to draw lines randomly using dice to select direction and length of the line.

Here is a Scratch program to do something similar. It is random in three ways
- The time taken is random.
- The direction is selected randomly
- the length of the line is selected randomly

To run it just press the green flag.



Go to https://scratch.mit.edu/projects/99053538/ for more details.

Go to https://scratch.mit.edu/projects/100957552/ for more details.



Go to https://scratch.mit.edu/projects/100924783/ for more details.


Go to https://scratch.mit.edu/projects/101630166/ for more details.

All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Friday, 9 January 2015

Raspberry Pi Junkbot - Home

Raspberry Pi Junkbot - Home: A new website providing more information of the Raspberry Pi Junkbot project (combining Raspberry Pi, Scratch programming and junk). This will be added to as the  project develops.





At the moment it includes

- Introduction

-Discussion about the robot controller card

-ScratchGPIO

- Example of the drawing bot.



All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Answers not on the Screen

  2.  The answers not on the screen Hill, G. ,  Turner, S. J.  and  Childs, K.  (2017)  Abstract:  Reflection from two areas on the issues...