![]() To build the board, I contacted the very good people over at PowerBI.Tips to see if they would be able to spin up a suitable background image to use for the game. This particular data-set doesn’t come with any form of difficulty rating on the games, so there is no ability to set if the game should be easy, medium or hard. ![]() This means every time the data-set is refreshed, a new game will be loaded. The random number is used to filter an index row which is added to the CSV file. I use Power Query to generate a random number to filter the raw data-set down to a single row for the Power BI data model. I decided to make the first 9 digits the top row, then digits 10 through 18 as the second row etc. It means you can flip around existing games vertically, or horizontally (or both) to create an even larger set of games, although a million is probably quite enough. Interestingly, it doesn’t matter if you orient the data so the first 9 digits are the first row or the first column – it will still create a playable board so long as you carry on the same pattern. If I add line-breaks and vertical gaps, you can see how I map the numbers to cells on the Sudoku board. Zeros are placeholders for guesses, while the non-zeroes carry values to be used as the clues. The top row provides data used to initialize the board. The file is a CSV that includes two values for each game. I had a look around to see if there were any existing data-sets around and found a file over at Kaggle with data for 1 million Sudoku games. ![]() To begin with, I needed some data to use as the basis for the game. The end result looks as follows and the PBIX file can be downloaded here which includes a zip file with the source data. A big thanks to my good friend Tom Martins over at minceddata for giving me the idea. ![]() Carrying on from my recent article on how to build a game of Blackjack using Power BI and DAX, this time I thought I would see if I could build a fully playable game of Sudoku. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |