Your Courses All Courses
Loop an Array and Assign Elements

Loop an Array and Assign Elements

Sort and parse an array with the looper custom widget.

rate limit

Code not recognized.

About this course

In this challenge, you will start with an array of coordinates for a CNC machine containing x and y positions (in this case, we don't have z positions). You will need to parse this array and sort its elements into three columns: IDs, x coordinates and y coordinates. Elements are already ordered in triplets. In other words, the first, second and third elements are the ID, x coordinate, and y coordinate of the first data point; similarly, the fourth, fifth and sixth element are a triplet describing the ID, x coordinate and y coordinate of the second CNC datapoint and so forth until the end of the list.

Curriculum6 min

  • Challenge Overview
  • Answer Key 6 min

About this course

In this challenge, you will start with an array of coordinates for a CNC machine containing x and y positions (in this case, we don't have z positions). You will need to parse this array and sort its elements into three columns: IDs, x coordinates and y coordinates. Elements are already ordered in triplets. In other words, the first, second and third elements are the ID, x coordinate, and y coordinate of the first data point; similarly, the fourth, fifth and sixth element are a triplet describing the ID, x coordinate and y coordinate of the second CNC datapoint and so forth until the end of the list.

Curriculum6 min

  • Challenge Overview
  • Answer Key 6 min