
Robot Questions
Presentation
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Alison Anderson
Used 1+ times
FREE Resource
12 Slides • 0 Questions
1
Directions & Hints
●
Given: The initial position and direction of the robot is shown for
each problem with the teal triangle.
●
Goal: Run the code with scratch-work, find the correct end
position and direction and place the gold triangle there.
●
To move: use mouse, or use arrow keys: 6 times to move 1 box
●
To rotate:alt+leftoralt+right: 6 times for 90° rotation
●
You may duplicate slides to work through it:ctrl+d
○Hint: Change the background of the working slide
●Printout ← here is a copy for you, so print at home
2
3
i ← 1
ROTATE_LEFT()
MOVE_FORWARD()
REPEAT 4 TIMES
{
if( i = 1 )
{
MOVE_FORWARD()
}
else
{
ROTATE_RIGHT()
}
MOVE_FORWARD()
i ← i + 1
}
ROTATE_RIGHT()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#1
4
i ← 1
ROTATE_RIGHT()
ROTATE_RIGHT()
REPEAT 3 TIMES
{
ROTATE_RIGHT()
REPEAT i TIMES
{
MOVE_FORWARD()
}
i ← i + 1
}
ROTATE_RIGHT()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#2
5
i ← 3
ROTATE_RIGHT()
REPEAT 2 TIMES
{
MOVE_FORWARD()
MOVE_FORWARD()
if( i = 2 )
{
MOVE_FORWARD()
}
else
{
if( i ≥ 3 )
{
MOVE_FORWARD()
}
}
ROTATE_LEFT()
i ← i - 1
}
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#3
6
i ← 4
ROTATE_RIGHT()
REPEAT 4 TIMES
{
MOVE_FORWARD()
if( i ≤ 2 )
{
ROTATE_LEFT()
}
else
{
if( i ≥ 3 )
{
ROTATE_RIGHT()
}
else
{
MOVE_FORWARD()
}
}
i ← i - 1
}
MOVE_FORWARD()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#4
7
i ← 2
REPEAT 3 TIMES
{
if( i = 3 )
{
ROTATE_LEFT()
}
else
{
if( i ≤ 1 )
{
MOVE_FORWARD()
}
}
MOVE_FORWARD()
MOVE_FORWARD()
i ← i + 1
}
MOVE_FORWARD()
ROTATE_LEFT()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#5
8
i ← 1
MOVE_FORWARD()
REPEAT 2 TIMES
{
ROTATE_RIGHT()
MOVE_FORWARD()
REPEAT i times
{
MOVE_FORWARD()
}
i ← i - 1
}
MOVE_FORWARD()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#6
9
PROCEDURE comboMove(x)
{
REPEAT x TIMES
{
ROTATE_LEFT()
MOVE_FORWARD()
}
}
i ← 2
REPEAT 2 TIMES
{
MOVE_FORWARD()
comboMove(i)
MOVE_FORWARD()
i ← i - 1
}
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#7
10
PROCEDURE doSomething(a)
{
REPEAT a TIMES
{
MOVE_FORWARD()
}
}
i ← 1
REPEAT 3 TIMES
{
ROTATE_LEFT()
doSomething(i)
i ← i + 1
}
MOVE_FORWARD()
ROTATE_LEFT()
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#8
11
PROCEDURE Mystery(a)
{
REPEAT a TIMES
{
MOVE_FORWARD()
ROTATE_RIGHT()
}
}
i ← 3
ROTATE_LEFT()
ROTATE_LEFT()
REPEAT 2 TIMES
{
MOVE_FORWARD()
Mystery(i)
i ← i - 1
}
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#9
12
PROCEDURE DoSomething(a)
{
MOVE_FORWARD()
if( a > 2 )
{
MOVE_FORWARD()
}
else
{
if( a = 3 )
{
MOVE_FORWARD()
}
}
MOVE_FORWARD()
}
i ← 3
ROTATE_RIGHT()
REPEAT 2 TIMES
{
DoSomething(i)
MOVE_FORWARD()
ROTATE_RIGHT()
i ← i - 1
}
r5
r1
r2
c1
r3
r6
r4
c6
c2
c3
c4
c5
r7
c7
#10
Directions & Hints
●
Given: The initial position and direction of the robot is shown for
each problem with the teal triangle.
●
Goal: Run the code with scratch-work, find the correct end
position and direction and place the gold triangle there.
●
To move: use mouse, or use arrow keys: 6 times to move 1 box
●
To rotate:alt+leftoralt+right: 6 times for 90° rotation
●
You may duplicate slides to work through it:ctrl+d
○Hint: Change the background of the working slide
●Printout ← here is a copy for you, so print at home
Show answer
Auto Play
Slide 1 / 12
SLIDE
Similar Resources on Wayground
11 questions
PRESENTASI HTML
Presentation
•
11th Grade
8 questions
Past Continuous Tense
Presentation
•
11th Grade
10 questions
CREDIT
Presentation
•
12th Grade
8 questions
Slides8.1_RowMajor_and_ColumnMajor
Presentation
•
11th Grade
8 questions
Perangkat Keras Internet
Presentation
•
11th Grade
9 questions
Reading Strategies
Presentation
•
6th - 8th Grade
10 questions
Limits
Presentation
•
11th Grade
11 questions
Estructuras Condicionales
Presentation
•
11th Grade
Popular Resources on Wayground
10 questions
GPA Lesson
Presentation
•
9th - 12th Grade
7 questions
Albert Einstein
Quiz
•
3rd Grade
31 questions
Bridge A Review
Quiz
•
3rd Grade
6 questions
Blue Sue and Red Ruth
Quiz
•
3rd Grade
8 questions
(Day12 HW) Inverse Trig Ratios
Quiz
•
9th Grade
20 questions
Summer Geometry QUIZ (Week3)
Quiz
•
9th Grade
16 questions
Theme Practice
Quiz
•
7th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade