January 16, 2026

Weeks 17/18 - Boxes practice in Raptor

CLASS OBJECTIVE

Learn to use the DRAW_BOX() call and practice the loop programming structure, using the graph window in Raptor, by creating given images, using boxes.


INTRODUCTION

Today, you'll learn how to use the draw_box() function and create two different products, the first with some assistance and the second completely alone.    

draw_box(x1,y1,x2,y2,color,filled/unfilled)

  • x1,y1 are the coordinates for the first corner of the box. (left lower corner)

  • x2,y2  are the coordinates for the opposite corner of the box. (right upper corner)

 

For example, in a 500x500 graph windows we can use the draw_box Call like this:

draw_box(150,150,350,350,blue,1)

and the result should look like:






So far, we’ve been referring to the colors using their names, but you can also refer to them using numbers between 0 and 15. Click here to see the complete list of colors.

  • Black (0), Blue (1), Green (2), Cyan (3), Red (4), Magenta (5), Brown (6), Light_Gray (7), Dark_Gray (8), Light_Blue (9), Light_Green (10), Light_Cyan (11), Light_Red (12), Light_Magenta (13), Yellow (14), Pink (15)



FIRST PRACTICE
Read the instructions to create the next logo. Obviously you'll have to remember how to create the circles and practice the DRAW_BOX command to create the boxes.
  • File name: Green Lantern
  • Window dimensions: 400x400
  • There are 3 circles and 2 boxes so you'll use the DRAW_BOX and DRAW_CIRCLE instuctions. Find out the coordinates by your self.
  • You'll need the FLOOD_FILL instruction.






CLASS ACTIVITIES


First activity

Now, you'll have to create a program, using boxes and loops, to draw an image like the one below.

  • In order to get the center of the boxes to be the same (250,250), we’re going to set coordinates (x,y) the same values.
  • First we declare variables x and y with  a value of 25, this value is going to increase by 15 in each iteration. We are not creating x2 and y2 variables, instead we are going to set x2=500-x and y2=500-y.
  • To paint every box with a different color, we need to create a variable named color with an initial value of 0, this value will increase by 1 in each iteration.
  








Second activity

Now you'll use boxes and loops once again to create the next product, in the graph window, by your self.

Consider that the graphic window is not a square this time so its dimensions are 400 x 200.






CLASS NOTES

Write down in your notebook the title of the class, the objective and follow the instructions.

  • Draw the second and third draw_box() instructions from the Loops program in your notebook.

  • Using your own words, explain in detail the six parameters of the draw_box() functions: location, size, color, and the filled selector.


January 09, 2026

Week 16 - Raptor graphic window functions recovery

CLASS OBJECTIVE

Remember the main topics from the Second Period content, in order to be prepared for the forthcoming assessment 


SESSION 1

By this time, you should be very capable to create simple graphic algorithms in Raptor. You´ve learned to open  graphic windows in different sizes, draw lines, draw circles and fill closed spaces with colors, plus seize the Loop structures to create patterns.

In this first session you'll work in your notebook and in the second you're going to create an algorithm in Raptor.


Activity 1

As always, take out your notebook and write down the class title and objective. Then, write the questions and answer them. Please do not copy from another classmate; instead, make a genuine effort to understand and complete the work yourself.

Questionnaire

  1. What line of code should you type in a Call to open a graphics window that is 300 pixels high and 200 pixels wide?
  2. In a Cartesian plane, dimensions are always indicated in order. Is the first dimension the vertical (y) or the horizontal (x)?
  3. So, if you´d had to draw a purple filled circle exactly in the middle of the window mentioned in the first question, what line of code would you type in the Call symbol? (50 pixels radius)
  4. Regarding lines, how would you create two black intersecting lines in front of the circle? The first line goes from the upper-left corner of the window to the lower-right corner. The second goes from the lower-left corner to the upper-right corner. Write the two lines code.
  5. And regarding fill colors, how would you fill the four remaining white areas with yellow? Write the four lines of code

Do you need visual support? Watch the next image that shows the final outcome.


Once you finish, ask your first session teacher to check and sign this notes.




SESSION 2

Activity 2

Now, the next level challenge. Open Raptor and create the next image using Raptor. As usual, you´ll upload the final algorithm file to the Classroom post, but you'll also have to draw the image and the Raptor flowchart in your notebook.



  • First, draw the hand-made version of the image in your notebook before creating the Raptor file.
  • Use a 400x400 graphic window
  • Start by filling the window with black, then proceed to draw the lines
  • Leave the circle for last. You'll need the next info, but you'll have to understand what does it mean.
    • (200,142,92,yellow,0)
  • Analyze the final result and compare it with your own product
  • Once finished, save your file and upload it to Classroom

Don't forget to copy the flowchart form Raptor to your notebook.

Ask your second session teacher to check and sign this notes.

Good luck!