Skip to content

Commit

Permalink
Merge branch 'main' into 100-feature-call-the-congratulations-page
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjnaT41756 authored May 29, 2024
2 parents 7b02b7f + 75b9992 commit 3ea0e90
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 25 deletions.
29 changes: 24 additions & 5 deletions src/components/shared/ExerciseSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,36 @@ ExerciseSideProps): JSX.Element {
unitCircleMarkers={[
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
['-90\xB0', '-45\xB0', '0\xB0', '45\xB0', '90\xB0'],
[
'-90\xB0',
'-60\xB0',
'-30\xB0',
'0\xB0',
'30\xB0',
'60\xB0',
'90\xB0',
],
[
'-90\xB0',
'-60\xB0',
'-30\xB0',
'0\xB0',
'30\xB0',
'60\xB0',
'90\xB0',
],
]}
unitCircleLabels={[
['A', 'C', '', 'B', ''],
['B', 'A', '', 'C', ''],
['', '', 'C', 'A', 'B'],
['', 'A', 'B', '', 'C'],
['', '', 'A', 'B', '', 'C', ''],
['', 'A', '', '', 'B', '', 'C'],
]}
directions={[
['left', 'right', '', 'right', ''],
['left', 'left', '', 'left', ''],
['', '', 'right', 'right', 'left'],
['', 'left', 'left', '', 'left'],
['', '', 'right', 'left', '', 'right', ''],
['', 'right', '', '', 'right', '', 'left'],
]}
toNextExercise={() => {
setDisplayExercise(displayExercise + 1);
Expand Down
9 changes: 4 additions & 5 deletions src/components/shared/Exercises/UnitCircleExercise.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function UnitCircleExercise({
(curAngle <= Math.PI / 2
? curAngle == Math.PI / 2
? 19 //middle
: 20 //left
: 17 //left
: 15) //right
}%`,
bottom: `${
Expand All @@ -82,7 +82,6 @@ function UnitCircleExercise({
{markers[idx]}
</div>
) : null}

<img
src={Cursor}
className="circle-cursor"
Expand All @@ -92,16 +91,16 @@ function UnitCircleExercise({
(cursorAngle <= Math.PI / 2
? cursorAngle == Math.PI / 2
? 5
: 7
: 2)
: 6
: 6)
}%`,
bottom: `${
Math.sin(cursorAngle) * 80 +
(cursorAngle <= Math.PI / 2
? cursorAngle == Math.PI / 2
? 25
: 28
: 28)
: 27)
}%`,
transform: `rotate(${cursorAngle}rad) ${
labels.length % 2 === 1 &&
Expand Down
29 changes: 15 additions & 14 deletions src/components/shared/LessonSide/LessonSideContent.JSON
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
{
"1": [
{ "id": "lesson-side-header", "text": "Positioning of Computers" },
{ "id": "lesson-side-header", "text": "Rotations in Computers" },
{
"id": "lesson-side-body",
"text": "In order to tell computers where to move the cursor, we have to use the coordinate system. The coordinate system is a grid with lots of small chunks, called units. To figure out where to move, the cursor uses its starting point at the center of the grid and counts out some number of units. For example, the point (2, 1) would be two units RIGHT and one unit UP from the center."
"text": "Just as computers have the coordinate system to figure out where to move, they also use a system called the unit circle to determine which way to point the cursor. The unit circle is made up of 360 segments called degrees. As such, turning a cursor 90 degrees is equivalent to turning it one-fourth of the circle."
},
{
"id": "lesson-side-body",
"text": "When looking at these numbers, remember that the number to move sideways comes first. A positive number means you move right, and a negative number means you move left. And when moving up and down with the second number, a positive number means you move up and a negative means down."
"text": "Just like the coordinate system, degrees can be either positive or negative."
}
],
"2": [
{ "id": "lesson-side-header", "text": "Moving the Cursor: turtle.goto()" },
{ "id": "lesson-side-header", "text": "Positioning in Computers" },
{
"id": "lesson-side-body",
"text": "There are many commands that allow us to move the cursor with Turtle. The simplest such command is goto(), which accepts arguments in the form of the pairs of numbers we saw before. In order to use it, we simply call it like this:"
"text": "Computers use the coordinate system to tell the cursor where to move. The coordinate system is a grid made of small chunks called units. The cursor starts out at the center of the grid and counts out some number of units to move. For example, the point (2, 1) would be two units RIGHT and one unit UP from the center."
},
{"id": "code-text", "text": "turtle.goto(-1,2)"},
{
"id": "lesson-side-body",
"text": "The above line tells the Turtle cursor to move 1 unit to the left and 2 units up from the center. Now try it yourself!"
"text": "When looking at these numbers, remember that the number to move sideways comes first. A positive number means you move right, and a negative number means you move left. And when moving up and down with the second number, a positive number means you move up and a negative means down."
}
],
"3": [
{ "id": "lesson-side-header", "text": "Moving the Cursor: forward() and backward()" },
{ "id": "lesson-side-header", "text": "Moving the Cursor: turtle.goto()" },
{
"id": "lesson-side-body",
"text": "If we don't know exactly what position to move to, we can also tell the cursor to move some number of units either forward or backward. In order to use the forward() and backward() functions, you call them like this:"
"text": "There are many commands that allow us to move the cursor with Turtle. The simplest such command is goto(), which accepts arguments in the form of the pairs of numbers we saw before. In order to use it, we simply call it like this:"
},
{"id": "code-text", "text": "turtle.forward(1)"},
{"id": "code-text", "text": "turtle.backward(2)"},
{"id": "code-text", "text": "turtle.goto(-1, 2)"},
{
"id": "lesson-side-body",
"text": "The above code tells the cursor to move 1 unit forward, then 2 units backward. Since the cursor points to the right at the beginning, the forward() function makes it move right and the backward() function goes left."
"text": "The above line tells the Turtle cursor to move 1 unit to the left and 2 units up from the center. Now try it yourself!"
}
],
"4": [
{ "id": "lesson-side-header", "text": "Rotations in Computers" },
{ "id": "lesson-side-header", "text": "Moving the Cursor: forward() and backward()" },
{
"id": "lesson-side-body",
"text": "Just as computers have the coordinate system to figure out where to move, they also use a system called the unit circle to determine which way to point the cursor. The unit circle is made up of 360 segments called degrees. As such, turning a cursor 90 degrees is equivalent to turning it one-fourth of the circle."
"text": "If we don’t know exactly what position to move to, we can also tell the cursor to move some number of units either forward or backward. In order to use the forward() and backward() functions, you call them like this:"
},
{"id": "code-text", "text": "turtle.forward(1)"},
{"id": "code-text", "text": "turtle.backward(2)"},
{
"id": "lesson-side-body",
"text": "Just like the coordinate system, degrees can be either positive or negative."
"text": "The above code tells the cursor to move 1 unit forward, then 2 units backward. Since the cursor points to the right at the beginning, the forward() function makes it move right and the backward() function goes left."
}
],
"5": [
Expand Down
2 changes: 1 addition & 1 deletion src/styles/Exercises/GraphInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
margin-bottom: 2vh;
margin-left: 0;
margin-right: auto;
margin-top: 100px;
margin-top: 150px;
padding-left: 8%;
}

Expand Down

0 comments on commit 3ea0e90

Please sign in to comment.