DEV Community

wmansfieldgolf
wmansfieldgolf

Posted on

Feedback on complex (?) terminal game

Hi everyone, I hope this is okay to post here.

I have written a fun murder mystery terminal game that I would like some feedback on. I think it shows a reasonable understanding of variable scope, OOP, logical thinking, and the ability to problem solve - given the complexity of the code. Is there any other skills I am showing here that you think are important to future programming?

I definitely suffered scope creep in this project. This started as a small project I wanted to do on a plane ride home for Christmas but as I kept working on it I realized I needed more and more features to make it a game worth playing. All told I probably spend 3 hours a day from Dec 21 to Jan 10 working on this... so 50-60 hours all told! Although I have yet to learn about automated testing, and some days were literally going through with the debugger for hours to figure out why something wasn't working right.

The only feature I wanted to add that I decided not to (see scope creep) was one where if a character in the game came across a body, they would call an accusation meeting and inform you where they found the body and who it was. I do think it would make the game better, but I am pretty burnt out on the project so I decided not to.

Couple questions:

  • Is this something worth leaving in github when the time comes for interviews? Does it show enough skills to an interviewer that they would understand I know what I am doing?

  • What - ultimately - did I gain from this? I feel a bit like I could've made something much simpler and I would've been able to practice the same thing...

  • Lastly, does anyone have resources on learning how to do automated testing? That is something that I think would've helped tremendously cut down time spent on this project.

Here is the link to the github repository: https://github.com/wmansfieldgolf/murder-mansion-game

Thanks in advance for your feedback!

Top comments (4)

Collapse
 
mainrs profile image
mainrs

I can take a look at it later on and link a gist where I review the code! One nitpick I do have though: Even in languages like Python, having type annotations makes it easier for others to understand your code. It also allows tools like mypy to better understand your code and helps you find bugs that might appear at runtime only.

I know a lot of people hate static types but I think it's a good thing in almost all circumstances. I'd highly recommend to at least look into type hints in Python and the tools around it!

Collapse
 
wmansfieldgolf profile image
wmansfieldgolf

That would be greatly appreciated, thank you! Funny you mention type annotations... I just started learning about them today because I wanted to start learning more about testing! Definitely seems like they could be valuable and they certainly would've been a big help in this project.

Cheers.

Collapse
 
thomasborgen profile image
Borgen

While I agree with the other commenter about typing I think it would be best if you look into structuring your code a bit better. As it is now it is quite hard to read since there are no compartmentalizing of code. For example, you could have a models.py file with your Character, Room and the rest of your models. And another file with functions to create and modify them. And then in your main.py keep only the game logic, code that is "moving", for lack of a better word, the game forward.

When that is done it's also much easier to start looking into writing tests.

Either before beginning with tests or after, I'd have a look at some best practices like snake_case naming of files and maybe start using a linter like flake8.

For your questions:
I just want to say, great job at making something like this, it's super creative! Just that by itself should be a good reason to keep in in your portfolio.

I think what everyone gains from doing projects like this on any scale is just getting better at problem solving. Having a problem solving mindset is, I think, one of the most important skills a programmer can have and work on.

If you want to look into writing tests, Google pytest and read their tutorial. That should get you going quite quick.

Collapse
 
wmansfieldgolf profile image
wmansfieldgolf

This is a great reply. Thank you! I agree it is quite messy, and I felt that while constantly scrolling back and forth to find things. Given that I am a newbie, I am just figuring out that I can actually store multiple scripts in one directory and import them as necessary. Certainly would keep things a bit cleaner!