FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about Coding on the Back of a Turtle
Quiz about Coding on the Back of a Turtle

Coding on the Back of a Turtle Quiz


Created in 1967 as an early attempt to make computer programming more accessible to children, Logo is an unusual programming language that makes use of, yes, a turtle. How, you say? Well, come in and learn - the hints in the questions should help!

A multiple-choice quiz by WesleyCrusher. Estimated time: 5 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Time
5 mins
Type
Multiple Choice
Quiz #
387,532
Updated
Dec 03 21
# Qns
10
Difficulty
Average
Avg Score
7 / 10
Plays
1125
Last 3 plays: Guest 173 (10/10), xchasbox (5/10), Guest 106 (3/10).
- -
Question 1 of 10
1. The turtle is the main tool to create Logo's signature graphical patterns. It behaves just like a robot. What kind of commands do you need to control it? Hint


Question 2 of 10
2. Assume your turtle is pointing upwards, in the middle of a blank screen and has its pen down, ready to draw. What would be the visible result of the following sequence? (Note - the syntax is definitely correct as is).

forward 15 left 135 forward 5
Hint


Question 3 of 10
3. I want to create a small square on the screen. Obviously, I could write out

forward 8 right 90 forward 8 right 90 forward 8 right 90 forward 8

but what would be a better way, using a simple loop? Try a syntax that resembles what you already know.
Hint


Question 4 of 10
4. Some tasks are a bit more difficult if you are a little turtle. Drawing a circle is one of the things that might require a bit of thought. How could you tell a single-minded Logo turtle to draw a circle (or rather a good approximation of one)? Hint


Question 5 of 10
5. Don't worry, you won't have to compose text out of turtle graphics. You can also simply ask the computer to write text. Remembering that this language was developed in the 1960s, before screen terminals were common, what statement do we need to output a text? Hint


Question 6 of 10
6. Any good programming language will allow you to create user-defined functions or modules. Logo is no different. How would you - very simply - begin a block of code that wants to define a procedure named "ask"? Hint


Question 7 of 10
7. If you want to do more complex things, you can use variables. To distinguish them from keywords, we need to introduce them with a punctuation mark. Remembering that we define variables to be something, what is the appropriate punctuation used by Logo to indicate a variable? Hint


Question 8 of 10
8. While we are on the topic of variables in Logo, what can you put into them? Think like a child and experiment! Hint


Question 9 of 10
9. Logo has its roots in the LISP programming language and in fact has similar list-processing capabilities. LISP knows the functions car, returning the first element of a list and cdr, returning the list minus its first element.

These cryptic keywords are hardly easy to memorize, so what does Logo use instead?
Hint


Question 10 of 10
10. I hope you've paid attention and have a bit of visual imagination. Here's your final exam. Take the following piece of Logo code:

to something :lines
repeat :lines [forward 100 left 180-180/:lines]
end

"Something" is a bad name for this procedure because once you call it with an odd number greater than 3, it does draw something beautiful. What do I get? If you don't immediately see the only viable possibility, try it in your mind for 5. 180-180/5 is 144.
Hint



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Apr 02 2024 : Guest 173: 10/10
Apr 01 2024 : xchasbox: 5/10
Mar 10 2024 : Guest 106: 3/10
Mar 06 2024 : Guest 75: 3/10
Feb 26 2024 : boxjaw: 4/10

Score Distribution

quiz
Quiz Answer Key and Fun Facts
1. The turtle is the main tool to create Logo's signature graphical patterns. It behaves just like a robot. What kind of commands do you need to control it?

Answer: Move and rotate commands

The Logo turtle is controlled like you would control a small, simple robot (which is exactly what it was in the 1960s implementations). You can tell it to move forward or backwards, rotate right or left and raise or lower its pen (triggering whether the movement will draw a line or not).
2. Assume your turtle is pointing upwards, in the middle of a blank screen and has its pen down, ready to draw. What would be the visible result of the following sequence? (Note - the syntax is definitely correct as is). forward 15 left 135 forward 5

Answer: The number 1

These commands are a simple sequence. You first move up 15 units to create a vertical line, then rotate 135 degrees to the left (so you point left and down) and move another 5 units in that direction. The pen is down, so you are actually drawing.
3. I want to create a small square on the screen. Obviously, I could write out forward 8 right 90 forward 8 right 90 forward 8 right 90 forward 8 but what would be a better way, using a simple loop? Try a syntax that resembles what you already know.

Answer: repeat 4 [forward 8 right 90]

If you're used to other languages, this takes getting used to. The "repeat" command is not a conditional loop with an "until" clause but essentially works like the "for" construct. You may note the similarity of all these commands - the keyword is immediately followed by an argument and there are no separators.

