Algorithm Coding Activity: Enhancing Problem-Solving Skills in Programming

I am excited to share a recent classroom activity that focuses on strengthening our students’ programming and problem-solving skills. This activity revolves around a number grid and is designed to challenge students on programming with algorithm.

Activity Overview:

We utilize a number grid as the basis for this exercise. I provide students with a basic code snippet (accessible via the screenshot or project download link below) to kick-start the activity. The primary objective is to program a solution that navigates to a randomly generated number between 30 and 100 on the grid. Importantly, the number changes with each run, preventing students from relying on hardcoded solutions.

coding_test_start.vrblocks (1.7 KB)

Steps and Challenges:

  1. Initial Task: Students must write a program that can drive to the randomly generated number on the grid.

  2. Advanced Challenge - Switch Mode: As an additional layer, students are then asked to modify their code to return to the starting position using a ‘Switch’ mode.

  3. Support for Beginners: For students who require more foundational practice, the random number generation can be adjusted to produce numbers between 2 and 10, limiting the scope to the bottom row (x-axis) of the grid.

Hints and Tips:

  • One approach involves moving forward one grid space and then subtracting 10 from the target number.
  • Alternatively, students can calculate the exact coordinates and direct the code to move to these coordinates.
  • It’s important to remember that moving from one grid space to an adjacent one (e.g., from 1 to 2) requires moving just one grid space.
  • Each grid space is 200 mm apart, a detail that is crucial for accurate movement.
  • For the task of returning to the starting position, students are encouraged to utilize various sensors, fostering an exploration of different programming constructs and hardware capabilities.

Sharing and Discussion:

I encourage you to try this activity with your students and share your experiences and insights here. It would be particularly valuable to discuss the different approaches your students took, the challenges they faced, and how they overcame them.

Looking forward to your thoughts and feedback!

3 Likes