Jump to content
Fórum Script Brasil
  • 0

Ajuda a montar um jogo de palavras no Python


Wagner Thierry

Question

Olá amigos estou aprendendo Python, tem menos de 2 meses que comecei, e estou fazendo uma atividade com os seguintes requerimentos (é um programa que funciona estilo o jogo chamado Wordle):

Have a secret word stored in the program.

Prompt the user for a guess.

Continue looping as long as that guess is not correct.

Calculate the number of guesses and display it at the end.

Add a check to verify that the length of the guess is the same as the length of the secret word. If it is not, display a message. If they are the same, then proceed to give the hint.

Make sure to account for the following in your hints:

Letters that are not present at all in the secret word (underscore _).

Letters that are present in the secret word, but in a different spot (lowercase).

Letters that are present in the secret word at that exact spot spot (uppercase).

 

Até o momento meu código está assim:

image.png.653a42c50668aca32f27cc0106dd896c.png

 

Eu não sei como fazer a parte do programa dar dicas, como mostrar em lower.case se alguma letra da palavra chutada existe na palavra secreta;

mostrar em upper.case se alguma letra da palavra chutada existe na palavra secreta e está no local exato onde deveria estar;

E tambem mostrar uma mensagem de erro caso o usuario escolha uma palavra que tenha mais letras do que a palavra secreta.

 

Se puderem me ajudar com isso ficarei muito grato !

Edited by Wagner Thierry
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...