How to Start Coding a Word Game in C++?
Asked by
cut-to-fit
I'm working on a word game in C++, and I've laid out the inputs, processes, and outputs. However, I'm struggling to get started on the actual coding. It feels a bit like trying to write an essay - just getting that first part down is tough for me. The game involves generating a random letter, and then the user needs to name a capital city that starts with that letter. I'm frustrated because I feel stuck and clueless on how to begin.
Answers
Remember, sometimes it's beneficial to start small... even with something basic like a 'Hello World' program. It ensures your setup is all working correctly. Good luck, you'll get there!
Reply to this answer
Starting with a random letter might complicate things at first. I suggest holding off on randomness until your basic structure is in place. Begin by focusing on known values so you can troubleshoot easier. Once you have a solid foundation, you can bring in the randomness.
Reply to this answer
A good strategy is to break the problem into smaller pieces. Start by figuring out how to generate a random letter. The ASCII or Unicode tables can really help you with this since each character has a specific number assigned to it. Also, think about how you'll validate the userโs input - do you have a list of capital cities you can use for comparison? That's another key building block to get you started.
Reply to this answer
Try starting from the end of your project! Instead of coding the whole input and randomness part, create a hardcoded version of how the final output will look after a user enters a capital city. This gives you a clear vision of what you're working towards. Once that works, you can gradually replace hardcoded values with dynamic inputs and randomness.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions