subject

Acertain robot can perform only 4 types of movement. it can move either up or down or left or right. these movements are represented
by ’u’, ’d’, ’l’, ’r’. assume all these movements to be of unit distance. write a function named theroundtrip that takes all the
movements the robot made in a day as input and output true of bool type if the robot returned to its starting position after its journey.
otherwise, return false. if the input is bad print the message "bad input".
sample input 1:
l, r,l, r
sample output 1:
true
sample input 2:
u, l,d, r

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:40, genyjoannerubiera
Kali, a python programmer, is using the turtle module to write the word “hello.” which code should she use to indicate the location to begin writing the word? a # pick up the turtle and move it to its starting location. b penup(-100, 200) goto() pendown() c penup() goto(-100, 200) pendown() d # pick up the turtle and move it to (-100, 200)
Answers: 2
image
Computers and Technology, 22.06.2019 16:30, buky0910p6db44
Corey set up his presentation for delivery to his team. the information he had to convey was critical to their job performance. he knew he would need a lot of time to explain each point
Answers: 3
image
Computers and Technology, 23.06.2019 09:00, paulusl19
The first screen you see when you open word2016 what is called?
Answers: 1
image
Computers and Technology, 25.06.2019 08:10, kappy10
A(n) is a step-by-step direction for performing a specific task, which is written in a language the computer can understand. servercachearrayprogram
Answers: 1
You know the right answer?
Acertain robot can perform only 4 types of movement. it can move either up or down or left or right....

Questions in other subjects:

Konu
Mathematics, 28.10.2019 04:31