1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bulgar [2K]
3 years ago
14

You're familiar with the story of Hansel and Gretel, so when you decide to go exploring you always make sure to keep track of wh

ere you've come from. Since you know how unreliable leaving a trail of breadcrumbs is, you decide to write a program to help you map out your trail. Your program should first read in the size of the grid that you will be exploring, and then read in directions: left,right, up or down. You always start exploring at the top left of your map. After every step you should print out the trail, reading in directions until a blank line is entered. Your program should work like this: Grid size: 3 Direction: right Direction: dowrn Direction: right .Xx You will never be directed off the edges of the map.
Computers and Technology
1 answer:
Leona [35]3 years ago
8 0

Answer:

See explaination for the program code.

Explanation:

size = int(input('Grid size: '))

table = []

for i in range(size):

row=[]

for j in range(size):

row.append('.')

table.append(row)

table[0][0] = 'x'

for row in table:

print(*row,sep='')

Direction = input('Direction: ')

while Direction:

if Direction == 'right':

for i in range(size):

for j in range(size-1):

if table[i][j] == 'x':

table[i][j+1] = 'x'

table[i-1][j+1] = '.'

break

elif Direction == 'down':

for i in range(size):

for j in range(size-1):

if table[j][i] == 'x':

table[j+1][i] = 'x'

table[j+1][i-1] = '.'

break

for row in table:

print(*row,sep='')

Direction = input('Direction: ')

You might be interested in
As a compositional mode for electronic? media, __________ help people find their way through an unfamiliar system or? subject; t
maks197457 [2]
The answer that fills in the blank is orientation. It is because orientation does not provide all the details of what they are doing but a guideline of what they must do, in order for them to be guided on the things that they need to learn as they start. They require proper guidance which is the orientation before performing before hand. Especially when they are not familiar on what they need to do.
3 0
3 years ago
The shapes of AND, OR, and NOR gates have something in common. What is it and why do you think they share that feature?
irina1246 [14]
There're all conjunctions.

You can seperate them in sentences after a comma for a run-on sentence.
4 0
3 years ago
What is peopleware?<br>need help​
Oksana_A [137]

Answer:

Peopleware is a term used to refer to one of the three core aspects of computer technology, the other two being hardware and software.

3 0
3 years ago
8.18 **zyLab: Schedule Generator Write this program using an IDE. Comment and style the code according to the CS 200 Style Guide
Lera25 [3.4K]

Answer:

huh

Explanation:

sfdghjklhgfdsghjkhgfdsfghjk

3 0
3 years ago
I WILL GIVE THE CROWN IF CORRECT
alisha [4.7K]

Answer:

foundations

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Consider this data sequence: "fish bird reptile reptile bird bird bird mammal fish". let's define a singleton to be a data eleme
    5·1 answer
  • How do you find specific words on a web page ...?? I know theres a shortcut for highlighting a specific word on a webpage on fir
    15·1 answer
  • When you need to cut new external threads on a bolt, which of the following tools should you use?
    9·2 answers
  • Part 2: a) Write VHDL code for a top module that invokes necessary components to display the four decimal digits on four seven-s
    5·1 answer
  • Using this statement to answer the following question “FIFA World Cup 2010: (1+9) From Today!” (Ignore Quotation)
    9·1 answer
  • I need help solving this problem on Picoctf. The question is What happens if you have a small exponent? There is a twist though,
    7·1 answer
  • ASAP BRAINLIEST!!!!!!
    5·2 answers
  • Whats 12/29 divided by 12/34
    7·2 answers
  • simplify the expression below and state the value of m for which the simplified expression is not defined 2m² + m - 15/ m² - 9​
    5·1 answer
  • A _ is the acknowledgment of a potential noncomformity, or an opinion regarding an issue that is not covered by a standard
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!