Showing posts with label practice Computer Science concepts. Show all posts
Showing posts with label practice Computer Science concepts. Show all posts

Saturday, February 7, 2015

code.org in Elementary School: A Review

code.org is a great place to start for someone new to coding. It is a non-profit that is dedicated to introducing children to Computer Science. They have a self-guided curriculum for elementary school students in K-5, consisting of several courses, designed for different age groups. The lessons are extremely fun & based on themes that are familiar to children. The animations using popular characters especially appeal to young kids. My child has been working with it since the end of summer and has thoroughly enjoyed it. I also use it in my kid's classroom and the response from the students has been amazing. We recently did the Hour of Code during the Computer Science Education Week (Dec 8-14, 2014) with the Angry Birds and the Frozen themes.

The following is my review of code.org for elementary school, based on my experience with it in the classroom and at home. We are currently focusing on the Hour of Code lessons in my classroom, along with Course 1 in Code Studio, but the points mentioned below apply to the other courses in Code Studio as well.


Love the following features:

1.  The curriculum is visually appealing to children, with the use of popular characters from movies and video games. Once captivated by these themes, the kids tend to treat it almost like a video game. I am yet to meet a kid who does not like to play around with Angry Birds :)

2.  Concepts are introduced one at a time, building up the student's knowledge in an incremental manner. Each concept is backed by multiple exercises, providing adequate practice opportunities.

3.  I really like it that the kids can move along at their own pace.

4.  Great page layout: Well organized, easy to understand and intuitive to use. Consists of instructions in a toolbox, an animations area to run & test the program, and a counter to track the number of instructions used.

5.  Only the subset of instructions that are required to design a given program are provided at any time. I find this to be extremely helpful in keeping little brains focused on the task at hand.

6.  The max number of instructions that are actually required to run the program is displayed at the top, along with a counter that keeps track of the number of instructions written by the student. This is extremely helpful to the children to keep an eye on the size of their programs. In my current classroom, I find it to be especially handy for those who forget to use Repeat Loops.

7.  The pre-designed curriculum makes it easy for everyone to use. The embedded tutorial videos are pretty cool as well.

8.  The Class Management Tool is great! Each course can be set up with a list of students in it. Adding and deleting names within the list is easy. No emails are required from the students, a huge plus for setting up accounts for the under-13 age group! The passwords can be set to words or pictures; I use pictures for passwords in my classroom & find it to be convenient for the kids to remember.

9.  The Class Management Tool tracks each student's progress in a course and marks the lessons as (a) done perfectly, (b) done correctly but with more instructions than required, (c) not completed. This is a big help to the instructor to figure out who needs help with what.

10.  I also like that the organization conducts free workshops for instructors, which greatly helps demystify the software for teachers who are not familiar with Computer Science.


A really interesting observation in my classroom while using code.org was that there was a lot of teamwork and willingness to coordinate with each other, even though each child was working on his/her own laptop. The children talked and discussed issues with their peers, helped each other out... all this without any prompting from me or the class teacher :)


Having talked so far about several features that I like about the tool, here is something that I would like to see implemented differently:  Once the program is written, the code is not saved. You can run the program, but once you move on to a different lesson, the previous code is gone. This hinders the ability to revisit and edit a piece of code. If a program was written with more instructions than required or if it was not completed, the tracking tool reflects it, but there is no way to go back and help the student fix the program. This feature was originally present but seems to have been taken out sometime towards the end of summer. Would be really helpful to have it restored.

Very happy to see that this feature (highlighted above) has been restored as of April 2015. The original program now gets saved, allowing you to revisit and edit it. There is a new "Start Over" button at the top of the screen that allows you to erase your program and restart.

The new "Answer Viewer" section that pops up when you are reviewing a student's work is quite helpful. It comes with two buttons "See the Solution" & "Try it Yourself". Quite a handy tool for teachers... 

Overall, I look at code.org's introductory curriculum as a stepping stone towards more advanced platforms such as Scratch (www.scratch.mit.edu). As mentioned above, allowing the child to focus on just the required tools initially, than being given a huge set of choices helps to focus and identify the use cases for the various concepts later on. Plenty of practice with each concept and the ability to move along at the child's own pace enables the readiness for more advanced, creative projects.


Wednesday, July 30, 2014

Solutions: Procedures: Revisiting Squares

The Procedures in Pro-Bot are pre-named from Proc1 to Proc32.


1.  Let's write the program for the square and store it in a procedure called Proc1. Access the New Proc or Edit Proc options from the Menu button to access the procedures and  choose Proc1. Here's what Proc1 might look like:

// Remember that you would see Proc1 as the first line on the screen here, not Main.

   Rpt 4 [
   Fd 6
   Rt
   ]


// To run this Procedure, go back to Main by clicking on the Menu button. Call Proc1 from Main using the Proc key and the number 1 on the control pad. Then press Go and watch your Procedure execute.



2.   Here is one way to use Proc1 from the above program to draw the stack of squares.

     Rpt 3 [
     Proc 1
     Fd 6
     Rt
     Fd 6
     Lt
     ]





3.   To draw the coaches for the train using Proc1, you could use the following code:
   
    Rpt 3 [
    Proc 1
    Rt
    Fd 8
    Lt
    ]

Procedures: Revisiting squares

The following programs are intended to provide practice with writing procedures in Pro-Bot, storing them in Pro-Bot's memory and calling them.


(1)  Write a program for Pro-Bot to draw a square of sides 6 cm. Store this program as a procedure on Pro-Bot (say proc1). Now call this procedure (proc1) from Main to test and see if Pro-Bot draws a 6 cm square.



