diff --git a/docs/lessons/compass/activity.md b/docs/lessons/compass/activity.md index d25a1473..65bc138f 100644 --- a/docs/lessons/compass/activity.md +++ b/docs/lessons/compass/activity.md @@ -25,24 +25,24 @@ basic.forever(() => { }) ``` -If `degrees` is less than `45`, then the compass heading is mostly pointing toward North. Display `N` on the @boardname@. +If `degrees` is less than `45` or greater than `315`, then the compass heading is mostly pointing toward North. Display `N` on the @boardname@. ```blocks basic.forever(() => { let degrees = input.compassHeading(); - if (degrees < 45) { + if (degrees < 45 || degrees > 315) { basic.showString("N"); } }); ``` - + If `degrees` is less than 135, the @boardname@ is mostly pointing East. Display `E` on the @boardname@. ```blocks basic.forever(() => { let degrees = input.compassHeading(); - if (degrees < 45) { + if (degrees < 45 || degrees > 315) { basic.showString("N"); } else if (degrees < 135) { @@ -57,7 +57,7 @@ If `degrees` is less than 225, the @boardname@ is mostly pointing South. Display ```blocks basic.forever(() => { let degrees = input.compassHeading(); - if (degrees < 45) { + if (degrees < 45 || degrees > 315) { basic.showString("N"); } else if (degrees < 135) { @@ -70,12 +70,12 @@ basic.forever(() => { ``` -If none of these conditions returned true, then the @boardname@ must be pointing West. Display `W` on the @boardname@. +If none of these conditions are true, then the @boardname@ must be pointing West. Display `W` on the @boardname@. ```blocks basic.forever(() => { let degrees = input.compassHeading(); - if (degrees < 45) { + if (degrees < 45 || degrees > 315) { basic.showString("N"); } else if (degrees < 135) { diff --git a/docs/lessons/compass/challenges.md b/docs/lessons/compass/challenges.md index 8a5e1fa6..8ad1d601 100644 --- a/docs/lessons/compass/challenges.md +++ b/docs/lessons/compass/challenges.md @@ -7,10 +7,9 @@ Display the direction that the @boardname@ is facing using the compass Complete the following [guided tutorial](/lessons/compass/activity), your code should look like this: ```blocks - let degrees = 0; basic.forever(() => { - degrees = input.compassHeading(); - if (degrees < 45) { + let degrees = input.compassHeading(); + if (degrees < 45 || degrees > 315) { basic.showString("N"); } else if (degrees < 135) { @@ -30,10 +29,9 @@ basic.forever(() => { Instead of displaying `N` when the @boardname@ is pointing North, display a star to indicate the north star. ```blocks - let degrees = 0; basic.forever(() => { - degrees = input.compassHeading(); - if (degrees < 45) { + let degrees = input.compassHeading(); + if (degrees < 45 || degrees > 315) { basic.showLeds(` # . # . # . # # # . @@ -61,10 +59,9 @@ basic.forever(() => { Instead of displaying just `N`, `W`, `S`, or `E`, display the full word. ```blocks - let degrees = 0; basic.forever(() => { - degrees = input.compassHeading(); - if (degrees < 45) { + let degrees = input.compassHeading(); + if (degrees < 45 || degrees > 315) { basic.showString("NORTH"); } else if (degrees < 135) { diff --git a/docs/lessons/compass/quiz-answers.md b/docs/lessons/compass/quiz-answers.md index c709b313..2c44b107 100644 --- a/docs/lessons/compass/quiz-answers.md +++ b/docs/lessons/compass/quiz-answers.md @@ -27,28 +27,7 @@ let degrees = input.compassHeading() ```blocks let degrees = input.compassHeading() -if (degrees < 45) { +if (degrees < 45 || degrees > 315) { basic.showString("N", 150) } ``` - -## 4. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the @boardname@ - - -```blocks -let degrees = input.compassHeading() -if (degrees < 135) { - basic.showString("E", 150) -} -``` - -## 5. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the @boardname@ - - -```blocks -let degrees = input.compassHeading() -if (degrees < 225) { - basic.showString("S", 150) -} -``` - diff --git a/docs/lessons/compass/quiz.md b/docs/lessons/compass/quiz.md index 31dd3da1..7c5a61c1 100644 --- a/docs/lessons/compass/quiz.md +++ b/docs/lessons/compass/quiz.md @@ -18,9 +18,4 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu ## 3. Write the 'If statement' that will check if the device is mostly pointing North. Display 'N' on the @boardname@ -## 4. Write the 'If statement' that will check if the device is mostly pointing East. Display 'E' on the @boardname@ - - -## 5. Write the 'If statement' that will check if the device is mostly pointing South. Display 'S' on the @boardname@ -