WEEK 4

OFFLINE ALGORITHMIC THINKING!

OFFLINE ALGORITHMIC THINKING!

In class we paired up and created a set of rules whilst playing with a set of die. One die was six-sided, the other twelve. Using the die we had to create an algorithm to place various shapes on a grid based on the number the die rolled.

Claire and I had an incredibly complicated algorithm that made it very difficult to work out where the shapes would go mathematically, let alone how to do this in coding form. There was also a clear algorithmic preference to stay in a single corner.

pic1
pic2

pic2

crazy 8s 2

WEEK 4

OFFLINE ALGORITHMIC THINKING!

For the second half of our algorithmic thinking, we transferred our algorithm into code. For Claire and I this meant we had to simplify our algorithm. Using circles only we can see on the gif below that the algorithm displayed a clear preference for the upper left corner. We made it so that the closer the circles were, the smaller they would become, and the further away, the larger.

It was increrdibly interesting to see our algorithm play out (much faster than we could have done it in our heads) on a screen! Using a colour picker and rgb values I changed the colour palette to be more muted in both blue and purple.

pic1

WEEK 4

LET'S GO!

Prior to beginning our dice algorithm, we were introduced to the coding language p5. This included learning basic code such as how to change colour, opacity, and create shapes (as seen above!)

Below are some coding examples, including a mix of our dice algorithm code and our shape creation code in which, when clicked, a circle will appear with a line pointing back to the top left corner, similarly to the algorithm, the further away from the corner the bigger the circle becomes.

The opacity on the background changes so that the circles slowly fade away over time.

pic2

pic2