The interpreter recognizes your next command simply by the presence of a keyword.
4. Some tasks are a bit more difficult if you are a little turtle. Drawing a circle is one of the things that might require a bit of thought. How could you tell a single-minded Logo turtle to draw a circle (or rather a good approximation of one)?

Answer: Alternate moves and turns in tiny increments

The turtle has no memory of what it last did and doesn't even know where it is. It also can't do more than one thing at a time. Yet, you can create a reasonable circle by just drawing a polygon with very many sides. 360 is a good number, so we will do this:

repeat 360 [back 1 left 1]

I've drawn my circle walking backwards - it has the same effect as going forward, but it gives style points.
5. Don't worry, you won't have to compose text out of turtle graphics. You can also simply ask the computer to write text. Remembering that this language was developed in the 1960s, before screen terminals were common, what statement do we need to output a text?

Answer: print

Just like in BASIC, the command to print text (originally on an actual printer, of course) is simply "print". You can print numbers or text; if you want to output text, you need to prefix it with a quote character, but there's no closing quote.

print "FunTrivia

is correct syntax and will send "FunTrivia" to your preferred output device.

If I want to print several words at a time, each one needs to have its own quote.

print "I "print "words

will result in the output "I print words"
6. Any good programming language will allow you to create user-defined functions or modules. Logo is no different. How would you - very simply - begin a block of code that wants to define a procedure named "ask"?

Answer: to ask

Remember this is a language for children? "Dear computer: To ask, you need to do the following things" is just how a child would describe things. Here's what it looks like:

to ask
print "How "are "you
print "?
end
7. If you want to do more complex things, you can use variables. To distinguish them from keywords, we need to introduce them with a punctuation mark. Remembering that we define variables to be something, what is the appropriate punctuation used by Logo to indicate a variable?

Answer: The colon (:)

Before you rush off to program with your new variables, keep in mind that Logo doesn't just assign things - the main way of using variables is as parameters. Using a variable, we can create a procedure that creates a polygon of any number of sides we want:

to polygon :sides
repeat :sides [forward 20 right 360/:sides]
end

Calling polygon 3 will draw a triangle and polygon 7 a nice regular heptagon. Did you notice that arithmetic works just like in other programming languages? Phew!
8. While we are on the topic of variables in Logo, what can you put into them? Think like a child and experiment!

Answer: Pretty much everything you can think of

Technically, a Logo variable always holds a list (just as in Logo's ancestor, LISP), but a list can be pretty much anything you want. It can be a single number, a text, a sequence of multiple numbers and texts, even mixed (similar to an array), it can even be or contain a procedure.
9. Logo has its roots in the LISP programming language and in fact has similar list-processing capabilities. LISP knows the functions car, returning the first element of a list and cdr, returning the list minus its first element. These cryptic keywords are hardly easy to memorize, so what does Logo use instead?

Answer: first and butfirst

Again, the language chooses simple, child-friendly terms. You take the "first" item of the list and the rest is "butfirst", everything but the first item.

The LISP terms are a leftover from the very first implementation on a very obscure piece of hardware. "car" stands for "Contents of Address part of Register" and "cdr" is the acronym for "Contents of Decrement part of Register". I'll stick with first and butfirst, thanks!
10. I hope you've paid attention and have a bit of visual imagination. Here's your final exam. Take the following piece of Logo code: to something :lines repeat :lines [forward 100 left 180-180/:lines] end "Something" is a bad name for this procedure because once you call it with an odd number greater than 3, it does draw something beautiful. What do I get? If you don't immediately see the only viable possibility, try it in your mind for 5. 180-180/5 is 144.

Answer: A star

As written in the question, my procedure will only work for odd numbers; the geometry does not work out for even ones. I can fix that by extending the loop:

to star :lines
repeat :lines*2 [forward 100 left 180-180/:lines]
end

but this still has the small fault that even parameters will result in twice as many points as specified (star 4 gives 8 points). I'll leave further improvements to you :)
Source: Author WesleyCrusher

This quiz was reviewed by FunTrivia editor rossian before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
Related Quizzes
This quiz is part of series Take a Hint, Do the Sprint!:

What can you do with 1 hour and 37 minutes? If you take part in a FunTrivia Sprint, the answer is "write a quiz". These 9 entries have been produced just in that average time for the Sprint Reloaded.

  1. Just the Best, From the Chest Average
  2. Let's react! Average
  3. Europa Park: Ten Great Coasters Average
  4. Link the Cats Easier
  5. How Not to Die Average
  6. Coding on the Back of a Turtle Average
  7. Complete the Hands Average
  8. As it Begins, so it Ends Average
  9. Arithmetic Sequences for Fun and Profit Tough

4/16/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us