Results 1 to 2 of 2

Thread: Sudoku Game Builder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    103

    Smile Sudoku Game Builder

    Since folks here have helped me, I figured I would post this here. If you can suggest other places this should be posted, please share.

    I wrote this program (yeah, stupid name...) because I like the ‘shading’ associated with the app Enjoy Sudoku and the puzzle variants on www.PuzzleMix.com are interesting, but the PuzzleMix board does not shade and there are only a limited number of puzzles that can be played there. This program provides shading and the ability to set up many Sudoku variants.

    This program has two basic modes of operation: Build the game and play the game. I will first discuss playing the game before describing building the game.

    To use the program, launch it. When it opens, you will see a ComboBox in the upper-left corner. Click the arrow and select a type, the simplest case being Sudoku. The board completes and you can start playing. To play, click a number and all of the cells with that number are highlighted. To remove a number from a cell, left-click the cell. If a cell does not have a number and you want said number in a cell, left click (but this only works if the cell can possibly take that number). To set that number in a cell, right click. Once a number has been set nine time, that number button is disabled.

    When a number is set, the program automatically removes the same number from the row, column, toroid, and (if applicable) the X into which the number was set. The program will also enter a note into a cell if said cell has only one number, or if the number in the cell appears only once in the row, column, toroid, and (if applicable) X. The note lets you know which type of ‘singularity’ this is (with L meaning only digit in a cell).

    There are three building actions: building the toroids, adding symbols, and adding functions.

    Toroids are the shapes of the frame that holds nine cells. When you select a program that needs toroids, simply start clicking the cells in a toroid. Note that all cells must be adjacent, however, for wrap-around, you can click the ‘adjacent’ cell on the other side of the board. Once you have clicked nine cells, the toroid becomes shaded and outlined. Once all nine toroids are completed the program switches to play mode. If a square is clicked improperly, click undo and that square is removed from the toroid.

    Symbols are added for various game types. To add a symbol, click two adjacent cells and the symbol appears. If a symbol is placed improperly, click undo and one symbol is removed with each click. Once all of the symbols have been placed, click Done and the program switches into play mode.

    Functions are the frames inside of which a mathematical operation must be satisfied, think Calcudoku. To make the frame, click the appropriate cells, which must be adjacent to each other. When all cells for a given function have been selected, click ‘Finish Function’ and enter the formula. Note that an ‘x’ is converted into a multiplication sign and a ‘d’ is converted into a division sign. If a function is placed improperly, click undo and one function is removed with each click. Once all functions have been entered, click Done and the program switches to play mode.

    Three keys are programmed:
    • F1 – This prints the board to the system’s default printer.
    • F9 – This saves the current board to a file. The program forces a .txt extension which means that you can easily view the file (and correct small typos easily).
    • F10 – This reads in a saved game file.


    The games seems to work without any issues. The code isn’t pretty and there are probably some parts that could be merged together to clean things up – specifically the Toroid and Function codes are very similar. There are, needless to say, some minor issues that could be improved:
    1. The colors used to shade the toroids, the selected number, and the X could be improved. Perhaps, instead of shading, the outline of the affected cells could be changed. Basically, this works, but is not ideal.
    2. Sometimes it is hard to see the function line over the toroid line. This could be colors, weight, something. Again, this works but is not ideal.
    Attached Files Attached Files

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,754

    Re: Sudoku Game Builder

    Moved to the Game Demos forum.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width