Add a new C++ class (not MFC) to the project via the solution explorer and call it CRandomNumber. The database contains one table (Games), this contains two fields ID (auto number, primary key) and GameDetail (Text, 82 char, required=true, Allow zero length=false, indexed=yes – no duplicates). The database must be located in the same directory as the exe file. I have created a new database with Microsoft Access, in Access 2000 format, and called it Sudoku.mdb. The source of the algorithm here is referenced in the code. Don’t take this as any implication that the inbuilt routines are poor quality or unreliable. Here we are going to provide a basic class for random number generation using a technique (which is supposed to be good) from literature, specifically about mathematical techniques in programming. For other work it may well be critical, put another way having a poor algorithm could result in you generating rubbish from your application – because the data it is based on was not truly random. For playing our games of sudoku having a good random number generating algorithm isn’t necessary. There is a built in random number function in windows. Error trapping with try.catch to help the code run even if something goes wrong.Ĭontinuing from the seventh article about sudoku. Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).
0 Comments
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |