Skip to content

Commit 0a6e0cd

Browse files
committed
Day 4 preparation - treasure map coordinates with list
1 parent b6eb05d commit 0a6e0cd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 🚨 Don't change the code below 👇
2+
row1 = ["⬜️", "⬜️", "⬜️"]
3+
row2 = ["⬜️", "⬜️", "⬜️"]
4+
row3 = ["⬜️", "⬜️", "⬜️"]
5+
map = [row1, row2, row3]
6+
print(f"{row1}\n{row2}\n{row3}")
7+
position = input("Where do you want to put the treasure? ")
8+
# 🚨 Don't change the code above 👆
9+
10+
# Write your code below this row 👇
11+
12+
# Picking the user input.
13+
horPos = int(position[0])
14+
verPos = int(position[1])
15+
16+
# Printing selected coordinate
17+
selectedRow = map[verPos - 1]
18+
selectedRow[horPos - 1] = "X"
19+
20+
print(f"You've selected: {selectedRow}\n")
21+
22+
# Write your code above this row 👆
23+
24+
# 🚨 Don't change the code below 👇
25+
print(f"{row1}\n{row2}\n{row3}")

0 commit comments

Comments
 (0)