How to code a command-line Minesweeper in Python (using recursion) | Beginner Python Tutorial

  Рет қаралды 30,876

Kylie Ying

Kylie Ying

Күн бұрын

Пікірлер
@KylieYYing
@KylieYYing 4 жыл бұрын
What other games have you implemented in python?? Code (+ empty template) is here: github.com/kying18/minesweeper/ Check out Backlog!! cutt.ly/ehxImv5
@dooostie1257
@dooostie1257 4 жыл бұрын
I am currently doing 100 days of coding course. So far I've made a text adventure implementing if/else statements. It was rather nice. So I'm currently implementing my own text adventure to hopefully publish on green light for steam.
@jamesplazgames233
@jamesplazgames233 3 жыл бұрын
Traceback (most recent call last): File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 212, in play() File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 188, in play print(board) File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 133, in _str_ if(row,col) in self.dug: UnboundLocalError: local variable 'row' referenced before assignment. I looked up some stack overflow post and it mentioned how if you try to use a varible defined in a function outside of it, it wont work, so idk. Its late here so imma try to work on it again tommrow. Will edit when I find solution. If you have any ideas pls leave in comments!
@miguelandrade4439
@miguelandrade4439 Жыл бұрын
Just finished my first fist respectable program,; a command line 2048. Really fun to make!
@willbuffie6098
@willbuffie6098 4 жыл бұрын
Not only do you teach coding in python, but you also teach the necessary mindset for programmer. Thanks for the instructive lesson!
@Blackice929
@Blackice929 2 жыл бұрын
I love that you pseudocode in your videos, this makes a HUGE difference between you and other KZbinrs - it really helps hone in on the mechanics and mindset a coder needs, plus it make the concepts easier to follow! Brilliant work as usual! 🔥💛
@breaking3837
@breaking3837 2 жыл бұрын
💯💯
@evarosesummerfield9311
@evarosesummerfield9311 4 жыл бұрын
I love these videos! I have finished a beginner python course and i'm now trying to learn some more. These projects are really interesting... hopefully I can do a tetris code on day haha!
@KylieYYing
@KylieYYing 4 жыл бұрын
My sister plays a lot of Tetris against other people haha so I’ve been thinking about building a Tetris AI
@LoquendoElHistoriador
@LoquendoElHistoriador 4 жыл бұрын
I adore when positive, optimistic and simple people like you Kylie cross my path, who put their heart in each of their actions ... who give everything for nothing. That caress my soul and enrich my life of knowledge ... Thank you for your videos, (Even if I have to translate them completely, since I do not understand English at all, but even so, it is fidicile to get bored of you)
@sarthakchaturvedi5767
@sarthakchaturvedi5767 3 жыл бұрын
17:29 i was not able to understand what piece of code you added their
@nabellass
@nabellass 2 жыл бұрын
the way you explain are really well, it cheers me up to do more code. very helpful. keep going!!
@MichelandLadda
@MichelandLadda 4 жыл бұрын
I was learning python for 2 weeks but switched to Kotlin now. Learning it for 4 weeks now. Also learning android studio, github, intelliJ. And hope to write software some day. So I can show my boss I changed his boring excel visual basic into a nice looking desktop windows programm with buttons and windows for the lists.
@Jsalo89
@Jsalo89 3 ай бұрын
1:43 "think about how minesweeper works" Lady I never understood that game lmao
@prafuljoshi1150
@prafuljoshi1150 3 жыл бұрын
Thank you so much. I had to do this project in c++ so I followed your video step by step but just did it in c++. Also got frustrated too many times seeing how easy some things are in Python compared to c++ lol. But I learnt a lot of c++ stuff trying to translate your python code to c++. Thanks a lot.
@modaryaghi
@modaryaghi 3 жыл бұрын
This my first video I watch on this channel. LOVE IT Although sometimes I needed more explanation, the excitement of challenging my skills and understanding is AWESOME. I will keep my eyes on everything has been, or will be, released.
@BKK-ev8yh
@BKK-ev8yh 3 жыл бұрын
Thank you a lot for the help I was coding minesweeper on my own and really stuck on assigning squares a number value based on how many bombs are touching a square and was really stuck this tutorial helped me a lot, thanks
@ashleyreynolds7644
@ashleyreynolds7644 4 жыл бұрын
This was so helpful, thank you so much! You explain things really well and broke things down perfectly :)))
@mehmethankaya9974
@mehmethankaya9974 4 жыл бұрын
I love your videos! Keep going!
@charlie6618
@charlie6618 4 жыл бұрын
upload videos more often please... I really like your videos. Thank you for making them!
@drachel105
@drachel105 3 жыл бұрын
Hi Kylie, how do I replace the f{} in this line (string_rep += f'{i} |') with a function that works in python 2?
@zchamdawala
@zchamdawala 4 жыл бұрын
Was eagerly waiting for this. Looking forward to practice this in my machine. Thank you so much ❤️
@serenali3919
@serenali3919 3 жыл бұрын
Hey! This video is so cool! Could you please explain a little bit in the formatting code under the str function? Thank you!
@samuelajayi3748
@samuelajayi3748 2 жыл бұрын
This was very helpful, thank you.
@Corn0nTheCobb
@Corn0nTheCobb 3 жыл бұрын
Thanks for this! I'm making a minesweeper game with pygame and the only part I couldn't figure out on my own was recursively uncovering empty squares. I'm no good with recursion at all.
@sankethb.k642
@sankethb.k642 4 жыл бұрын
This is exactly what I was looking for. Thank you.
@Ajajqiqjaa
@Ajajqiqjaa 3 жыл бұрын
Board() takes no arguments File "C:\Users\Toshiba\Documents\minesweeper.py", line 123, in play board = Board(dim_size, num_bombs) File "C:\Users\Toshiba\Documents\minesweeper.py", line 157, in play() What does this mean?? Please help me? is it because Board is not a function?
@relaxationstation7128
@relaxationstation7128 4 жыл бұрын
Thanks so much Kylie - found your channel through the freeCodeCamp channel. You did an awesome 3 hour tutorial there. I wonder if you can speak to them and re-post them in small segments on this channel? I think people would really appreciate them and it'll benefit you too! Have a great day and thank you for teaching :)
@carlisle6831
@carlisle6831 4 жыл бұрын
Perfect project to keep me occupied this December 😁
@lucasn5518
@lucasn5518 3 жыл бұрын
Hi! Thank you so much for this helpful video! I was wondering if the way that you checked what the neighbors values were could be considered bfs or dfs? Or maybe neither of those? I'm trying to begin to learn the two and I get confused. Thank you again!!
@KylieYYing
@KylieYYing 3 жыл бұрын
Neither, bds/dis is searching for a path. Here, we’re just simply checking neighbors
@johnlui1719
@johnlui1719 3 жыл бұрын
Are you korean you look like my mom ,you give me comfort it's amazing
@0001-exe
@0001-exe 4 жыл бұрын
Wow THANK YOU SO MUCH FOR THIS! I'm a Computer Science freshman and we have a project where I chose to make a minesweeper game. Is it really bad if I'm already done with my first semester and I still dont get how everything works that well? I wtched lotsof tutorials and I still dont get how things work that well. Still,than’ you so much for this, this is what I needed! I hope I can code amazingly like you do. You just earned a new sub!
@habeebahmed6862
@habeebahmed6862 4 жыл бұрын
Hi sister how r u God bless u sister for giving u r valuable information clear like a water 💧 if u dont mind can u plz make a video on oop thnk u sooo much
@leoalex331
@leoalex331 4 жыл бұрын
Hai, you're doing great.It's helps me to learn more. Do some more projects.
@felix-ej9in
@felix-ej9in 4 жыл бұрын
tysm for this video....cool content.....keep up the good work
@Poptartpug
@Poptartpug 3 жыл бұрын
This was very interesting! I really like the logic and stuff, but I know basically nothing about Python so I was lost most of the time. Ha. I think I might try to figure out Python just to make this. 👍
@emmanuelmosweu7280
@emmanuelmosweu7280 4 жыл бұрын
Can we just talk about her comment game. I mean that's good looking code.
@zackzayco9135
@zackzayco9135 3 жыл бұрын
COOL Video
@jamesplazgames233
@jamesplazgames233 3 жыл бұрын
Traceback (most recent call last): File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 212, in play() File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 188, in play print(board) File "C:\Users\Chad\Desktop\TICTACTOE\minesweeper.py", line 133, in __str__ if(row,col) in self.dug: UnboundLocalError: local variable 'row' referenced before assignment. I looked up some stack overflow post and it mentioned how if you try to use a varible defined in a function outside of it, it wont work, so idk. Its late here so imma try to work on it again tommrow. Will edit when I find solution. If you have any ideas pls leave in comments!
@Ajajqiqjaa
@Ajajqiqjaa 3 жыл бұрын
MY PROBLEM AS WELL!!
@AmitChaudhary-qx5mc
@AmitChaudhary-qx5mc 4 жыл бұрын
Thank you sister.
@philtoa334
@philtoa334 3 жыл бұрын
So Nice Thank you. : )
@isquicha
@isquicha 4 жыл бұрын
6:47 "Bomb has been planted" asudhasidhasld
@mrboyban
@mrboyban 3 жыл бұрын
Is this a beginner tutorial ?
@JJJ-ee5dc
@JJJ-ee5dc 4 жыл бұрын
Subscribed
@MrHide-ty1qk
@MrHide-ty1qk 4 жыл бұрын
I like your videos and you 😍♥️❤️😘😊♥️♥️❤️❤️😘♥️♥️
@RaptorYamaan
@RaptorYamaan 2 жыл бұрын
Really bad for beginners. Don't start here
@DreaminBig
@DreaminBig 3 жыл бұрын
Is there someone that does these videos for you and you kind of just talk over them to seem like they're yours?
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 1,2 МЛН
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Binary Search Algorithm: Explanation and Python Tutorial
15:20
Kylie Ying
Рет қаралды 14 М.
Can I Code Minesweeper in One Hour?
1:04:01
Tech With Tim
Рет қаралды 95 М.
Sliding Window Technique - Algorithmic Mental Models
36:45
Ryan Schachte
Рет қаралды 367 М.
Python Projects - Learn to build a game (OOP) - Getting Started
26:57
JimShapedCoding
Рет қаралды 10 М.
Diffusion models from scratch in PyTorch
30:54
DeepFindr
Рет қаралды 265 М.