sworldfere.blogg.se

Khan academy drawing program
Khan academy drawing program






WalkForward() Walks forward one space in the grid. KittyBot is a programmable robot that obeys the following commands: Of the options below, which will require the most repetitions of the loop? There are many ways for him to reach the cheese. Here's the start of a program that uses a loop to program his journey: MouseyBot would like to reach the DigiCheese. Mouse is shown in the fifth row, first column, facing the top edge of the grid. Cheese is shown in the first row, fifth column. A wedge of DigiCheese is located in the first row, fifth column.ĥx5 grid of squares. MouseyBot is currently positioned inside a grid environment, facing the top in the fifth row, first column. TurnRight() Rotates right 90 degrees (without moving forward).įacingWall() Returns true if robot is facing a wall (in the space in front).ĬanTakeCheese() Returns true if robot is on a space with cheese. TurnLeft() Rotates left 90 degrees (without moving forward). WalkForward(numSpaces) Walks forward the given number of spaces in the grid. MouseyBot is a programmable robot that can be programmed using the following procedures: Part 2: Which of these return statements is the best for this procedure? Part 1: Which line of code should the return statement be placed after? This procedure is missing a return statement, however. The procedure relies on two provided functions, POW which returns a number raised to an exponent, and SQRT which returns the square root of a number. This is the code of the procedure with line numbers: ​ d, equals, square root of, left parenthesis, x, start subscript, 2, end subscript, minus, x, start subscript, 1, end subscript, right parenthesis, start superscript, 2, end superscript, plus, left parenthesis, y, start subscript, 2, end subscript, minus, y, start subscript, 1, end subscript, right parenthesis, start superscript, 2, end superscript, end square root Her procedure calcDistance should return the distance between two points, based on the Pythagorean distance formula:ĭ = \sqrtd= Lillie is writing a program that calculates geometry formulas.








Khan academy drawing program