Not only does he teach you how to code. He teaches basic theory and how to break down problems like a programmer. Tim, this is why you're at the top bro. Great video.
Tim, just as a side note: I think the positions of the bombs are determined after your first click, since your first click should always uncover a safe field
In original minesweeper, it is possible on first click to click on a bomb, so keeping with tradition I would say code your bombs before your first click
@@dalevanderzee4086 bruh I’m coding a full minesweeper for a school project and I spent like hours trying to have the board fill after the first click…
I really enjoyed this - watching you code a real project and following your journey was really cool! This reminds me of those old 12-hour livestreams you used to do - would definitely love to see more of these types of videos!
Thank you Tim ! I am following your programming expert course and so far I am loving it ! I really hope to build crazy stuffs like you using python someday
The adjacent tiles should only be revealed if you click a tile with 0 adjacent mines (or if you double click a revealed tile). So the uncover function can be done really simply with recursion, by adding a check if the field value is 0 and then uncovering that tile's neighbors.
Great work Tim! definitely wrap up this project and I'd say explain a bit about how you implemented DFS algorithm to expand when you click as I believe that the most challenging part of the project is implementing that correctly.
Love it. Minesweeper is such a fun coding challenge. Sudoku, wordle, solitaire, they're all great ways to mess around and develop. Keep doing what you're doing. -Stan
I made a minesweeper game for my ap computer science class in highschool, still one of my most memorable projects. It definetly took longer than an hour though lol.
I really enjoyed this - great format! It feels like one of the six hour marathon videos but with a more structured approach. I also like Tim's coding style - I often get stuck trying to make ugly concise code. Tim videos remind me to keep my code readable!
Very awesome tutorial, though I WOULD have wished if you were able to finish the challenge in another video, if possible. I know this is an old video, but it would still be awesome. My own opinion.
Lol the bug right at the end, I wondered if that would ever show itself. Also the ability to just flag uncovered tiles and recover them was pretty funny I thought
set board boundaries and max bombs randomize the placement of bombs, append to a list of the form ["row.col"] - ensure same board square is only used once determine the bomb counts touching each board square , save in a separate dictionary of the form ["row.col", count] set the board & squares, naming each square in the form "row.col", setting each image to BLANK set right click and left click event listeners for each board square wait for user input: LEFT CLICK - if no touching bombs, expand selection until board boundaries and until first square touching bombs using recursion! - if selection is a bomb, you LOSE! RIGHT CLICK - keep flags and ? in separate lists of the form ["row.col"] - if board square BLANK, set image to FLAG, and if all bombs have been flagged, you WIN! - if board square FLAG, set image to ? - if board square ?, set image to BLANK
First you should get your basics done (html, css, js) then write something with an external api and get a feel for it, then you could start outsourcing your logic to your backend. Which could be something like django.
I'm attempting to follow along with what you're doing in this video but when trying to just run the blank window, as you do around 6 minutes into the video, I get an error saying: pygame.error: video system not initialized Any help with this would be appreciated. I've been looking online for a solution but havent been able to fix this exact issue. Thanks
@@TechWithTim I fixed it. Just started over and it worked the second time. I must have just had some other error in the syntax somewhere else. Thanks, Tim! love the content as usual.
What a great project and tutorial! I believe that more often than not people learn so much more from a project like this, especially when they can see it being developed from scratch so they can follow along on a second screen, than by reading some formal book on how to code. 💻 >>> 📖
First program your own tic-tac-toe game, in the console. That should not be too hard, then refactor your code using more functions, less nesting etc. and maybe try programm paradigms like OOP. If you finished it, you could start implementing an algorithm to play against you, or you could focus on design, and implement it in pygame with a GUI. If you finished that, you could try to build an even more complex game, like connectFour or Monopoly, stick to your things that worked on your tic-tac-toe game, and you will get it done. Some tips: At all cost separate your IO from your logic → implement functions to read from the console and don't do it in your main logic code. Send a person your code on discord servers and ask for feedback. And most importantly keep focused, and don't spend your time watching UA-cam videos, of people programming, get YOUR hands dirty. Hope it helps, GL :)
Hi! Please teach email preferences center templates for a contact page. I recently lost a job opportunity to work making html templates. I look for templates over youtube but couldn’t find one they like
a) not entirely sure what you're asking for. b) if you aren't even able to change things in tutorials to suit your needs, which is pretty basic, then you aren't really learning. This applies not just to coding but to everything. You're not learning anything at that point, you're just mindlessly copying someone else's work. Reevaluate your learning methods and make changes, even if it makes it more challenging for you. And try to stop relying on tutorials by using documentation instead.
i kind of feel like python is really cheaty cuz you can just use all these libraries like pygame and turtle to lay the groundwork for you instead of actually having to understand how it works
@@nogr3369 i get you, but im wondering: do other languages like C++, java, javascript, etc. have these kinds of libraries? you can literally make a game so easily with python because all the dirty work is already done for you by turtle and pygame, do such tools exist for other languages? if they do, then I guess its not so bad. Im moreso worried about this because I want my experience with python to carry over to new languages hwen I eventually move on to them
@@dittery I understand the concern, and it is important to understand how things work instead of just blindly using them. The problem is, sometimes those things are really complex and would take a lot of time to understand and implement on your own, making it incredibly time consuming to complete any project. Thus, libraries are a common thing in pretty much every single programming language from Python to C and the good ones will have documentation you can use to get a better understanding of how the code works.
Wow, this is a terrible way of coding a minesweeper game. Also, I wouldn't do this as a 2D array, that's like the childish thinking way. The array should be flat.
@@TechWithTim Not superior, but I have been coding games at well known software house for, eerrm, wow, nearly 13yrs now. And yes, I am OLD. Okay, flat array... You think of a 2D array like it has an X and a Y coordinate, but that's not how it actually is. A 2D array is layed out contiguously in memory, or at least it is in C++, not sure how the Python interpreter does it. So let's say you have an 8x8 2D array... Like say, a[8][8]. What would happen if you did, and I'm not sure what the syntax is for Python, but a[8] = 1. This should be equivalent to a[1][0] = 1. So you don't treat your array like it has two dimensions, but has a contiguous length of 64. Do you see where I'm going with this?
@J Hemphill I nearly died laughing at your comment. Although I have to be careful when laughing, since the company I work for was responsible for a very public lootbox controversy.
What should I challenge myself to code next? Let me know!
Monkey Type Clone !!!
You should make an algebraic equation solver GUI.
Snake in an hour
Ludo in 2 hour
AI Caro in an hour!
Not only does he teach you how to code. He teaches basic theory and how to break down problems like a programmer. Tim, this is why you're at the top bro. Great video.
Tim, just as a side note:
I think the positions of the bombs are determined after your first click, since your first click should always uncover a safe field
Good note! I am clearly not a very experienced minesweeper player lol
In original minesweeper, it is possible on first click to click on a bomb, so keeping with tradition I would say code your bombs before your first click
I agree with Dale--it is possible to click on a bomp at the get-go. Also, I don't think the original minesweeper has a limit on the number of flags.
@@dalevanderzee4086 bruh I’m coding a full minesweeper for a school project and I spent like hours trying to have the board fill after the first click…
Would love to see this seen through final debug, optimization, adding animation, etc.
Thanks, Tim. I started to learn Python a week ago. You're motivating me!
I really enjoyed this - watching you code a real project and following your journey was really cool! This reminds me of those old 12-hour livestreams you used to do - would definitely love to see more of these types of videos!
Thanks for the tutorials Tim, the pygame videos were also very exciting!
Would really love to see the continuation video tim , big up for this much progress though!
Thank you Tim ! I am following your programming expert course and so far I am loving it ! I really hope to build crazy stuffs like you using python someday
The adjacent tiles should only be revealed if you click a tile with 0 adjacent mines (or if you double click a revealed tile). So the uncover function can be done really simply with recursion, by adding a check if the field value is 0 and then uncovering that tile's neighbors.
Great work Tim! definitely wrap up this project and I'd say explain a bit about how you implemented DFS algorithm to expand when you click as I believe that the most challenging part of the project is implementing that correctly.
Love it. Minesweeper is such a fun coding challenge. Sudoku, wordle, solitaire, they're all great ways to mess around and develop. Keep doing what you're doing.
-Stan
Had lot of fun watching this video, looking forward for more videos like this! :)
This kinda videos are motivating us and inspiring us to learn coding 🤩, thank u bro 👍
Thanks for the vid!
Maybe a fun sequel to these would be to show us how you would refactor it into perfectly polished, distributable code?
Tim you are an amazing coder and a terrible mine sweeper XD thanks for the vid!
The video idea reminds me of The Coding Train! Keep up the great work.
i really like the..."ok maybe more difficult game that hard that its look..."
THE BEST UA-camR EVER !!!!thx a lot tim
I've been trying to learn object oriented programming in python, and this is really fun to watch!
I made a minesweeper game for my ap computer science class in highschool, still one of my most memorable projects. It definetly took longer than an hour though lol.
Yes, please complete this video, and then do a video of how you would do it correctly if you had more time.
I really enjoyed this - great format! It feels like one of the six hour marathon videos but with a more structured approach. I also like Tim's coding style - I often get stuck trying to make ugly concise code. Tim videos remind me to keep my code readable!
When playing the game at 56:35, you are forgetting the numbers represent the number of bombs in adjacent cells _including on the diagonal_!
Anybody else realise that when he replaced all "MINES" with "BOMBS" at 34:50 he changed the window caption to "BOMBSweeper"? Lol, great video though
Lol
Tim can make a social media clone, chat app, Pygame golf game, etc
good idea
Very awesome tutorial, though I WOULD have wished if you were able to finish the challenge in another video, if possible. I know this is an old video, but it would still be awesome. My own opinion.
I love how you can code Minesweeper but are really bad at the game itself :D (And that's putting it mildly)
Haha agreed. I never really played it.
I love whenever Tim goes "WOW"
Lol the bug right at the end, I wondered if that would ever show itself. Also the ability to just flag uncovered tiles and recover them was pretty funny I thought
Hi Tim!
What plugin did you use (32:10)?
I was searching for this comment
I found it , it is called Grepper
@@karamkassem9821 Thank you
Your talent is something else
This is a great tutorial.
Can you please break it down for beginners? If possible.
set board boundaries and max bombs
randomize the placement of bombs, append to a list of the form ["row.col"] - ensure same board square is only used once
determine the bomb counts touching each board square , save in a separate dictionary of the form ["row.col", count]
set the board & squares, naming each square in the form "row.col", setting each image to BLANK
set right click and left click event listeners for each board square
wait for user input:
LEFT CLICK
- if no touching bombs, expand selection until board boundaries and until first square touching bombs using recursion!
- if selection is a bomb, you LOSE!
RIGHT CLICK
- keep flags and ? in separate lists of the form ["row.col"]
- if board square BLANK, set image to FLAG, and if all bombs have been flagged, you WIN!
- if board square FLAG, set image to ?
- if board square ?, set image to BLANK
It would be awesome if you could code a 8 puzzle or 15 puzzle game next
I get invalid color argument when using "white" or "black" as definitions and have to use the RGB values. How are you able to just use the word?
thx a lot tim for this huge thx to you continue
when are this live coding challenges will come back ?
Is mathematics important in programming or not? Can you do better when math is bad
Please answer me
are you interested in making a no guessing mode for minesweeper?
An idea for another coding challenge - Bulls And Cows game + solver.
Please create a top down shooter game in pygame, a classic arcade game
i would like to see the full game programimg
You can use event.key, event.pos, event.button instead of pygame.key.get_pressed()
it is more clear that is from the specific event
omg i learned how to play mine sweaper yesterday and this video was uploaded yesterday
Thank you
Please make more video like this
it would have been useful to know how the game is played :D anyway, nice video
Hey tim, what would you suggest web dev with django or web dev in the classic method?
First you should get your basics done (html, css, js) then write something with an external api and get a feel for it, then you could start outsourcing your logic to your backend. Which could be something like django.
How is Tabnine guessing the majority of lines of your code?
I'm attempting to follow along with what you're doing in this video but when trying to just run the blank window, as you do around 6 minutes into the video, I get an error saying:
pygame.error: video system not initialized
Any help with this would be appreciated. I've been looking online for a solution but havent been able to fix this exact issue.
Thanks
Type Pygame.init() right after u import it
@@TechWithTim It's in there.
I have the first two lines of code
1 import pygame
2 pygame.init()
@@TechWithTim I fixed it. Just started over and it worked the second time. I must have just had some other error in the syntax somewhere else.
Thanks, Tim! love the content as usual.
13:45 hmmm... i wonder what you were about to type subconsciously...
Hi Tim, what auto completion are you using?
I think kite or tabnine
What a great project and tutorial! I believe that more often than not people learn so much more from a project like this, especially when they can see it being developed from scratch so they can follow along on a second screen, than by reading some formal book on how to code. 💻 >>> 📖
this is a good stuff 😀. can you make a course about unity game engine plz
it help me a lot
Sometimes on my first click bombs are being uncovered. Does anyone have a solution? (Great video BTW :))
Which autocompleater does he use?
tabnine
where is the github of this project?
Hi Tim, I wonder if I can feature my channel on yours. I can make some videos about really cool animations in React Native 😉
Great video but you really have to practice playing minesweeper haha !
Nice video!
how to make web 3.0 website in python 🙂
please make a zombie hunter game
Do it in java next time. Great video overall!
Make a bot which replies in facebook messenger with some quick replies or buttons.
Bro codes minesweeper in an hour, while I take an hour to center a div
Tim I am stuck with the basics of python
Please help me please please thank you so much
First program your own tic-tac-toe game, in the console. That should not be too hard, then refactor your code using more functions, less nesting etc. and maybe try programm paradigms like OOP. If you finished it, you could start implementing an algorithm to play against you, or you could focus on design, and implement it in pygame with a GUI. If you finished that, you could try to build an even more complex game, like connectFour or Monopoly, stick to your things that worked on your tic-tac-toe game, and you will get it done. Some tips: At all cost separate your IO from your logic → implement functions to read from the console and don't do it in your main logic code. Send a person your code on discord servers and ask for feedback. And most importantly keep focused, and don't spend your time watching UA-cam videos, of people programming, get YOUR hands dirty. Hope it helps, GL :)
How about Jezzball
Its gray in us and everywhere else its grey. WEIRD. Thats probably why you forget xd
Legendary
I liked this.
watching him try to play is infuriating but otherwise grate tutorial haha
You could speed run tic tac toe against another player or computer, and give yourself like 30 minutes to do it?
Too many magic numbers - can tell when you are adding comments to if lines.
Hi! Please teach email preferences center templates for a contact page. I recently lost a job opportunity to work making html templates. I look for templates over youtube but couldn’t find one they like
a) not entirely sure what you're asking for.
b) if you aren't even able to change things in tutorials to suit your needs, which is pretty basic, then you aren't really learning. This applies not just to coding but to everything. You're not learning anything at that point, you're just mindlessly copying someone else's work. Reevaluate your learning methods and make changes, even if it makes it more challenging for you. And try to stop relying on tutorials by using documentation instead.
My Python skill is like your mines skill lol.
lol
epuic
That's so cool...
✅✅✅✅✅✅
@J Hemphill
Oh... I didn't know about emoji part...
For the algorithm
institution management system
#
tim will heart this :>
i kind of feel like python is really cheaty cuz you can just use all these libraries like pygame and turtle to lay the groundwork for you instead of actually having to understand how it works
No need to reinvent the wheel.
@@nogr3369 i get you, but im wondering: do other languages like C++, java, javascript, etc. have these kinds of libraries? you can literally make a game so easily with python because all the dirty work is already done for you by turtle and pygame, do such tools exist for other languages? if they do, then I guess its not so bad. Im moreso worried about this because I want my experience with python to carry over to new languages hwen I eventually move on to them
@@dittery I understand the concern, and it is important to understand how things work instead of just blindly using them. The problem is, sometimes those things are really complex and would take a lot of time to understand and implement on your own, making it incredibly time consuming to complete any project. Thus, libraries are a common thing in pretty much every single programming language from Python to C and the good ones will have documentation you can use to get a better understanding of how the code works.
Нихуя не понятно, но очень интересно
First view 😉
second
Nice try
First comment 🥳🥳🥳🥳🥳🥳🥳
pagal bna rhe hai ye
WHY ARE YOU SO BAD AT SEEING DIAGONALS?
Never been more frustrated at watching someone play minesweeper
Nice coding, but you do not know anything about Minesweeper.
Wow, this is a terrible way of coding a minesweeper game. Also, I wouldn't do this as a 2D array, that's like the childish thinking way. The array should be flat.
How would you represent it as a flat array? I’m curious what your method would be consisting you are far superior to me.
@@TechWithTim Not superior, but I have been coding games at well known software house for, eerrm, wow, nearly 13yrs now. And yes, I am OLD. Okay, flat array... You think of a 2D array like it has an X and a Y coordinate, but that's not how it actually is. A 2D array is layed out contiguously in memory, or at least it is in C++, not sure how the Python interpreter does it. So let's say you have an 8x8 2D array... Like say, a[8][8]. What would happen if you did, and I'm not sure what the syntax is for Python, but a[8] = 1. This should be equivalent to a[1][0] = 1. So you don't treat your array like it has two dimensions, but has a contiguous length of 64. Do you see where I'm going with this?
@J Hemphill I nearly died laughing at your comment. Although I have to be careful when laughing, since the company I work for was responsible for a very public lootbox controversy.
Uncover_from_pos would’ve been good to be recursive, you just need to make sure you don’t need to uncover an already uncovered tile
Start_time should be time.time()