
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
Cause and Effect
Presentation
•
11th Grade
11 questions
Information Management Part 2
Presentation
•
11th Grade
11 questions
Come realizzare una campagna pubblicitaria efficace su Google
Presentation
•
11th Grade
10 questions
Multimedia
Presentation
•
11th - 12th Grade
8 questions
Semicolons
Presentation
•
10th Grade
10 questions
Estructura 4.2: stem changing verbs
Presentation
•
10th - 12th Grade
9 questions
Postwar Prosperity in America
Presentation
•
11th Grade
10 questions
FORMULA STATISTIK EXCEL
Presentation
•
11th Grade
Popular Resources on Wayground
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
20 questions
Brand Labels
Quiz
•
5th - 12th Grade