r/learnpython • u/JarnePl • Jun 18 '20
Python projects for beginners
Hi! I just learned basic python syntax (watched a 4 hour long python tutorial playlist while also doing it myself), what would be some good beginner projects/ programs that i’d be able to make, and second of all, what can i learn next to become better at python?
449
Upvotes
1
u/OnlySeesLastSentence Jun 20 '20 edited Jun 20 '20
Anyway, it took me about six hours of off and on work while watching TV (which I feel is a bit slow honestly), but here you go:
GitHub.com/MOABdali/pysweeper
I'm going to add a GUI when I feel like it (I'm not too invested in the project at the moment), but feel free to try it out in console mode. I know the formatting isn't pretty, but my main purpose was getting the logic to work.
I didn't use any outside sources other than googling how to clear screen (I always forget this) and looking up how to use deep copy's syntax (I had a similar problem in the past with python copying lists by reference instead of duplicating by value when I was making my connect 4 game).
Feel free to let me know if there's any logic errors. I even added a "mark potential mines" feature just for you.
Just wanted to make sure I put this out today to show minesweeper isn't challenging enough as a big project considering an entry level graduate like me was able to handle it lol. The end goal should be something that takes a week or so to complete, not just a few hours.
Edit: before anyone mentions it - I know my code can be broken up into multiple files. I was trying to just get the game running so I wasn't focusing on making it pretty yet. The final product will be nicely commented and broken into functions where needed. I also realized about an hour in that I would not need to keep track of how many bombs are in each structure's vicinity, so I'll be deleting the scary squares[0,0,0,0,0,0,0,0,0,0,0,0] thing eventually and reducing it to a simpler squares [0,0,0,0]. Yes, I know a class can replace the 4 item list, but there's no need to add complexity when my simple list can handle it.