CrossMath Game - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://qb64phoenix.com/forum/forumdisplay.php?fid=9) +---- Thread: CrossMath Game (/showthread.php?tid=2772) Pages:
1
2
|
CrossMath Game - SMcNeill - 06-04-2024 Inspired by some of @Dav 's latest works, this is the start of a little Crossword type game, but which features addition instead of letters. Code: (Select All)
The way this works is it creates a crossword style grid, and then it gives you some clues in the form of the colored tiles and numbers. Red is the sum of the numbers adding downwards. Blue is the sum of the numbers adding right. Game is loosely based off a variety of the puzzle Kakuro: https://www.kakuroconquest.com Main difference here is I'm not checking for unique values, so you can have the same value multiple times in a row/column, which means there's no "unique" solution to puzzle. RE: CrossMath Game - SMcNeill - 06-04-2024 Game should now, more-or-less, be playable. Use arrow keys to move through the tiles. (CTRL-arrow keys move without "smart-skip", in case you have to reach an odd tile.) Use 1-9 to set a value to a tile Use 0 to clear the value for a tile. Set the values of the tiles, until you make all the totals match. ** Instead of leaving a set of number of tiles already visible, I let YOU pick and choose which ones you want to show. First CONST for the game is the difficultly, and that directly cooresponds to the number of hints you get. At difficulty 5, you get 5 hints to help you solve the puzzle. To use a hint, simply press "S" (for show), "H" (for hint), or "?" (question mark), and the game will fill in the tile that you're currently over and subtract one from your total number of hints. Remember -- RED triangles are the sum of blocks going DOWN. BLUE triangles give you the sum of blocks going RIGHT. You don't even need an EXACT match to win -- just so long as those TOTALS match! Sounds simple, right? Give it a go and see how well you can do at CROSSMATH!! (And for those who wonder what I mean by EXACT matches not being required to win, let me do the simplest of illustrations: 6 ? ? ? Now, if the above is our clue and puzzle, there's 3 blocks we need to fill in, and the red 6 tells us the total is 6. Any of the following would do for the win here: 4, 1, 1 3, 2, 1 3, 1, 2 2, 2, 2 and so on.... You just need to make those values reach the totals, in the direction indicated, to win. RE: CrossMath Game - SMcNeill - 06-04-2024 Note: As per a report from @grymmjack -- thanks for testing and reporting! -- Linux may toss an error for you, due to pathing and font location. Change this line (Line 17): Code: (Select All) LargeFont = _LOADFONT("courbd.ttf", 48, "monospace") To point to whatever monochrome font you like on your system. Windows stores fonts in "C:/Windows/Fonts/", and QB64PE will search there for them. Linux tends to be a little less organized with various places to put stuff, so it has to be spelled out exactly pathwise where/what you want to use. With this one simple change, it compiled and ran on Linux, so this shouldn't be a hard change for everyone to make to get it working on your system. RE: CrossMath Game - grymmjack - 06-04-2024 In Linux (in my case debian bookworm): Code: (Select All) sudo apt install ttf-mscorefonts-installer Then you can see where the font for courier is installed like this: Code: (Select All) fc-list | grep cour On my system it was: Code: (Select All) /usr/share/fonts/truetype/msttcorefonts/courbd.ttf: Courier New:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia So I simply modified Line 17 to be: Code: (Select All)
And it worked. Note: if you don't have fc-list, you can get fontconfig package: Code: (Select All) sudo apt install -y fontconfig Find out like so: Code: (Select All) grymmjack@funkunit:~ Strangely, the man page is called fonts.conf Code: (Select All) man fonts.conf This will pull up the main package docs. RE: CrossMath Game - grymmjack - 06-04-2024 @SMcNeill you should put the instructions in a intro screen for your game. This makes it more complete and portable. RE: CrossMath Game - bplus - 06-04-2024 i don't get it, all the answers are already on the board: RE: CrossMath Game - SMcNeill - 06-04-2024 (06-04-2024, 05:11 PM)bplus Wrote: i don't get it, all the answers are already on the board: Just for testing/illustration purposes. Turn those off via the first CONST and give it a try. Code: (Select All) CONST ShowAnswers = 1, Difficulty = 5 'can toggle to show answers, or change difficulty (1 to 10, higher = harder) Game is loosely based off a variety of the puzzle Kakuro: https://www.kakuroconquest.com Main difference here is I'm not checking for unique values, so you can have the same value multiple times in a row/column, which means there's no "unique" solution to puzzle. Edit: I went ahead and toggled the ShowAnswers off in the first post. Now if folks want to see one possible solution, they have to toggle that on for themselves. RE: CrossMath Game - bplus - 06-04-2024 ok looks a little harder that way RE: CrossMath Game - bplus - 06-04-2024 oh wow the very next page in a sudoku book i have has 4 pages of Kakuro puzzles! RE: CrossMath Game - SMcNeill - 06-04-2024 (06-04-2024, 07:13 PM)bplus Wrote: oh wow the very next page in a sudoku book i have has 4 pages of Kakuro puzzles! That's why I was a little surprised that folks didn't recognize the game, or already have a grasp of the basic ruleset. It's actually a very common and widespread style game. |