Posts

Showing posts from February, 2018

Fractals and Coding

Image
This post is for Maths teachers who teach fractals and assumes knowledge of Fractal theory. Fractals and Recursion Recursion is a recurring function that calls or refers to itself. A function is a name given to a series of steps and is used to simplify programming by referring to or "calling" the function. https://guide.pencilcode.net/edit/functions/ For example the code below is to draw a square. The first part defines "square" as a function and tells the program what "square" means and then uses to the word "square" to draw multiple squares of different sizes and colours without the need to write all the code. square = (size) -> for y in [1..4] fd size rt 90 pen red square 80 jump 15, 15 pen firebrick square 50 https://en.wikipedia.org/wiki/Fractal A Fractal is a curve or geometrical figure, each part of which has the same statistical character as the whole. They are useful in modell