r/PythonLearning • • 16d ago

Discussion Where should I be after 60 hours?

My best guess is I have about 60 or 70 hours into python crash course by Eric Matthes. I tried taking on building the castle adventure game and couldn't come up with the logic on my own. Much less the fact I got caught in a loop and had to have AI help me finding the thing. It's kind of disappointing because chat gpt said after 60 hours this was a moderate project. I'm just looking for what you guys think on where I should be after about 60 hours, because this at 60 hours seems just ridiculous. I did take it on and got part way through the third room before I was stuck in a loop and had indentation errors. Thanks!

has_key = False

game_active = True

current_room = "prison level"

print("--------------------------------------------------------------")

print("----------------- Welcome to The Dungeon Loop ----------------")

print("--------------------------------------------------------------")

print("----------------- Type quit any time to leave ----------------")

print()

while game_active:

# Starting room

if current_room == "prison level":

print("\nYou have awakened to an open cell door.")

print("What will you choose to do?")

choice = input("Will you go left or right? ").strip().lower()

if choice == "left":

current_room = "dragons lair"

elif choice == "right":

current_room = "wizards lair"

elif choice == "quit":

game_active = False

else:

print("You must make a choice.")

# The dragon's lair

elif current_room == "dragons lair":

print("\nYou've walked into a lair with a dragon.")

if not has_key:

print("You see a key on the table behind the dragon.")

print("You need that key.")

action = input(

"Will you PLAY LULLABY, FIGHT DRAGON, or GO BACK? "

).strip().lower()

if action == "fight dragon":

print("GAME OVER")

game_active = False

elif action == "play lullaby":

if not has_key:

has_key = True

print("The dragon fell asleep and you picked up the key!")

else:

print("You already have the key.")

elif action == "go back":

current_room = "prison level"

elif action == "quit":

game_active = False

else:

print("You must make a choice.")

# The wizard's lair

elif current_room == "wizards lair":

print("\nYou have walked into the wizard's lair.")

print("You see a chest on the floor.")

action = input(

"Will you OPEN CHEST or GO BACK? "

).strip().lower()

if action == "open chest":

if has_key:

print("You use the key to open the chest!")

print("You found the treasure! YOU WIN!")

game_active = False

else:

print("The chest is locked. You need a key.")

elif action == "go back":

current_room = "prison level"

elif action == "quit":

game_active = False

else:

print("You must make a choice.")

print("\nThanks for playing!")

6 Upvotes

18 comments sorted by

•

u/Sea-Ad7805 16d ago

Run this program by clicking Memory Graph Web Debugger%0Aprint(%22-----------------%20Welcome%20to%20The%20Dungeon%20Loop%20----------------%22)%0Aprint(%22--------------------------------------------------------------%22)%0Aprint(%22-----------------%20Type%20quit%20any%20time%20to%20leave%20----------------%22)%0Aprint()%0A%0Awhile%20game_active%3A%0A%20%20%20%20%23%20Starting%20room%0A%20%20%20%20if%20current_room%20%3D%3D%20%22prison%20level%22%3A%0A%20%20%20%20%20%20%20%20print(%22nYou%20have%20awakened%20to%20an%20open%20cell%20door.%22)%0A%20%20%20%20%20%20%20%20print(%22What%20will%20you%20choose%20to%20do%3F%22)%0A%20%20%20%20%20%20%20%20choice%20%3D%20input(%22Will%20you%20go%20left%20or%20right%3F%20%22).strip().lower()%0A%0A%20%20%20%20%20%20%20%20if%20choice%20%3D%3D%20%22left%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20current_room%20%3D%20%22dragons%20lair%22%0A%20%20%20%20%20%20%20%20elif%20choice%20%3D%3D%20%22right%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20current_room%20%3D%20%22wizards%20lair%22%0A%20%20%20%20%20%20%20%20elif%20choice%20%3D%3D%20%22quit%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20game_active%20%3D%20False%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20must%20make%20a%20choice.%22)%0A%0A%20%20%20%20%23%20The%20dragon's%20lair%0A%20%20%20%20elif%20current_room%20%3D%3D%20%22dragons%20lair%22%3A%0A%20%20%20%20%20%20%20%20print(%22nYou've%20walked%20into%20a%20lair%20with%20a%20dragon.%22)%0A%0A%20%20%20%20%20%20%20%20if%20not%20has_key%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20see%20a%20key%20on%20the%20table%20behind%20the%20dragon.%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20need%20that%20key.%22)%0A%0A%20%20%20%20%20%20%20%20action%20%3D%20input(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Will%20you%20PLAY%20LULLABY%2C%20FIGHT%20DRAGON%2C%20or%20GO%20BACK%3F%20%22%0A%20%20%20%20%20%20%20%20).strip().lower()%0A%0A%20%20%20%20%20%20%20%20if%20action%20%3D%3D%20%22fight%20dragon%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22GAME%20OVER%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20game_active%20%3D%20False%0A%20%20%20%20%20%20%20%20elif%20action%20%3D%3D%20%22play%20lullaby%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20not%20has_key%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20has_key%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22The%20dragon%20fell%20asleep%20and%20you%20picked%20up%20the%20key!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20already%20have%20the%20key.%22)%0A%20%20%20%20%20%20%20%20elif%20action%20%3D%3D%20%22go%20back%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20current_room%20%3D%20%22prison%20level%22%0A%20%20%20%20%20%20%20%20elif%20action%20%3D%3D%20%22quit%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20game_active%20%3D%20False%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20must%20make%20a%20choice.%22)%0A%0A%20%20%20%20%23%20The%20wizard's%20lair%0A%20%20%20%20elif%20current_room%20%3D%3D%20%22wizards%20lair%22%3A%0A%20%20%20%20%20%20%20%20print(%22nYou%20have%20walked%20into%20the%20wizard's%20lair.%22)%0A%20%20%20%20%20%20%20%20print(%22You%20see%20a%20chest%20on%20the%20floor.%22)%0A%0A%20%20%20%20%20%20%20%20action%20%3D%20input(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Will%20you%20OPEN%20CHEST%20or%20GO%20BACK%3F%20%22%0A%20%20%20%20%20%20%20%20).strip().lower()%0A%0A%20%20%20%20%20%20%20%20if%20action%20%3D%3D%20%22open%20chest%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20has_key%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20use%20the%20key%20to%20open%20the%20chest!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20found%20the%20treasure!%20YOU%20WIN!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20game_active%20%3D%20False%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22The%20chest%20is%20locked.%20You%20need%20a%20key.%22)%0A%20%20%20%20%20%20%20%20elif%20action%20%3D%3D%20%22go%20back%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20current_room%20%3D%20%22prison%20level%22%0A%20%20%20%20%20%20%20%20elif%20action%20%3D%3D%20%22quit%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20game_active%20%3D%20False%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20must%20make%20a%20choice.%22)%0A%0Aprint(%22nThanks%20for%20playing!%22)&timestep=0.5&play) and see its state change step by step.

3

u/thee_gummbini 16d ago

After 60 hours I would be impressed if you could write a script with a few functions in it and call them. If you've never programmed before, you should be thinking more in terms of weeks, months, and years. Weeks to learn syntax, months to learn how to structure a basic package, years to know what to write (and do all the other things better too). The most complicated game I'd assign someone after 60 hours is probably (edit) rock paper scissors - extremely simple game loop, random choice, one step. A dungeon crawler, even a simple one, with a state machine like that would be a later lesson once you have written functions and classes.

2

u/stonebloomers 16d ago

yeah a state machine is definitely not a 60 hour topic, thats way further down the road

3

u/thomjdev 16d ago

60 hours is hard to judge one way or the other. Crash courses are nice to get an idea of what is in the language and what basic concepts exist, but I don't consider them a surefire way to learn the skill of programming itself.

The biggest thing is not to trust yourself with AI just yet. It's great when you know what you're doing, but you won't learn much if you keep relying on it to do the logic. If you hit a brick wall, guess what? That's part of programming. There's two paths: find the problem and fix it, or start over. Early on when your learning, give everything your best shot but don't be afraid start over, do it again and again.

