Question: Prompts the user for two integers. The first one should be between 1 and 4, with 1 meaning initially looking North, 2 meaning initially looking

Prompts the user for two integers.

  • The first one should be between 1 and 4, with

    • 1 meaning initially looking North,

    • 2 meaning initially looking East,

    • 3 meaning initially looking South,

    • 4 meaning initially looking West.

  • The second one should be positive. When written in base 3, its consecutive digits read from left to right represent the directions to take, with

    • 0 meaning going in the direction one is initially looking at,

    • 1 meaning 45 degrees left of the direction one is initially looking at,

    • 2 meaning 45 degrees right of the direction one is initially looking at.

Prints out:

  • the direction one is originally looking at, as an arrow,

  • the representation of the second digit in base 3,

  • the corresponding sequence of directions to take, as arrows,

  • in case one is originally looking North or South, the path, so the sequence of arrows again, but nicely displayed.

1 mark for the direction one is originally looking at and the sequence of directions to take as arrows, 1 mark for the representation of the second digit in base 3, 1 mark for the path as a sequence of arrows nicely displayed.

Prompts the user for two integers. The first one should be between

$ python3 quiz_3.py Enter an integer between 1 and 4 and a positive integer: 3 2943856728 Ok, you want to first look this way: In base 3, the second input reads as: 21121011101102020200 So that's how you want to go: Let's go then! D D 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!