(2)  Now that you have your program for drawing a 6 cm square stored in Pro-Bot's memory, any time you want to use it, you can call it either from your Main program or from another procedure.
You may recall the figure below from the Nested Loops assignment.




















Can you use the procedure that you have in Pro-Bot's memory to draw the above figure now? Rewrite your previous program for Pro-Bot to trace this figure, using the procedure for the square.




(3)   Let's revisit the Trains project from Nested Loops. Can you rewrite your previous program for Pro-Bot to draw the coaches of the train using the above procedure?




















In all of the projects above, you can see that you did not have to write the code for the square anew each time. All you had to do was write the program for the square once, store it as a procedure and then call the procedure any time you needed its functionality. You were able to use the same procedure for different programs.


Here is a set of solutions.

Solutions: Debugging

1.  The program to trace the number 2 has bugs in instructions & data.

   Fd 6
   Rt
   Fd 6
   Rt
   Fd 6
   Rt          //Wrong instruction, Rt instead of Lt
   Fd 6
   Lt
   Fd 12    //Wrong data, 12 cm instead of 6 cm

Here is the program with the bugs fixed:

   Fd 6
   Rt
   Fd 6
   Rt
   Fd 6
   Lt      
   Fd 6
   Lt
   Fd 6  




2.  The missing square bracket for the Rpt instruction is a very common bug.

    Rpt 2 [
    Fd 6
    Lt
    Rpt 3 [
    Fd 6
    Rt
    ]
    Rt
    Rt
    // The closing square bracket is missing as the last instruction here.
    // Without it, the outer loop executes only once, not twice as intended.


Here is the program with the bugs fixed:

    Rpt 2 [
    Fd 6
    Lt
    Rpt 3 [
    Fd 6
    Rt
    ]
    Rt
    Rt
    ]



3.  A stack of squares, using a Nested Loop:  The given program has bugs in data, punctuation (missing square bracket) and missing instructions.

    Rpt 2 [     // Wrong data, need 3 squares not 2
    Rpt 5 [
    Fd 6
    Rt
    ]
    // Missing a few instructions here, as well as a closing square bracket for the outer loop.


Here is the program with the bugs fixed:

    Rpt 3 [  
    Rpt 5 [
    Fd 6
    Rt
    ]
    Fd 6
    Lt
    ]



4.  A square of sides 6 cm divided into two equal parts: The given program has wrong data and wrong instructions.
   

    Rpt 4 [
    Fd 6
    Rt
    ]
    Fd 2     // Wrong data, need to move 3 cm to get to the midpoint 
    Rt
    Bk 6    // Wrong instruction, need Fd 6

Here is the program with the bugs fixed:
    Rpt 4 [
    Fd 6
    Rt
    ]
    Fd 3     
    Rt
    Fd 6    



5.  Three squares stacked on top of each other. 

    Rpt 2 [     // Wrong data: need 3 squares, so repeat 3
    Rpt 5 [
    Fd 6
    Rt


    ]
    // Missing instructions here
    ]

Here is the program with the bugs fixed:
    Rpt 3 [     
    Rpt 5 [
    Fd 6
    Rt


    ]
    Lt
    ]

Debugging

Debugging is the process of finding and fixing “bugs”(errors) in your program.

Bugs can be of different forms, Some bugs that you would find in the following questions include instructions that have been typed in wrong, wrong logic, punctuation errors, missing instructions, wrong data, etc.

(1)   Here is a program for tracing the number 2 as seen on a digital clock using Pro-Bot. Each side of the figure is 6 cm long. Try programming your Pro-Bot with this program and see if it makes the required pattern. If it does not, find the bugs in your program (the parts of the program that are not working correctly) and fix them. Circle the wrong instructions in the given program and write the correct ones instead.























Fd 6
Rt
Fd 6
Rt
Fd 6
Rt
Fd 6
Lt
Fd 12


(2)   Here is a program for tracing the following figure using Pro-Bot. Each side of the figure is 6 cm long. Try programming your Pro-Bot with this program and see if it makes the required pattern. If it does not, find the bugs in your program and fix them. Circle the wrong instructions in the given program and write the correct ones instead.





















Rpt 2 [
Fd 6
Lt
Rpt 3 [
Fd 6
Rt
]
Rt
Rt



(3)   Here is a program for tracing the following figure using Pro-Bot. Each side of the figure is 6 cm long. Try programming your Pro-Bot with this program and see if it makes the required pattern. If it does not, find the bugs in your program and fix them. See if you need to add any other instructions as well. Circle the wrong instructions in the given program and write the correct ones instead.






















Rpt 2 [
Rpt 5 [
Fd 6
Rt
]


(4)  Here is a program for tracing the figure below using Pro-Bot. Each side of the square is 6 cm long. The square is divided into two equal parts by the line in the middle. Try programming your Pro-Bot with this program and see if it makes the required pattern. If it does not, find the bugs in your program (the parts of the program that are not working correctly) and fix them. Circle the wrong instructions in the given program and write the correct ones instead.















Rpt 4 [
Fd 6
Rt
]
Fd 2
Rt
Bk 6


(5) Here is a program for tracing the following figure using Pro-Bot. There are three squares stacked up and each square has 6 cm long sides. Try programming your Pro-Bot with this program and see if it makes the required pattern. If it does not, find the bugs in your program and fix them. See if you need to add any other instructions as well. Circle the wrong instructions in the given program and write the correct ones instead.