Find the solution from a word search game











up vote
0
down vote

favorite
1












I have a file with a matrix that is my wordsearch and some words that i need to find in it.



O   T   N   E   G   R   A   S   A   E
R N N C O R A L L O
O A I B L U E E V G
U T O R E N T I I A
V I O L E T T O O R
O C R A R I A E L O
D A B I M A L V A P
I P C I E L O G L R
C O R P O S O U A O
A P I E N O M I L P


ACIDO
ARGENTO
BLU
CIELO
CORALLO
CORPOSO
ELETTRICO
LATTE
LIMONE
MALVA
NERO
OCRA
OPACITA
ORO
PAGLIERINO
PIENO
PORPORA
PRIMITIVO
VIOLA
VIOLETTO


For the solution I have thought about something like that:



 with open('cp5_Colori.txt', 'r') as f:
import pprint
data=f.read().replace("t","")
A=
B=set()
data=data.split("nn")
word_list=data[1].split()
lista_orizzontale=data[0].split()
puzzle=[list(row) for row in lista_orizzontale]
for parola in word_list:
for lista in puzzle:
x=puzzle.index(lista)
for carattere in lista:
y=lista.index(carattere)
if carattere.upper() == parola[0]:
for direction in [(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1),(1,-1)]:
(dx, dy) = direction
for i in range(len(parola)):
if ((x+dx*i)<len(puzzle)) and ((y+dy*i)<len(lista)) == True:
if puzzle[x+dx*i][y+dy*i].upper()== parola[i]:
puzzle[x+dx*i][y+dy*i]=puzzle[x+dx*i][y+dy*i].lower()







pprint.pprint(puzzle)


To solve the puzzle you need to search and then delete from the wordsearch all the OCCURRENCES (if multiple) of the words in the list.



The letters of the diagram that will remain, taken all in their order by rows and by columns, they will form the solution of the game.
I don't know how to continue and how to find the solution that is "SANGUEBLU"










share|improve this question
























  • Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
    – G. Anderson
    Nov 19 at 17:25






  • 1




    Mind not vandalising your question?
    – Adriaan
    Nov 19 at 19:20






  • 2




    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
    – Makyen
    Nov 19 at 19:26















up vote
0
down vote

favorite
1












I have a file with a matrix that is my wordsearch and some words that i need to find in it.



O   T   N   E   G   R   A   S   A   E
R N N C O R A L L O
O A I B L U E E V G
U T O R E N T I I A
V I O L E T T O O R
O C R A R I A E L O
D A B I M A L V A P
I P C I E L O G L R
C O R P O S O U A O
A P I E N O M I L P


ACIDO
ARGENTO
BLU
CIELO
CORALLO
CORPOSO
ELETTRICO
LATTE
LIMONE
MALVA
NERO
OCRA
OPACITA
ORO
PAGLIERINO
PIENO
PORPORA
PRIMITIVO
VIOLA
VIOLETTO


For the solution I have thought about something like that:



 with open('cp5_Colori.txt', 'r') as f:
import pprint
data=f.read().replace("t","")
A=
B=set()
data=data.split("nn")
word_list=data[1].split()
lista_orizzontale=data[0].split()
puzzle=[list(row) for row in lista_orizzontale]
for parola in word_list:
for lista in puzzle:
x=puzzle.index(lista)
for carattere in lista:
y=lista.index(carattere)
if carattere.upper() == parola[0]:
for direction in [(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1),(1,-1)]:
(dx, dy) = direction
for i in range(len(parola)):
if ((x+dx*i)<len(puzzle)) and ((y+dy*i)<len(lista)) == True:
if puzzle[x+dx*i][y+dy*i].upper()== parola[i]:
puzzle[x+dx*i][y+dy*i]=puzzle[x+dx*i][y+dy*i].lower()







pprint.pprint(puzzle)


To solve the puzzle you need to search and then delete from the wordsearch all the OCCURRENCES (if multiple) of the words in the list.



The letters of the diagram that will remain, taken all in their order by rows and by columns, they will form the solution of the game.
I don't know how to continue and how to find the solution that is "SANGUEBLU"










share|improve this question
























  • Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
    – G. Anderson
    Nov 19 at 17:25






  • 1




    Mind not vandalising your question?
    – Adriaan
    Nov 19 at 19:20






  • 2




    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
    – Makyen
    Nov 19 at 19:26













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





I have a file with a matrix that is my wordsearch and some words that i need to find in it.



O   T   N   E   G   R   A   S   A   E
R N N C O R A L L O
O A I B L U E E V G
U T O R E N T I I A
V I O L E T T O O R
O C R A R I A E L O
D A B I M A L V A P
I P C I E L O G L R
C O R P O S O U A O
A P I E N O M I L P


ACIDO
ARGENTO
BLU
CIELO
CORALLO
CORPOSO
ELETTRICO
LATTE
LIMONE
MALVA
NERO
OCRA
OPACITA
ORO
PAGLIERINO
PIENO
PORPORA
PRIMITIVO
VIOLA
VIOLETTO


For the solution I have thought about something like that:



 with open('cp5_Colori.txt', 'r') as f:
import pprint
data=f.read().replace("t","")
A=
B=set()
data=data.split("nn")
word_list=data[1].split()
lista_orizzontale=data[0].split()
puzzle=[list(row) for row in lista_orizzontale]
for parola in word_list:
for lista in puzzle:
x=puzzle.index(lista)
for carattere in lista:
y=lista.index(carattere)
if carattere.upper() == parola[0]:
for direction in [(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1),(1,-1)]:
(dx, dy) = direction
for i in range(len(parola)):
if ((x+dx*i)<len(puzzle)) and ((y+dy*i)<len(lista)) == True:
if puzzle[x+dx*i][y+dy*i].upper()== parola[i]:
puzzle[x+dx*i][y+dy*i]=puzzle[x+dx*i][y+dy*i].lower()







pprint.pprint(puzzle)


To solve the puzzle you need to search and then delete from the wordsearch all the OCCURRENCES (if multiple) of the words in the list.



The letters of the diagram that will remain, taken all in their order by rows and by columns, they will form the solution of the game.
I don't know how to continue and how to find the solution that is "SANGUEBLU"










share|improve this question















I have a file with a matrix that is my wordsearch and some words that i need to find in it.



O   T   N   E   G   R   A   S   A   E
R N N C O R A L L O
O A I B L U E E V G
U T O R E N T I I A
V I O L E T T O O R
O C R A R I A E L O
D A B I M A L V A P
I P C I E L O G L R
C O R P O S O U A O
A P I E N O M I L P


ACIDO
ARGENTO
BLU
CIELO
CORALLO
CORPOSO
ELETTRICO
LATTE
LIMONE
MALVA
NERO
OCRA
OPACITA
ORO
PAGLIERINO
PIENO
PORPORA
PRIMITIVO
VIOLA
VIOLETTO


For the solution I have thought about something like that:



 with open('cp5_Colori.txt', 'r') as f:
import pprint
data=f.read().replace("t","")
A=
B=set()
data=data.split("nn")
word_list=data[1].split()
lista_orizzontale=data[0].split()
puzzle=[list(row) for row in lista_orizzontale]
for parola in word_list:
for lista in puzzle:
x=puzzle.index(lista)
for carattere in lista:
y=lista.index(carattere)
if carattere.upper() == parola[0]:
for direction in [(1,0),(1,1),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1),(1,-1)]:
(dx, dy) = direction
for i in range(len(parola)):
if ((x+dx*i)<len(puzzle)) and ((y+dy*i)<len(lista)) == True:
if puzzle[x+dx*i][y+dy*i].upper()== parola[i]:
puzzle[x+dx*i][y+dy*i]=puzzle[x+dx*i][y+dy*i].lower()







pprint.pprint(puzzle)


To solve the puzzle you need to search and then delete from the wordsearch all the OCCURRENCES (if multiple) of the words in the list.



The letters of the diagram that will remain, taken all in their order by rows and by columns, they will form the solution of the game.
I don't know how to continue and how to find the solution that is "SANGUEBLU"







python






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 at 19:22









Adriaan

12.4k63160




12.4k63160










asked Nov 19 at 17:15









lucamasepo

64




64












  • Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
    – G. Anderson
    Nov 19 at 17:25






  • 1




    Mind not vandalising your question?
    – Adriaan
    Nov 19 at 19:20






  • 2




    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
    – Makyen
    Nov 19 at 19:26


















  • Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
    – G. Anderson
    Nov 19 at 17:25






  • 1




    Mind not vandalising your question?
    – Adriaan
    Nov 19 at 19:20






  • 2




    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
    – Makyen
    Nov 19 at 19:26
















Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
– G. Anderson
Nov 19 at 17:25




Rather than .read(), I wold look into using numpy's loadtxt to get the characters into an actual array, then you can use slicing to get the rows and columns and check whether they contain the words
– G. Anderson
Nov 19 at 17:25




1




1




Mind not vandalising your question?
– Adriaan
Nov 19 at 19:20




Mind not vandalising your question?
– Adriaan
Nov 19 at 19:20




2




2




Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
– Makyen
Nov 19 at 19:26




Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange (SE) network, you've granted a non-revocable right, under the CC BY-SA 3.0 license, for SE to distribute that content (i.e. regardless of your future choices). By SE policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: How does deleting work? ...
– Makyen
Nov 19 at 19:26












2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Given the following initialization:



puzzle = [l.split() for l in '''O   T   N   E   G   R   A   S   A   E
R N N C O R A L L O
O A I B L U E E V G
U T O R E N T I I A
V I O L E T T O O R
O C R A R I A E L O
D A B I M A L V A P
I P C I E L O G L R
C O R P O S O U A O
A P I E N O M I L P'''.splitlines()]

word_list = '''ACIDO
ARGENTO
BLU
CIELO
CORALLO
CORPOSO
ELETTRICO
LATTE
LIMONE
MALVA
NERO
OCRA
OPACITA
ORO
PAGLIERINO
PIENO
PORPORA
PRIMITIVO
VIOLA
VIOLETTO'''.splitlines()


The following code will solve your problem:



from itertools import product
removals =
for word in word_list:
for row in range(len(puzzle)):
for col in range(len(puzzle[row])):
for dr, dc in product(range(-1, 2), repeat=2):
if dr or dc:
removal =
for i in range(len(word)):
r = row + dr * i
c = col + dc * i
if not (0 <= r < len(puzzle) and 0 <= c < len(puzzle[row])) or puzzle[r][c] != word[i]:
break
removal.append((r, c))
else:
removals.append(removal)
for removal in removals:
for row, col in removal:
puzzle[row][col] = None
print(''.join(char for row in puzzle for char in row if char))


This outputs:



SANGUEBLU





