Python Forum
Finding the treasure location
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding the treasure location
#4
 def find_treasure(mapfile):
    with open(mapfile,'r')as column:
        for i, row in enumerate(column):
            for j, val in enumerate(row):
                if val == 'T':
                    print(i,j) 
I can only manage to find all the coordinates for T, i dk how to set a condition such that it returns only the treasure coordinate when it is surrounded by T's
Reply


Messages In This Thread
Finding the treasure location - by cjlee420 - Oct-03-2019, 08:52 AM
RE: Finding the treasure location - by cjlee420 - Oct-03-2019, 10:08 AM
RE: Finding the treasure location - by ichabod801 - Oct-03-2019, 12:45 PM
RE: Finding the treasure location - by cjlee420 - Oct-03-2019, 02:06 PM
RE: Finding the treasure location - by ichabod801 - Oct-03-2019, 03:08 PM
RE: Finding the treasure location - by cjlee420 - Oct-03-2019, 03:48 PM
RE: Finding the treasure location - by ichabod801 - Oct-03-2019, 04:30 PM
RE: Finding the treasure location - by cjlee420 - Oct-03-2019, 04:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python - Treasure Generator on 5x5 Board PhillySports124 2 4,137 Dec-12-2017, 10:11 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020