Learning Python by Coding Chess
Vložit
- čas přidán 25. 07. 2024
- I wanted to learn to program, so I set a goal of learning Python by coding chess. These are my thoughts after the fact.
You might notice from my Github graphic that I took several extended breaks from coding. That made the time to complete this portion of my project just over half a year. If you're learning to code, or take up any new skill, remember... you don't have to do it all at once. It's okay to take a break. You're making progress. If you're stuck contemplating if you should try or not, I assure you it is never too late to start.
Join me.
Download the Python language: www.python.org/
The Python Bible: www.udemy.com/course/the-pyth...
How to Think Like a Computer Scientist - Interactive Edition: runestone.academy/runestone/b...
Note: There are two versions of How to Think Like a Computer Scientist. One covers C++, the other one covers Python (which is what I used). Make sure to select the "Interactive Edition" if you also want to learn Python. The URL will include "thinkcspy" rather than "thinkcpp" when you do.
-- Attributions --
Intro:
yellow-lighted arch tunnel road by Daniel Jerez from Unsplash
bit.ly/2WBvctq
bit.ly/3fYOoJD
metal nut isolated on white background by Scrudje from Shutterstock
shutr.bz/3jnY6qU
shutr.bz/32APreD
Door Slam 2.wav by lyd4tuna from Freesound under CC0 1.0
bit.ly/3juwNeL
bit.ly/3hd7xrc
bit.ly/2CQOdRS
BleachHit.wav by eardeer from Freesound under CC0 1.0
bit.ly/3jxyhF0
bit.ly/32FohTY
bit.ly/2CQOdRS
Music (in order):
1) Description
2) Song
3) Artist
4) Download
5) License
100 Steps by Le Gang from Soundcloud under CC BY 3.0
bit.ly/2ZcvskF
bit.ly/3e6Y4Qj
bit.ly/3fbWxtB
bit.ly/2OGVg23
Strangers by Le Gang from SoundCloud under CC BY 3.0
bit.ly/2DhI0yp
bit.ly/3e6Y4Qj
bit.ly/2CjN70r
bit.ly/2OGVg23
Money Go Round by Le Gang from SoundCloud under CC BY 3.0
bit.ly/39gGVTi
bit.ly/3e6Y4Qj
bit.ly/3fO16KP
bit.ly/2OGVg23
I Don't Need U 2 Say Anything by Le Gang from SoundCloud under CC BY 3.0
bit.ly/2Z97kPS
bit.ly/3e6Y4Qj
bit.ly/2Z5lfWS
bit.ly/2OGVg23
I Am Thou (no drums) by arvnd from SoundCloud under No Copyright
bit.ly/3gzyTaK
bit.ly/2O1I3AA
bit.ly/3gzyTaK
I Gave You A Flower by Le Gang from SoundCloud under CC BY 3.0
bit.ly/3fPmL5E
bit.ly/3e6Y4Qj
bit.ly/2OEkez6
bit.ly/2OGVg23
Drops In Mind by Le Gang from SoundCloud under CC BY 3.0
bit.ly/3e42B5X
bit.ly/3e6Y4Qj
bit.ly/38IJZrm
bit.ly/2OGVg23
Graphics:
1) Description
2) Download
3) Artist
yellow-lighted arch tunnel road by Daniel Jerez from Unsplash
bit.ly/2WBvctq
bit.ly/3fYOoJD
metal nut isolated on white background by Scrudje from Shutterstock
shutr.bz/3jnY6qU
shutr.bz/32APreD
Guy at computer stock photo by Andrea Piacquadio from Pexels
bit.ly/2ZKIoOH
bit.ly/3eMeE8n
Tic Tac Toe by nemo frenk from Pixabay
bit.ly/2E3vB1x
bit.ly/30yHTXr
Wall-E from Free PNG Img
freepngimg.com/png/23233-wall...
Brick wall from Free SVG
freesvg.org/red-brick-wall-wi...
Soldering by Phil Gradwell from Flickr / CC BY 2.0
bit.ly/39hZ2IS
www.flickr.com/photos/philgra...
creativecommons.org/licenses/...
Approved/Denied stamps by rocketpixel from Freepik
bit.ly/39bKE4P
www.freepik.com/rocketpixel
San Diego harbor by big.tiny.belly from Unsplash
unsplash.com/photos/1Xw7GWnivl4
unsplash.com/@bigtinybelly
Portland marquee by peter bucks from Unsplash
unsplash.com/photos/4A56VJzKh2c
unsplash.com/@peterbucks
Harry Potter chess scene by Warner Bros. from Harry Potter and the Sorcerer's Stone
www.warnerbros.com/movies/har...
Explosion by nalmaran from GIFER
gifer.com/en/3iCN
gifer.com/en/user/356887
Python logo by Python from Wikimedia Commons
upload.wikimedia.org/wikipedi...
www.python.org/
Sound Effects:
1) Description
2) Download
3) Artist
4) License
Door Slam 2.wav by lyd4tuna from Freesound under CC0 1.0
bit.ly/3juwNeL
bit.ly/3hd7xrc
bit.ly/2CQOdRS
BleachHit.wav by eardeer from Freesound under CC0 1.0
bit.ly/3jxyhF0
bit.ly/32FohTY
bit.ly/2CQOdRS
large explosion 2 by V-ktor from Freesound under CC0 1.0
bit.ly/39dkfU9
bit.ly/2ZPuYBj
bit.ly/2CQOdRS
Outtake Beep-1k.wav by slappy13 from Freesound under CC0 1.0
bit.ly/39ei7LI
bit.ly/3fP6r4A
bit.ly/2CQOdRS - Věda a technologie
Oh but did you add the doble jump of the pawns, the en passant rule and draw conditions (such as 50 moves rule, tree fold repetition and insufficient material)? If not HOW DARE YOU CALL THAT CHESS!!! Haha jk amazing coding journey.
Oh no, I've been caught! I implemented the double jump, en passant, and the 50 moves rules, maybe even three fold repetition (can't remember off the top of my head), but not the insufficient material condition. HOW ON EARTH COULD I HAVE OVERLOOKED THAT?? I've failed you, dear viewer. From the bottom of my heart, I am so sorry.
I like you're detailed thinking. I was programming in as much functionality as I could in order to better learn Python. Took a while, and it was well worth it. Glad you enjoyed!
Nice job dude looks like 500k subs quality, only thing I would change is try to be a little bit more concise. But only a little it looks great. Also it really helped.
Made my morning. =) Thank you so much! I completely agree. Even though I'm still new, I already consider my first few videos "early works" to be improved on. Namely, focusing down the interesting/important parts as you said. I attempted that with my latest video about my Galaxy Watch charger. Perhaps that's more in line with what you're envisioning. Thanks for the feedback, it really helps me make better videos in the future.
Hi! Nice job! I come from your second video and I think that the combination of both type of content is the best. You did a very good job on both! My congratulations! Don't hesitate to contact me for anything related to coding xD
Thank you so much, and I will! It was a long journey to learn coding basics, and well worth it. I'm so excited for future projects where I can utilize Python. Such a great language for beginners (not that I know many others, but still). I love combining hardware with my basic coding knowledge, so plan on seeing more of that here in the future!
Oh man, I love your videos 😍 Keep going
Thanks so much Jakob! I've got a huge smile on after reading that. I definitely will; I'm just getting started. Did some filming on my next project today actually! Sneak peek: it involves wireless communication and smacking various objects together. Can't wait to share it with you.
@@HardwareUnknown Yeah, that sounds great!!
Wow. That was an honor to watch. You set your mind on a goal, you were sincere and displayed persistence. The result speaks for itself. Inspiring. BTW I was cracking up at the mention of exercising then it switches to slouching and eating ice cream. hahaahaha
That was my favorite joke in the video, glad you enjoyed. 🙂
It took a long time to get to that point with Python, I believe about 280-300 hours of learning, programming, testing, and making changes. For somebody new to coding, it was a lofty goal to set at the start, but I knew I wanted to stick with it. It gave me a lot of problems to solve, with some definition to the solution, and that helped me guide my learning efforts.
Thanks for your compliments, I hope you stick around. Many more projects to come. Enjoy some of my recent videos as you wait! I've worked on improving the quality a lot and I think you'll enjoy.
@@HardwareUnknown No problem. Hope to see you grow. I'll definitely be part of the journey :)
This video has some great tips for beginners.
I appreciate the feedback. As a beginner myself it's nice to know what I'm putting out there could be useful for others.
nice job man.. keep it up
Thank you so much. I will! More videos coming soon.
loved ur video
Thank you! Python is really fun to code in. I want to learn more about it and take this project further in the future, as well as implement coding elements to other projects using Raspberry Pi.
Great video. I wonder if you share the code as well 😉
Glad you enjoyed! I share code for several of my projects (Github link is on my channel page). For this one I still have more plans, so for now I'm holding onto it. However, I know there are other released chess code projects out there if you're looking to get ahold of one immediately.
How many working hours did it take you to complete the project?
I had never coded in Python before this and out of curiosity I actually tracked my time spent learning. Between watching tutorial videos, doing the exercises, and coding chess to the point I currently have it, I logged 233 hours.
It was a big effort, and well worth it. It's helped me better understand Arduino code, and has me excited for my next Python project. I'm hoping to make use of a Raspberry Pi in a future build.
@@HardwareUnknown oh wow okay, thanks for answering :)
Of course! I love answering questions about my builds. Always ask.
Good luck using tkinter! Maybe try pygame or opencv.
Thank you! I haven't heard of opencv, but I was considering pygame. Does one of the three have an advantage of the other for allowing a beginner to make a basic graphical game?
but ... no code?
Not yet on this one. I've got future plans for this. However, there are others available from various developers that are better/more completely designed.
@@HardwareUnknown Ok, well I just wanted to read through it just to see it and try to see what you were talking about with your classes and all.
My mistake; from your original comment I assumed you were looking for a polished game.
I've uploaded the code to Github so you can look through it. I was (and still am) new to Python, so things might be messy or not ideally written but it'll give you an understanding of my process.
Here's the link: github.com/hardwareunknown/public/tree/main/python-chess
@@HardwareUnknown thanks man!
Of course, let me know if you find anything interesting!