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
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
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.
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!
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.
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
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.
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. 💻 >>> 📖
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
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.
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.
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 RU-vid 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.