Hey refer to the conversation I had with a commenter below. The key is to use the colored module from termcolor and replace the printing of the clue in the processGuess function with the printColored function call.
hi Victor - i created a verision of this that I want to publish online.. would the next step be purchasing a domain and finding a web host? new to web development so not really sure how to publish online. thanks.
That's great! It depends on how you want to publish it. Let's say you have your code in replit.com, you can make the link available just like I did in the description at any social platform you already have a presence. If you want to place it in a website, you do need to find a web hosting service to host the website you create. The general route would be to purchase a domain name from a domain registrar (e.g., domain.com, godaddy.com), set up a web hosting service and link the domain name to the space, and create your webpages. Many of the domain registrars (including those I listed above) now also provide web hosting services so you can do it all there with some additional cost. Another route would be to use a website development service (e.g., weebly.com, wix.com) and create your webpages directly. Then if you want you can purchase a domain name through them (otherwise you'll be tied to a subdomain name of theirs). A third route which I found recently is to put your code at GitHub and build a webpage there (pages.github.com/). It's a bit more involved but you have lots of control -- though if you are new to web development you might want to start with the other 2 routes.
This code should work in any IDEs including VS Code. Though I haven't used VS Code to write Python code before here are some suggestions you can try: -make sure you have Python and Python extension installed (code.visualstudio.com/docs/languages/python) -double-check you have typed the code correctly, especially don't miss the colons and parentheses (if the IDE supports syntax highlighting it would warn you about those things) You can always try using other IDEs specifically developed for Python, including PyCharm, Spyder, and of course IDLE (refer to this video I made ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RRMCNS3DBrw.html) Good luck making it work!
Hi! Assuming you are referring to duplicates in the words list, you can use the following code to generate a list without duplicates: my_list = ["digit", "awake", "blush", "vocal", "digit"] # digit is a duplicate my_list_no_duplicates = list(set(my_list)) this code uses the fact that Python's set doesn't allow duplicates.
In the video I used replit.com/. It is an online IDE so you don't have to download anything (except a browser to access their webpage). You can also use any other IDEs that support the Python programming language. For the offline ones you do have to download them. Refer to this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RRMCNS3DBrw.html for one of them called IDLE.
If the answer is "chief" and you typed "bedes" this code will create an extra yellow 'e' because you are providing an extra 'e'... may that's what you mean by "broke"? Someone mentioned in the comments earlier pointing out this issue and I explained a bit why. Feel free to refer to it for more details. In my other video using C I've added a way to address it.
Yes it does say green. I just ran the code and for the answer "chief" when the input was "bedes" the clue it gave was "-Y-G-", as expected: first 'e' generates the Y and the second 'e' generates the G as it is in the second last position (the 'e' in "chief"). I suggest checking if your processGuess is indeed comparing the user input "bedes" with the answer "chief".
If the solution is ALLOW and the guess is LOLLY, it should show that there is one L in the right place, one L in the wrong place and one L that it not in the word. I do not think your code does this.
Great observation! This version would indeed give one more clue on the extra L being in the wrong place instead of not in the word. The cause of this is that the processGuess function works from the guess's perspective and uses each of its letter to compare with the answer -- as can be verified by swapping the guess with the answer to produce the result you expect. It is possible to provide a different clue by doing a bit more checking in the function but this would be a bit more complicated. Nevertheless I encourage you explore how to do it, and my question for your is: which L would you choose to say is not in the word?
@@CompSciwithDrVictor The "natural" way of processing English words is from left to right, which lends itself to an algorithm that says that the 3rd L is not in the word. This is the result that my code, and that of the original Wordle, produces. I too would encourage coders to explore this, and, once they have a solution, compare it to the solutions in the task "Wordle compare" on rosettacode, and add their solution there if their language of choice is not represented.