
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
8 questions
Измерение информации. Алфавитный подход
Presentation
•
10th Grade
9 questions
Analyzing Structure: A Soldier for the Crown
Presentation
•
11th Grade
8 questions
KTP Evaluation System
Presentation
•
KG - 11th Grade
12 questions
READING COMPREHENSION
Presentation
•
10th - 11th Grade
11 questions
PSAT Orientation
Presentation
•
10th Grade
10 questions
Produk Kreatif dan Kewirausahaan
Presentation
•
11th Grade
11 questions
Internet Of things
Presentation
•
11th Grade
10 questions
MATERI 6 : Modal in English
Presentation
•
10th Grade
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade