CEMC Banner

Problem of the Week
Problem B
Code to Guide Cupid

In the grid, the black squares represent obstacles to Cupid, who cannot go through them; nor can Cupid step outside the grid boundaries.

A description of the grid follows.

Let’s play with some pseudocode to guide Cupid’s path to the heart. The code will use the following instructions:

  1. For each set of pseudocode instructions, determine where Cupid ends up, or if an obstacle ends his quest (i.e., the code crashes).
    1. fly1
      rotc
      fly1
      fly1
      rotc
      fly1
    1. fly1
      rotc
      fly1
      rotcc
      fly1
  2. Write pseudocode which guides Cupid to the heart.

Theme: Computational Thinking