Coding Challenges



Scratch provides students with the chance to correct their programming attempts through trial and error in a visual environment; this makes it easier for learners to develop coding skills. The coding activities listed below can be used to challenge students and help them develop coding skills. Although these coding activities are normally created by the instructor they can also be created by the students to challenge each other.

Completing code

Objective: enable students to reflect on and apply Scratch programming knowledge and skills to complete incomplete code in a working project.

Take a working project and remove some of the code, then give students an opportunity to complete the project, that is fill in the missing code. Students should be able to see the output of the working project; students can use the working output along with the incomplete code as a guide to completing the code. (Kordaki, 2012).

For novice programmers, the programming blocks needed to complete the project and produce the correct output can be provided by the instructor. That is students are required only to assemble the blocks in the correct sequence. For a more difficult challenge the students must choose the correct blocks themselves to complete the code.

For example:

Dodge ball game:
complete code

Mixing code

Objective: enable students to reflect on, and apply Scratch programming knowledge and skills to re-arrange mixed code.

Take a working project and mix-up some of the code, then give students an opportunity to arrange the code so that it produces the correct output. Students should be able to see the correct output on the screen beforehand. This activity along with the completing code activity can be used to scaffold the learning of computer programming; these activities are easier because students do not have to develop the code themselves, they are given the blocks and only have to experiment until they find the appropriate sequence of commands that produces the correct output. (Kordaki, 2012).

For example:

Dodge ball game:
mixed-code

Correcting code

Objective: enable students to develop an awareness of programming errors commonly made in Scratch by novice programmers.

Students should be given a block of code that contains an error which is produces an incorrect output. This error should be reflective of a common error that is usually made by novice Scratch programmers. Demonstrate to students the correct output and then ask them to correct the error; this activity is more difficult as students have to find specific mistakes included in the given code and also to make corrections so that it produces correct output. (Kordaki, 2012). It is best to start with simple errors and work to more difficult challenges as students become more proficient.

For example:

Common error: Students often get confused with the differences between the "broadcast" and "broadcast and wait" blocks.

Dodge ball game:
correct-code


References

Kordaki M.,(2012). Diverse categories of programming learning activities could be performed within Scratch. Procedia -Social and Behavioral Sciences 46, 1162-66.