share|improve this answer




























    up vote
    0
    down vote













    Once you downcased the letter using your code, you can get the result by:



    crossed = [['o', 't', 'n', 'e', 'g', 'r', 'a', 'S', 'a', 'e'], ['r', 'n', 'n', 'c', 'o', 'r', 'a', 'l', 'l', 'o'], ['o', 'a', 'i', 'b', 'l', 'u', 'e', 'e', 'v', 'g'], ['U', 't', 'o', 'r', 'e', 'n', 't', 'i', 'i', 'a'], ['v', 'i', 'o', 'l', 'e', 't', 't', 'o', 'o', 'r'], ['o', 'c', 'r', 'a', 'r', 'i', 'a', 'e', 'l', 'o'], ['d', 'a', 'b', 'i', 'm', 'a', 'l', 'v', 'a', 'p'], ['i', 'p', 'c', 'i', 'e', 'l', 'o', 'G', 'l', 'r'], ['c', 'o', 'r', 'p', 'o', 's', 'o', 'U', 'a', 'o'], ['a', 'p', 'i', 'e', 'n', 'o', 'm', 'i', 'l', 'p']]

    import re
    result = ''.join([ ''.join(line) for line in crossed ])
    print(result)
    hidden_word = ''.join(re.findall(r'[A-Z]', result))
    print (hidden_word) #=> SUGU


    But it seems you code downcased too many words.






    share|improve this answer























    • thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
      – lucamasepo
      Nov 19 at 17:47










    • Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
      – iGian
      Nov 19 at 18:12










    • thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
      – lucamasepo
      Nov 19 at 18:15













    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379637%2ffind-the-solution-from-a-word-search-game%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Given the following initialization:



    puzzle = [l.split() for l in '''O   T   N   E   G   R   A   S   A   E
    R N N C O R A L L O
    O A I B L U E E V G
    U T O R E N T I I A
    V I O L E T T O O R
    O C R A R I A E L O
    D A B I M A L V A P
    I P C I E L O G L R
    C O R P O S O U A O
    A P I E N O M I L P'''.splitlines()]

    word_list = '''ACIDO
    ARGENTO
    BLU
    CIELO
    CORALLO
    CORPOSO
    ELETTRICO
    LATTE
    LIMONE
    MALVA
    NERO
    OCRA
    OPACITA
    ORO
    PAGLIERINO
    PIENO
    PORPORA
    PRIMITIVO
    VIOLA
    VIOLETTO'''.splitlines()


    The following code will solve your problem:



    from itertools import product
    removals =
    for word in word_list:
    for row in range(len(puzzle)):
    for col in range(len(puzzle[row])):
    for dr, dc in product(range(-1, 2), repeat=2):
    if dr or dc:
    removal =
    for i in range(len(word)):
    r = row + dr * i
    c = col + dc * i
    if not (0 <= r < len(puzzle) and 0 <= c < len(puzzle[row])) or puzzle[r][c] != word[i]:
    break
    removal.append((r, c))
    else:
    removals.append(removal)
    for removal in removals:
    for row, col in removal:
    puzzle[row][col] = None
    print(''.join(char for row in puzzle for char in row if char))


    This outputs:



    SANGUEBLU





    share|improve this answer

























      up vote
      1
      down vote



      accepted










      Given the following initialization:



      puzzle = [l.split() for l in '''O   T   N   E   G   R   A   S   A   E
      R N N C O R A L L O
      O A I B L U E E V G
      U T O R E N T I I A
      V I O L E T T O O R
      O C R A R I A E L O
      D A B I M A L V A P
      I P C I E L O G L R
      C O R P O S O U A O
      A P I E N O M I L P'''.splitlines()]

      word_list = '''ACIDO
      ARGENTO
      BLU
      CIELO
      CORALLO
      CORPOSO
      ELETTRICO
      LATTE
      LIMONE
      MALVA
      NERO
      OCRA
      OPACITA
      ORO
      PAGLIERINO
      PIENO
      PORPORA
      PRIMITIVO
      VIOLA
      VIOLETTO'''.splitlines()


      The following code will solve your problem:



      from itertools import product
      removals =
      for word in word_list:
      for row in range(len(puzzle)):
      for col in range(len(puzzle[row])):
      for dr, dc in product(range(-1, 2), repeat=2):
      if dr or dc:
      removal =
      for i in range(len(word)):
      r = row + dr * i
      c = col + dc * i
      if not (0 <= r < len(puzzle) and 0 <= c < len(puzzle[row])) or puzzle[r][c] != word[i]:
      break
      removal.append((r, c))
      else:
      removals.append(removal)
      for removal in removals:
      for row, col in removal:
      puzzle[row][col] = None
      print(''.join(char for row in puzzle for char in row if char))


      This outputs:



      SANGUEBLU





      share|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Given the following initialization:



        puzzle = [l.split() for l in '''O   T   N   E   G   R   A   S   A   E
        R N N C O R A L L O
        O A I B L U E E V G
        U T O R E N T I I A
        V I O L E T T O O R
        O C R A R I A E L O
        D A B I M A L V A P
        I P C I E L O G L R
        C O R P O S O U A O
        A P I E N O M I L P'''.splitlines()]

        word_list = '''ACIDO
        ARGENTO
        BLU
        CIELO
        CORALLO
        CORPOSO
        ELETTRICO
        LATTE
        LIMONE
        MALVA
        NERO
        OCRA
        OPACITA
        ORO
        PAGLIERINO
        PIENO
        PORPORA
        PRIMITIVO
        VIOLA
        VIOLETTO'''.splitlines()


        The following code will solve your problem:



        from itertools import product
        removals =
        for word in word_list:
        for row in range(len(puzzle)):
        for col in range(len(puzzle[row])):
        for dr, dc in product(range(-1, 2), repeat=2):
        if dr or dc:
        removal =
        for i in range(len(word)):
        r = row + dr * i
        c = col + dc * i
        if not (0 <= r < len(puzzle) and 0 <= c < len(puzzle[row])) or puzzle[r][c] != word[i]:
        break
        removal.append((r, c))
        else:
        removals.append(removal)
        for removal in removals:
        for row, col in removal:
        puzzle[row][col] = None
        print(''.join(char for row in puzzle for char in row if char))


        This outputs:



        SANGUEBLU





        share|improve this answer












        Given the following initialization:



        puzzle = [l.split() for l in '''O   T   N   E   G   R   A   S   A   E
        R N N C O R A L L O
        O A I B L U E E V G
        U T O R E N T I I A
        V I O L E T T O O R
        O C R A R I A E L O
        D A B I M A L V A P
        I P C I E L O G L R
        C O R P O S O U A O
        A P I E N O M I L P'''.splitlines()]

        word_list = '''ACIDO
        ARGENTO
        BLU
        CIELO
        CORALLO
        CORPOSO
        ELETTRICO
        LATTE
        LIMONE
        MALVA
        NERO
        OCRA
        OPACITA
        ORO
        PAGLIERINO
        PIENO
        PORPORA
        PRIMITIVO
        VIOLA
        VIOLETTO'''.splitlines()


        The following code will solve your problem:



        from itertools import product
        removals =
        for word in word_list:
        for row in range(len(puzzle)):
        for col in range(len(puzzle[row])):
        for dr, dc in product(range(-1, 2), repeat=2):
        if dr or dc:
        removal =
        for i in range(len(word)):
        r = row + dr * i
        c = col + dc * i
        if not (0 <= r < len(puzzle) and 0 <= c < len(puzzle[row])) or puzzle[r][c] != word[i]:
        break
        removal.append((r, c))
        else:
        removals.append(removal)
        for removal in removals:
        for row, col in removal:
        puzzle[row][col] = None
        print(''.join(char for row in puzzle for char in row if char))


        This outputs:



        SANGUEBLU






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 18:14









        blhsing

        27.8k41335




        27.8k41335
























            up vote
            0
            down vote













            Once you downcased the letter using your code, you can get the result by:



            crossed = [['o', 't', 'n', 'e', 'g', 'r', 'a', 'S', 'a', 'e'], ['r', 'n', 'n', 'c', 'o', 'r', 'a', 'l', 'l', 'o'], ['o', 'a', 'i', 'b', 'l', 'u', 'e', 'e', 'v', 'g'], ['U', 't', 'o', 'r', 'e', 'n', 't', 'i', 'i', 'a'], ['v', 'i', 'o', 'l', 'e', 't', 't', 'o', 'o', 'r'], ['o', 'c', 'r', 'a', 'r', 'i', 'a', 'e', 'l', 'o'], ['d', 'a', 'b', 'i', 'm', 'a', 'l', 'v', 'a', 'p'], ['i', 'p', 'c', 'i', 'e', 'l', 'o', 'G', 'l', 'r'], ['c', 'o', 'r', 'p', 'o', 's', 'o', 'U', 'a', 'o'], ['a', 'p', 'i', 'e', 'n', 'o', 'm', 'i', 'l', 'p']]

            import re
            result = ''.join([ ''.join(line) for line in crossed ])
            print(result)
            hidden_word = ''.join(re.findall(r'[A-Z]', result))
            print (hidden_word) #=> SUGU


            But it seems you code downcased too many words.






            share|improve this answer























            • thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
              – lucamasepo
              Nov 19 at 17:47










            • Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
              – iGian
              Nov 19 at 18:12










            • thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
              – lucamasepo
              Nov 19 at 18:15

















            up vote
            0
            down vote













            Once you downcased the letter using your code, you can get the result by:



            crossed = [['o', 't', 'n', 'e', 'g', 'r', 'a', 'S', 'a', 'e'], ['r', 'n', 'n', 'c', 'o', 'r', 'a', 'l', 'l', 'o'], ['o', 'a', 'i', 'b', 'l', 'u', 'e', 'e', 'v', 'g'], ['U', 't', 'o', 'r', 'e', 'n', 't', 'i', 'i', 'a'], ['v', 'i', 'o', 'l', 'e', 't', 't', 'o', 'o', 'r'], ['o', 'c', 'r', 'a', 'r', 'i', 'a', 'e', 'l', 'o'], ['d', 'a', 'b', 'i', 'm', 'a', 'l', 'v', 'a', 'p'], ['i', 'p', 'c', 'i', 'e', 'l', 'o', 'G', 'l', 'r'], ['c', 'o', 'r', 'p', 'o', 's', 'o', 'U', 'a', 'o'], ['a', 'p', 'i', 'e', 'n', 'o', 'm', 'i', 'l', 'p']]

            import re
            result = ''.join([ ''.join(line) for line in crossed ])
            print(result)
            hidden_word = ''.join(re.findall(r'[A-Z]', result))
            print (hidden_word) #=> SUGU


            But it seems you code downcased too many words.






            share|improve this answer























            • thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
              – lucamasepo
              Nov 19 at 17:47










            • Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
              – iGian
              Nov 19 at 18:12










            • thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
              – lucamasepo
              Nov 19 at 18:15















            up vote
            0
            down vote










            up vote
            0
            down vote









            Once you downcased the letter using your code, you can get the result by:



            crossed = [['o', 't', 'n', 'e', 'g', 'r', 'a', 'S', 'a', 'e'], ['r', 'n', 'n', 'c', 'o', 'r', 'a', 'l', 'l', 'o'], ['o', 'a', 'i', 'b', 'l', 'u', 'e', 'e', 'v', 'g'], ['U', 't', 'o', 'r', 'e', 'n', 't', 'i', 'i', 'a'], ['v', 'i', 'o', 'l', 'e', 't', 't', 'o', 'o', 'r'], ['o', 'c', 'r', 'a', 'r', 'i', 'a', 'e', 'l', 'o'], ['d', 'a', 'b', 'i', 'm', 'a', 'l', 'v', 'a', 'p'], ['i', 'p', 'c', 'i', 'e', 'l', 'o', 'G', 'l', 'r'], ['c', 'o', 'r', 'p', 'o', 's', 'o', 'U', 'a', 'o'], ['a', 'p', 'i', 'e', 'n', 'o', 'm', 'i', 'l', 'p']]

            import re
            result = ''.join([ ''.join(line) for line in crossed ])
            print(result)
            hidden_word = ''.join(re.findall(r'[A-Z]', result))
            print (hidden_word) #=> SUGU


            But it seems you code downcased too many words.






            share|improve this answer














            Once you downcased the letter using your code, you can get the result by:



            crossed = [['o', 't', 'n', 'e', 'g', 'r', 'a', 'S', 'a', 'e'], ['r', 'n', 'n', 'c', 'o', 'r', 'a', 'l', 'l', 'o'], ['o', 'a', 'i', 'b', 'l', 'u', 'e', 'e', 'v', 'g'], ['U', 't', 'o', 'r', 'e', 'n', 't', 'i', 'i', 'a'], ['v', 'i', 'o', 'l', 'e', 't', 't', 'o', 'o', 'r'], ['o', 'c', 'r', 'a', 'r', 'i', 'a', 'e', 'l', 'o'], ['d', 'a', 'b', 'i', 'm', 'a', 'l', 'v', 'a', 'p'], ['i', 'p', 'c', 'i', 'e', 'l', 'o', 'G', 'l', 'r'], ['c', 'o', 'r', 'p', 'o', 's', 'o', 'U', 'a', 'o'], ['a', 'p', 'i', 'e', 'n', 'o', 'm', 'i', 'l', 'p']]

            import re
            result = ''.join([ ''.join(line) for line in crossed ])
            print(result)
            hidden_word = ''.join(re.findall(r'[A-Z]', result))
            print (hidden_word) #=> SUGU


            But it seems you code downcased too many words.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 19 at 18:11

























            answered Nov 19 at 17:40









            iGian

            2,8442622




            2,8442622












            • thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
              – lucamasepo
              Nov 19 at 17:47










            • Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
              – iGian
              Nov 19 at 18:12










            • thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
              – lucamasepo
              Nov 19 at 18:15




















            • thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
              – lucamasepo
              Nov 19 at 17:47










            • Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
              – iGian
              Nov 19 at 18:12










            • thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
              – lucamasepo
              Nov 19 at 18:15


















            thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
            – lucamasepo
            Nov 19 at 17:47




            thank you sir.. yeah i need also diagonals... but i alredy know how to find the words.. my problem is to find the remaining characters that is the solution of the game ,after deleting all the found words
            – lucamasepo
            Nov 19 at 17:47












            Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
            – iGian
            Nov 19 at 18:12




            Smart downcase found letters, here is how to retrieve the result, but somehing is wrong.
            – iGian
            Nov 19 at 18:12












            thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
            – lucamasepo
            Nov 19 at 18:15






            thank you for your help , but the solution should be "SANGUEBLU" not "SUGU".. what's wrong in my code? how can i fix it?
            – lucamasepo
            Nov 19 at 18:15




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379637%2ffind-the-solution-from-a-word-search-game%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Costa Masnaga

            Fotorealismo

            Sidney Franklin