repeat 3 [forward 25 right 45] repeat 6 [type "#] repeat 4 [print "Yo] repeat 3 [repeat 5 [forward 20 right 72] forward 50 right 120] repeat 3 [repeat 5 [type "ow]]Describe using complete sentences what the repeat command does.
Again! Again! Again! Again! Again!
repeat 20 [repeat random 30 [type "Hi] print]to display one rectangular block of text (two examples shown below).
............... """""""""" ............... """""""""" ............... """""""""" ............... """""""""" ...............
? converse Is this your first year at Bridgewater? No. Neat! What's your major? Mathematics That's my favorite subject! ?Hint: To make Logo pause and wait for an answer, use the command ignore readlist.
forward 10 left 90 forward 10 left 90 forward 20 left 90 forward 40 left 90 forward 40 right 90 forward 40 right 90 forward 20 right 90 forward 10 right 90 forward 10You may check your work using Logo. (The point of this exercise is to practice reading a list of instructions given to the computer. You will need this skill later, so be sure to get good practice now!)
FD 100 BK 50 RT 90 FD 50 LT 90 FD 50 BK 100 PU RT 90 FD 25 LT 90 PD FD 50 PU FD 10 PD FD 5 HTIf you're not sure what a command does, use Logo's help feature! For example, typing help "HT causes Logo to tell you:
HIDETURTLE HT makes the turtle invisible. It's a good idea to do this while you're in the middle of a complicated drawing, because hiding the turtle speeds up the drawing substantially.
You can also get help on instructions from files in the DOCS folder that came with your Logo installation or online at http://www.cs.berkeley.edu/~bh/usermanual.
repeat 20 [repeat random 30 [type "Hi] print]Write an instruction (a line of Logo code) that generates a random number between 0 and 5. Test your instruction to make sure it works! (When reading the help page for random, be aware that the command only works for single inputs even though the help page suggests using two inputs.)
(b) Give an instruction that uses random to print a random number between 3 and 6 (inclusive). Explain your answer using complete sentences. (Keep in mind that your answer must be in the spirit of Assignment 1, Problem 5; we cannot use random with two inputs as incorrectly indicated in the manual entry for random.)
(c) Give an instruction that uses random to print a random number between 3 and 7 (inclusive). Explain your answer using complete sentences. (Keep in mind that your answer must be in the spirit of Assignment 1, Problem 5; we cannot use random with two inputs as incorrectly indicated in the manual entry for random.) Have you deduced a general pattern from (a)--(c)? Can you explain the pattern in words? If you don't see a pattern yet, specify similar ranges, and see if you can write instructions that generate random numbers in those ranges. Eventually you will see a general method.
(d) DESIGN an ALGORITHM (method) that does what (random num1 num2) is supposed to do: outputs a random integer greater than or equal to the first input, and less than or equal to the second input. Assume both inputs are integers, and the first is less than the second. The object here is to DESIGN a procedure, NOT implement it. This work should be descriptive, showing your full understanding of the objective and the approach with minimal (if any) actual Logo instructions. Verify that your METHOD will perform correctly on the inputs (a) 2 and 5 (b) 3 and 6 (c) 3 and 7 as in the first three parts of this problem respectively.
repeat 50 [setcursor list random 75 random 20 type "Hi]has the result it does. Answer fully in complete sentences.