
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
10 questions
Synonym
Presentation
•
1st - 3rd Grade
10 questions
Tuesday, September 9 - Period 2 Lesson 6
Presentation
•
11th Grade
11 questions
Teenager 5 Session 22: Pronunciation & Speaking
Presentation
•
KG
6 questions
Media & Multimedia
Presentation
•
10th - 11th Grade
10 questions
Senderos 2 Lección 6 Contextos Las Viviendas - NO QUESTIONS
Presentation
•
10th - 12th Grade
10 questions
Modal verbs
Presentation
•
10th Grade
7 questions
TOB Ch4= God Made Our Bodies Quizziz
Presentation
•
11th Grade
10 questions
AP Chem Unit 01 Most Challenging Questions
Presentation
•
11th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Review 4
Quiz
•
3rd Grade
11 questions
HSMS - Standard Response Protocol
Quiz
•
6th - 8th Grade
16 questions
1.1-1.2 Quiz Review
Quiz
•
9th - 12th Grade
12 questions
Exponent Expressions
Quiz
•
6th Grade
20 questions
Adding and Subtracting Integers
Quiz
•
6th - 7th Grade
11 questions
Northeast States
Quiz
•
3rd - 4th Grade
10 questions
Characterization
Quiz
•
3rd - 7th Grade
10 questions
Common Denominators
Quiz
•
5th Grade