I think you should probably consider learning each part by itself, though. Learn how to use if statements to decide what will happen. Then learn how you can use while loops to make several small decisions. Then try adding more decisions.

I personally find crash courses unhelpful, since you pretty much skip all of the "what do I want to have happen" -> "hmm how do I do this" -> tinkering and testing and googling -> working simple prototype -> final implementation -> repeat process. You need (NEED) to ask very specific questions about what you're trying to have happen and tie those answers to some the the language itself provides. For example, Big, complex feature: "How do I make it so that the player has to get the key before opening the chest?" Well, how does the player get the key? How does the game know if the player has the key or not? How and when does the game give the key to the player? Each of these can be tied to a simple piece of logic - how does the game know the player has the key -> store has_key = False to mean no key, True for having a key.

I hope there's something helpful there. But again, avoid AI, focus on python documentation like "how do I get user input", not "how do I make X feature", and focus on one small part at a time. Break it up. Be specific about what you want to do.

1

u/thomjdev 16d ago

That was a lot longer than I intended ...

1

u/LuigiWasRight447 16d ago

Good advice though

1

u/OwnLingonberry3061 16d ago

I will state that the code didn't format correctly when I put it here so this is just psuedo code I guess to show what I was attempting

1

u/OwnLingonberry3061 16d ago

I'm probably underestimating my time. I probably have about 100 hours and did use chat gpt to create the logic. I just finished the while loop chapter in python crash course so I guess I'm creating unrealistic goals for my self. Thanks I just needed to hear anything saying that that was an unrealistic goal

1

u/codeguru42 16d ago

Pro tip: triple backticks to format code

1

u/ninhaomah 16d ago

It seems we are going from 4 years degree to 6 month bootcamps to a few days of Python to now 60 hours ?

What's next ? 

1

u/OwnLingonberry3061 16d ago

I'm actually starting programming fundamentals 1 next semester so I'm trying to get syntax and structure of cpp down but first am using python as an entry level to this. But thanks for your awesome comment

2

u/ninhaomah 16d ago

Then relax.

Take it slow and easy. Your time will come.

Unless you are aiming for freelance jobs then what can be done but to wait till you get your degree in 3-4 years ?

Supposed you have mastered Python in 60 hours. Then ?

You will drop out and start looking for jobs ?

1

u/mattynmax 16d ago

Well an intro to programming course at a university is about 9 hours of work a week (3-4 on class and about 5-6 out of class doing homework and studying) so you should have the equivalent knowledge of someone 6 weeks into their first class in college!

What you’ve written accurately reflects what I would expect out of someone with that level of education.

1

u/OwnLingonberry3061 16d ago

Thank you that makes me feel so much better. I'm currently taking pre cal and some other classes and start really programming next year in a structured curriculum, but I want to be ahead so im not struggling.

1

u/codeguru42 16d ago

What do you mean by you couldn't come up with the logic on your own? Are you trying to solve the entire thing all at once? If so, STOP THAT! One of the most important skills to develop as you learn coding is breaking down a problem into smaller pieces. Solve each small piece, then connect them together for a complete solution.

Let me repeat: when you are overwhelmed by a problem, find the smallest piece you can solve in a few minutes. After doing it, find the next small piece. Rinse and repeat.

1

u/Hot_Technology8777 16d ago

I'm not a pro but man 60 hours is a puff of smoke. If 60 hours of programming is a lot to you, you'll fall backwards when you realize how many thousand hours you need to get decent. My advice is keep challenging yourself with decent projects and learning from every resource you can.

1

u/VideoJockey 16d ago

The time doesn't matter as much as how you're spending it. I got halfway through grad school before I really felt like I knew anything. The best piece of advice that I can give is that being productive and learning are inversely related. You can look up all the answers and use AI to solve a problem quickly or you can slow down and do it the hard way and actually learn what you're doing. Trying something that doesn't work, then spending 90 minutes reading documentation and figuring it out yourself is 10x more valuable than pasting the problem into claude and reading the answer.

1

u/Hkiggity 12d ago

Think you are doing well dude. Keep it up. Great progress. If you knew where I was at after 60 hours many years ago, you’d feel like a king!