Hello! Welcome Back!
If You want to do this, then go to:
You May Need To Make a Khan Account First.
Step 1: Making A New Program:
First, Click Subjects and a Drop Down Bar Comes Down Holding Lots Of Things! Hover Over Computing and Click: Computer Programming.
Now you will end up in another place and that has lots of buttons.
- Create: This holds three more buttons which are New program, New Webpage & New SQL Script
- Browse Projects: This Lets you see lots of other programs made by other coders.
- My Projects: This lets you see all of the projects you made.
- Help Requests: Want To Help Someone? Then head over here and find ones you’d like to help with.
- Project Evaluations: Want to grade someones project? come over here and find lots of cool projects. once you did this once you are now a TEACHER! *just kidding*
- Community Questions: talk with lots of other people by asking questions in a tutorial!
- Tutorials: don’t prefer this? head over there instead and make me cry. although it doesn’t really matter. you can watch videos on how to code.
For This Tutorial, Click New Program Under Create or Just Click Create.
You Can Edit The Title Name.
Heres what you can do at this page:
- Rename The Title
- Save Your Program
- Restart Your Program (this doesn’t appear unless you have a draw function. we will talk about those later.)
- Computer Programming: Go Back to the page you were just on.
Step 2: Drawing Rectangles:
What Are We Waiting For!
First Type In:
Now You Should See… A Square. But how did we make that?
Well… this is a command called rect which makes rectangles or squares
and there are 4 parameters which holds the values:
- x: the left and right position of the rectangle
- y: the up and down position of the rectangle
- width: the width of the rectangle
- height you guessed it! the height of the rectangle
now try messing with the values of the rectangle.
maybe you could try adding more rectangles.
What Can You Create with rectangles?
If you want to make that above, follow the code below.
Did you do it? i am going to name him boxy.
Step 3: Adding More Shapes:
are you bored of rectangles? try ovals and circles by doing this command:
it makes a circle at 50 x 50 y and 50 wide and 50 high.
circles are very similar to rectangles.
WARNING WARNING WARNING WARNING WARNING WARNING!!!!
Circles are centered, don’t believe me? make the same circle you typed or a new one at 0 x and 0 y and any width or height.
or you can make a triangle by using this command.
or you can say it as:
triangle( vertice 1 x, vertice 1 y, vertice 2 x, vertice 2 y, vertice 3 x, vertice 3 y);
show me your works of art like boxy!
Step 4: Errors:
In a while a guy named Oh Noes will come up on your screen and say whats wrong like if you are missing a semicolon (those are very important) and if you are missing a bit of code. i can show you what he looks like:
tell me if hes cute in the comments 😀
say if you type in: elliipse(5050,50,50;
he will say:
- It looks like you are missing a ) – does every ( have a corresponding closing )?
- elliipse is not defined. Maybe you meant to type ellipse, or you’re using a variable you didn’t define
Thats what he will say and if you want to fix it just type in: ellipse(50,50,50,50); he said something about variables in his second question, which we will talk about those on the next post.
Keep Calm and code on!
you can do it too minecrafters! there are also arcs, quads, beizers and even better, you can make your own shape!
See You Next Time!
P.S: I Am “The 1# Planet Proponent” or “T1#PP” for short.