I'm a begginer in C++ and I want to write a sudoku source code in C++. I want to make a simple program. I've tried to write it but the code I've wrote doesn't run OK.
How to make a sudoku generator easily on C++?
The hardest part about this program will be figuring out the logic to ensure a "true" or "winnable" sudoku board is generated. Displaying a few numbers or whatnot should be easy for you.
Welcome to the real guts of programming. Probably up until now when you've wanted to write a program, the first thing you've done is open up your code editor and start typing. Now things are getting more advanced, and you need to change tactics.
Start out on paper. First of all make certain you know the rules of sudoku, then figure out a process to make a board. Maybe you'll start with the whole thing filled out (so that you know it's valid) and then remove numbers so that people can play. How will you remove the right numbers so that people can figure it out? That'll be something you'll have to figure out.
Try and split the big problem ("generating sudoku boards") into smaller tasks - already we've got: 1. creating a filled in board and 2. removing numbers for a person to play.
This is quite a challenge. You may even want to start with something easier - like a word search/jumble generator, before moving up to this move advanced game.
But - if you do figure it out, you can offer people endless sudoku games, or, if you know a publisher, sell some sudoku books.
Good luck!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment