Тёмный

Build Wordle in Python • Word Game Python Project for Beginners 

pixegami
Подписаться 37 тыс.
Просмотров 24 тыс.
50% 1

In this project, we will build a clone of the popular "Wordle" game using Python. The game can be played directly via the terminal, and the project will only use in-built Python libraries.
💻 Source code: github.com/pixegami/python-wo...
🕹 Play Wordle: www.powerlanguage.co.uk/wordle/
📕 Word data: github.com/first20hours/googl...
Chapters:
00:00 Introduction and project scope
02:00 Creating the gameplay loop
14:20 Calculating the results for each guess
25:48 Adding color to the terminal interface
37:11 Adding a box around the puzzle
43:10 Preparing a dataset of 5-letter words
49:03 Use the data to generate random puzzles and validate guesses
56:10 Play test the game!
58:21 Wrap up

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@pixegami
@pixegami 2 года назад
BUG: Some viewers have pointed out in the code where a guess has duplicate letters which appear in the secret word. Oops! I've since fixed that behavior with this commit: github.com/pixegami/python-wordle/commit/d9b0d993de51c2ef3f59691ca4b9193fa27d0380 Also, if you are curious about the bug, #3Blue1Brown has a video with a very good explanation here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fRed0Xmc2Wg.html Thanks everyone who pointed this out!
@WhySoManySubs
@WhySoManySubs 11 месяцев назад
Hey, I got a problem because I wrote the def main(): print("Hello wordle") if __name__ == "__main__": main() But the terminal was empty what am i doing wrong?
@Geektron3000
@Geektron3000 Месяц назад
Champion! Man I was struggling with my course but this (your update in github included) helped me get over the hump. New to coding and was really stuck on how to account for duplicate letters. Cheers mate. 2 years on still helping people
@moeelash
@moeelash 2 года назад
Amazing content! I appreciate how you made everything easy to understand and made the overall game look appealing to play even on th IDLE
@akshayprakash7312
@akshayprakash7312 2 года назад
You're a legend Pixegami! You're going big soon!😃
@mathewsjoy8464
@mathewsjoy8464 2 года назад
Really enjoyed this ! Like the way you actually talk through everything. Some kind of data analysis project would be cool!
@pixegami
@pixegami 2 года назад
Thanks! Data analysis is popular in Python so it’s definitely something on my list for sure.
@camobeast
@camobeast 2 года назад
A really well made tutorial, thx mate
@minecraftwithjpizza9929
@minecraftwithjpizza9929 2 года назад
Thanks This Was Awesome!
@daddykimjongun7777
@daddykimjongun7777 2 года назад
Nice video pixegami, thanks a lot 👍
@pixegami
@pixegami 2 года назад
Glad you liked it!
@vishsinghania
@vishsinghania 2 года назад
great tutorial ✌
@j4n685
@j4n685 2 года назад
Hey man I love your content! But I have a problem in my Cody where it does not tell me if the letter is in the secret Word. I have looked over the code for an half an hour but I dont see the difference between your code an mine. But you are still a very good teacher. Thank you that you uploud such tutorials!
@joshuafoster8698
@joshuafoster8698 2 года назад
great tutorial, are you using a terminal theme?
@pixegami
@pixegami 2 года назад
Yup! I'm using OhMyZsh on top of my regular bash terminal (github.com/ohmyzsh/ohmyzsh). If you are using Mac, then you can use OhMyZsh in iTerm2 as well. The theme I use is github.com/agnoster/agnoster-zsh-theme --- but I changed some colors to suit me more.
@9horhay
@9horhay 2 года назад
Great video! Slight bug in the code, in your example of the secret being APPLE, and guessing HELLO, the first L should be gray.
@pixegami
@pixegami 2 года назад
Thanks for pointing this out! Here is a commit to fix it: github.com/pixegami/python-wordle/commit/d9b0d993de51c2ef3f59691ca4b9193fa27d0380
@explode30able
@explode30able Год назад
I am using pycharm for my ide and I am running into problems when I try to do the convert word list around the 48 min mark. I have done what you have, but keep getting errors that the file does not exist.
@colekaplan895
@colekaplan895 2 года назад
Great tutorial! Can you do a video of how to make a game like 'poeltl' it's a different concept of wordle but with NBA players. Just a suggestion
@pixegami
@pixegami 2 года назад
I wasn’t sure how that would work since I’m not familiar with NBA, but I checked it out and it was pretty interesting. Similar concept with some tweaks.
@ryze3024
@ryze3024 2 года назад
18:32 - Letter States Or Lettuce States?
@abhishekgarg8769
@abhishekgarg8769 8 месяцев назад
HEY i have a question that can i add this project into my resume and if i can than what details i must specify ? btw love the project, was able to brush up my python knowledge 😅
@pixegami
@pixegami 7 месяцев назад
If you coded up the project, then I think it's great addition to your resume. But definitely look for ways to improve it and make it your own as well.
@joefagan9335
@joefagan9335 2 года назад
I’m trying to understand about classes and when to use them. Is there a good reason to use classes in this coding project?
@pixegami
@pixegami 2 года назад
Generally, I prefer to avoid classes if possible (because they are stateful). “Functional programming” style is usually easier to test and maintain long term, so its better for big projects. However, classes are still widely used (especially in games development), and can be more intuitive to understand - so I did use it in this project (and will probably do in a lot of future projects too).
@coneilcoley4139
@coneilcoley4139 2 года назад
hey there trying to create a clone myself however a bit stuck would you be able to take a look? getting an error im not sure how to fix
@pixegami
@pixegami 2 года назад
Where did you get stuck? If you send me a GitHub page then I can take look.
@droopybeagle
@droopybeagle 2 года назад
Could i do this all within a single .py file rather then using muiltiple files? Also i'm not too confident with using classes yet, is this easy enough to be replaced with just using functions? Would you be able to give me an example if so? Thank you for your help, the point i've got to so far in the tutorial is very helpful! I'm going to try and modify and make this to my own requirements so that i'm not directly copying :)
@pixegami
@pixegami 2 года назад
Generally speaking, *any* program that is implemented using multiple files and classes (OOP) can be also implemented using just pure functions --- and this one is no different. I don't think I have time to prepare an example soon, but it's a good idea and I might do a video for it in the future. To convert this to a functional model, you would no longer have a class - so those fields in the classes need to become a 'state' that you pass from function to function.
@seshalayagandham2528
@seshalayagandham2528 2 года назад
i want to use this as my college project work. If I use this same code will it show copy right issue
@pixegami
@pixegami 2 года назад
I recommend strongly *not* to use this as your college project. Not because of copy-right issues (the code itself is open source and free to extend), but because Universities have advanced tools that can detect plagiarism, even if you change the variables or structure of the code. But more importantly, if you just copy the code here, you won’t learn anything and your credential will not be a true reflection of your skill, which will come back to bite you one day. I DO recommend you watch the video and code along, and then for your project you can try to implement it from scratch from your own knowledge. :)
@robtaylor5769
@robtaylor5769 2 года назад
What vs color theme is this?
@pixegami
@pixegami 2 года назад
Monokai Pro: monokai.pro/ I’ve been using this for a while! I really love it, and they have it for the JetBrains IDE as well. I also like “Nord” theme,
@BroSience.c
@BroSience.c 2 года назад
What color theme are you using?
@pixegami
@pixegami 2 года назад
For my IDE (VSCode) I'm using Monokai Pro: monokai.pro/ and for my terminal, I'm using the Agnoster theme for Zshell, but I customized it a bit: github.com/agnoster/agnoster-zsh-theme Since this is quite a common question I plan to make a video to how my terminal and IDE setup.
@BroSience.c
@BroSience.c 2 года назад
@@pixegami thank you so much!!
@BroSience.c
@BroSience.c 2 года назад
What IDE are you useing?
@pixegami
@pixegami 2 года назад
VSCode: code.visualstudio.com/ It's free and quite versatile!
@BroSience.c
@BroSience.c 2 года назад
@@pixegami what color theme are you using?
@pradeeppawar3622
@pradeeppawar3622 2 года назад
Build GPT3 Powered landing page generator
@pixegami
@pixegami 2 года назад
Interesting idea, I shall add it to my list :)
@nodroGnotlrahC
@nodroGnotlrahC 2 года назад
I believe you got the logic wrong when calculating the results for each guess. If the secret is APPLE and the guess is HELLO you will colour the tiles Grey Yellow Yellow Green Grey, which implies that the letter L appears twice in the word APPLE, once in an incorrect position and once in the correct position. This is not how Wordle behaves. The game would colour the tiles Grey Yellow Grey Green Grey. This is now the sixth "let's make a wordle clone" video I have watched, and every single one has got this wrong. 😞
@pixegami
@pixegami 2 года назад
Ha, looks like everyone fell into the same trap. I honestly didn't consider this behavior, and you're absolutely right - thanks for pointing this out. I can't edit the video so I pinned a comment with the fix, as well as a link to someone else's video explaining this buggy behavior. 👍
Далее
2 YEARS of PYTHON Game Development in 5 Minutes!
4:54
Просмотров 868 тыс.
Which national team are you rooting for at Euro 2024?
00:17
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
Wordle Champion - Coding Perfect Wordle Ai
13:10
Просмотров 10 тыс.
Wordle in JavaScript in 20 minutes
18:02
Просмотров 21 тыс.
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
Text-Based Wordle in Python under 15 Minutes!
21:03
Просмотров 15 тыс.
25 nooby Python habits you need to ditch
9:12
Просмотров 1,7 млн
Solving Wordle using information theory
30:38
Просмотров 10 млн
Rust Data Modelling Without Classes
11:25
Просмотров 165 тыс.
Which national team are you rooting for at Euro 2024?
00:17