Project: Coding a Wordle game in C
Vložit
- čas přidán 29. 08. 2024
- This is a beginner-to-intermediate friendly project (almost no pointers!) and I think it will be interesting even for my most advanced viewers. We are building a game! First time, right? Second maybe. Anyhow, it's the Wordle game where you guess 5 letter words and get clues in the form of colors.
In this episode you will learn how to structure a gameloop, divide everything in small, effective functions, each with one stated purpose. You will also learn how a project might grow, become cumbersome and mess up your structure.
This is the first episode out of two. The 2nd will probably be released Saturday, or next week.
JB
This was a fun video to watch. Duplicate letters are the hardest part of coding Wordle. For example, if the correct word is candy and the guess is salad, the first 'a' will be green, of course, but the second has to be red, gray, or whatever is used to represent no match.
You're right of course, Charles, I didnt think of that. Perhaps there will be an ep03 where I try to fix it. JB
Coming from a CS student pursuing a PHD, your a GODSEND brotha man. Your so fuckin good, and useful to watch it’s CRAZY you don’t have millions of followers
Hehe in due time, my friend, in due time... :) Thank you so much for those kind words, I am glad you like my videos. Take care, JB
This project was good. I enjoyed making this game. since i was able to understand every single thing. here. Amazing video
Thats great Yash, Im glad that you appreciate this new format. I will be doing more videos of this kind. Take care, JB
This is how C should be written and taught ! Another great video Dr Birch ! Just out of curiosity, what motivates you write and teach C code ? There is C++/Rust/Java out there but I do not think you care for those very much...
Thank you Max, Im glad you like my work. And you're right, those languages (even though they are well-designed languages) do not speak to me the way C does. I like the unhindered access and power of low level languages. That being said, I do also appreciate functional code, such as Haskell, and even JS/Typescript when I need to do web. Take care, JB
@@dr-Jonas-Birch Fair enough ! Thank you for all your efforts !!!
Cheers, JB
No less than 5 characters in the words of the initial list file. Some of them just contain space ascii characters...
You could regex just a-zA-Z.
Yes Morhan, you are correct and I figured it out eventually. Maybe it was in ep02. Great minds think alike, right? :) Take care, JB
Excellent work, keep it up prof.
Thank you Khaled, Im glad you like it. Take care, JB
New learner here , its really helpful
Welcome Buck to this channel, Im glad you like it. Take care, JB
in C you can do
MyStruct myVar = {...}
but you can't do
MyStruct myVar;
myVar = {...}
You have to use what is called a "compound literal", which looks like you are casting the {...}
MyStruct myVar;
myVar = (MyStruct){...}
I think this added in C99
Im aware. In C99 you can also declare variables anywhere in your code, not only in the beginning of the function. BUT that does not mean you Should. :) JB
Thanks ❤
You are very welcome Rafi, Im glad you like my stuff. Take care, JB
❤❤😊
hehe thank you itscode, take care
just an advice to upload videos in 1.5x speed, it becomes more catchy
There are enough of "catchy" videos out there. To this channel one comes to relax and permit yourself to let things take its time. Instead of rushing through it. Really underrated behavior imo. JB
The settings has a playback speed option.