Welcome to the Joy of Programming!
In this course we are going to learn programming by writing programs to create interesting shapes and patterns.
We'll be using Python programming language for this course along with a library Joy, which is already included in the course environment.
Let's get a taste of Joy by writing our first program.
c = circle()
show(c)
When you run the program you'll see a circle at the center of a canvas.
In the above example, circle
is function that creates a circle shape
and show
is a function that takes a shape and draws it on the screen.
The function circle
is provide by the Joy
library. It has many
other functions for various shapes and doing some operations on them,
which you'll see in the upcoming lessons.
Here is a small exercise for you.
Just like circle
function creates a circle shape,
the rectangle
function creates a rectangle. Change
the program in the editor below to show a rectangle
instead of circle.
One interesting part of this Mon.School platform is the functioanality to create your own sketches by writing programs. You can see recent sketches drawn by the students on the home page or on the Sketches page linked from the top navigation bar.
Please go to Sketches and create a new sketch to draw a circle or a rectangle.
We'll see how to draw more shapes and patterns in the upcoming lessons.
hi