Screamin Igel logo    
  Ziffern Mathematical Puzzle  
Ziffern Logo   A Game of Logic
 
 
    If you have any questions about our open source programs, or wish to obtain more information on our products, then please send a message to OpenSource@artige.com and we will happy to handle your request.
 
 
 
    Ziffern is a single person game that requires one to use logic and math to solve. It is based upon a puzzle that appeared years ago in the German weekly television magazine "Hoer Zu". Our Ziffern program will generate a new puzzle, and allows the player to assign numerical digits to the circular symbols using a custom static control built to behave like a selector wheel. Unlike the magazine version of the puzzle, the player can review the answers at any time, instead of waiting for the next issue.
 
    The Ziffern program is being offered under open source license (GPL), so that the user as could extend it as need be. One such extension would be a Sudoku type of game. The same selector wheel custom control could be used as wheel as similar number generation algorithms. There is a secondary purpose behind the drive to compose Ziffern. It was written to demonstrate how Operations Research principles could be applied to everyday activities, even in game design, which is one of the areas of specialty for the Artige Company. It also demonstrates the use of matrices to solve simultaneously equations and how one can write a custom static control.
 
 
 
  Available on this page:   Preview   Background   Release Schedule   Downloads
 
      Sudoku  
 
 
 
Preview   Screen shots
 
    Below are nine screen shots. They were all taken during a typical session playing Ziffern. These screen shots were generated from a Windows* 2000 workstation.
 
    The first screenshot reveals what the user will see when the program is launched, after the splash screen times out. The user is presented with a traditional MFC GUI window that contains a menu bar, dockable toolbar, a status bar, and the playing area. This application uses the single document interface (SDI), so there can only be one puzzle open at a time. When launched, a game will be generated and ready for play.
 
    Ziffern at Initial Launch
    Typical view of Ziffern upon successful launch
 
 
    If the player wishes to, a name can be entered into the program. This is accomplished by selecting the "View" menu item and then clicking on the "Player" submenu item. This is shown below.
 
    Player submenu selection
    Selecting the option to name a player
 
 
    At this point the program will launch a dialog allowing the player to enter the desired name, as shown below.
 
    Player name dialog
    The player name dialog
 
 
    Now the player can observe that a name will appear at the top of all games in this session, as shown below.
 
    Game with player's name displayed
    Playing area now shows the player's name
 
 
    At this point the player can begin assigning digits to the symbols. This is done by clicking on the desired symbol with the left mouse button. This action will bring up the number wheel selector control, as shown below. Here one will be able to select the desired digit by clicking on the appropriate sector. A selected digit will appear as a red sector. You can also review which digits have already been selected, as they will appear as gray sectors. The grayed sectors will no longer be available for selection. One can also unselect a selected digit at this point.
 
    Number wheel selector control in action
    Assigning a digit using the number wheel selector control
 
 
    For every position where the selected symbol stands, the assigned digit will now appear. It does not matter which symbol is clicked upon when the assignment is made, all symbols will acquire the assigned digit. The result of assigning two digits is shown below.
 
    Ziffern game in progress
    Ziffern game in progress, with two digits assigned so far
 
 
    As the game progresses, you may observe feedback from the Ziffern application as to the accuracy of your guesses. Once complete numbers materialize from your digit assignments, to the point that an entire equation is evident, then that equation is evaluated against your guesses, and the result of your answer will be broadcast as either red or green digits. The figure below shows the result of guesses that result in invalid equations. In this example there are only enough digits for two equations to be evaluated, and the result of the evaluation is that the math is invalid, resulting in the red digits. The remaining assigned digits are still black, as the numbers they were assigned to do not yet have all of their digits assigned.
 
    Ziffern game with poorly guessed digits
    Ziffern game with poorly guessed digits
 
 
    If you assign digits that result in feasible equations, then the numbers in those equations will appear with green digits. Again, only the feasible equations will appear in green. Also note that it is possible to assign digits such that one equation is feasible, but not the correct answer! Keep in mind then, that green digits do not necessarily mean you have the correct answer. The colors are only a helpful tool. Once all of the digits are green, then you have solved the puzzle. This is shown in the figure below.
 
    Ziffern game with correctly guessed digits
    Ziffern game with all digits guessed correctly
 
 
    When you become frustrated with the game, the player has the ability to look at the answers. This can be selected from the "View" menu item, and then selecting the "Answers" submenu item. This submenu item is a toggle, and will reveal the answers on the playing area instead of the player's assigned digits. The answers will always appear in black, as shown in the figure below. Note that no cheat codes are required to see the answers. At this point in time the game will show all answers at once. To hide the answers, just perform the same steps to toggle the answer display off.
 
    Ziffern game with answers revealed
    Ziffern game with answers revealed
 
 
    Finally, if one wants to start the game over, the "Clear" function can be used. This is accessible from the "Edit" menu item and then selecting the "Clear" submenu item. The same function is available from the toolbar, by selecting the broom icon, which will then sweep away your previous guesses. On the other hand, if you wish to play a brand new game with different equations, just press the new document icon on the toolbar, or select the "File" menu item and then select the "New" submenu item.
 
 
 
Background   History
 
    This puzzle application is based upon a puzzle that ran in Hoer Zu (a weekly German television listing magazine) for some years. A typical puzzle is shown in the figure below (cut from an issue that ran in 1972).
 
    Ziffern game with answers revealed
    The actual puzzle that Ziffern is based upon
 
 
    As you can see, the puzzle resembles six math equations that are interlocked with each other. The math equations are identified by the addition, subtraction, multiplication and division signs, with equal signs inserted as appropriate. What is interesting is that these equations are written using circular symbols instead of digits. These symbols are stand-ins to represent a digit in the math equations. Having ten digits in addition to the six simultaneous equations provides one with more than enough information to solve the equations.
 
    Note that every puzzle has a single solution.
 
    Rules:
 
    Each puzzle had the rules written underneath the game. The original German rules are transcribed here:
 
      Jede Figur bedeutet eine Ziffer. Selbsverstaendlich sind gleiche Figuren auch gleiche Ziffern. Finden Sie nun durch logisches Ueberlegen und Probieren, welche Ziffern an Stelle der Figuren einzusetzen sind.  
 
    Translated into English (a.k.a. Neu-Deutsch):
 
      Each symbol describes a numeric digit. Obviously, identical symbols always map to identical digits. Please solve the problem of determining which digit belongs in the position held by the symbol, using logic, along with trial and error.  
 
    That seems pretty straightforward, just replace the symbols with a digit. Of course there is a logical method of accomplishing tackling this puzzle. Eventually we will post some of those hints.
 
    As an aside, the name of Ziffern is one we selected at the Artige Company. It stands for "digits" in German. We do not know what the proper name of this puzzle is. The published puzzles were titled from a pool of phrases, such as "Rechnen und Raten" = reckoning and guessing, "Etwas zum Knobeln" = something to take a chance on, "Hobby-Mathematik" is self translating, or our favorite "Zum Kopfzerbrechen" = To crack one's head on. We do not ever recall seeing a proper name for these puzzles.
 
    Business Background
 
    We did not write this game just to have fun. It also serves as an example of applied Operations Research (OR), something we specialize at the Artige Company. In this instance of Ziffern we have modeled six production lines, where two lines are fixed for certain products, and four lines have flexibility in the products that they can run. All this with loads of constraints, most of which can be related to the production rates that each line can run at. The Ziffern program uses a random number generator to simulate these production rates, but in "real life" it would be expected that production rate ranges would be made available to the program.
 
    The Ziffern program shows how one can use linear algebra and four-dimensional matrices to solve real world problems. It also shows that the fact such math is being deployed can be hidden from most users, unless they have a desire to know such things. Yes, it can be enjoyable to use operations research on a day-to-day basis!
 
    Technical Background
 
    The Ziffern application was written for a wide audience, which required that the platform be one in widespread use. This would point to either a web application or a Windows* desktop application. With the graphical requirements, we leaned towards writing the first version of Ziffern as a Windows* desktop application. It also helped that we have a few heavy GUI client side VC++/MFC applications that we could draw upon for a framework to write Ziffern against. So this is the reason why Ziffern appears first as a Windows* application. We are holding onto the option to migrate the game to other platforms, such as Linux or Java.
 
    The Ziffern application was written using Visual Studio. It uses the MFC single document interface (SDI) architecture, and would qualify as a MVC (model-view-controller) application. There was no need to have multiple games run simultaneously, so the MDI architecture was skipped this time around.
 
    This application required a neat method to allow the user to assign digits to the symbols. This is an instance where a number selector wheel control is useful. Since we have done custom controls many times before, we just went ahead and whipped up a custom number selector wheel, based upon a Windows* static control running in a dialog box. This control provides for the ability to disable sectors while collecting a new sector.
 
    The only other detail of note is the random number generator. The algorithms used to generate the games are based on trial and error heuristic routines, with the constraints evaluated using matrix math. Since the games are to be generated randomly, and there are many criteria that need to be met simultaneously, there is a need to generate large quantities of random numbers (in the thousands, even millions). We used the good old GetTickCount function, and found out that it has a few caveats. Seems this function is hardware dependent, as the PC manufacturers are the ones that implement it in their firmware. Some PCs (such as one we have) cannot query too often for GetTickCount, else the PC will never return with a value and the program hangs.
 
    Our solution was to reuse the values collected from GetTickCount, in an effort to reduce the need to collect so many random values. In many instances we only need one of 4 or 10 values at a time (four math operations or 10 digits), so we could use individual digits in a random number for separate uses. That seemed to work and had a calming effect on the finicky PC.
 
    One will need to be patient at times when generating a new game. Some games can take 30 seconds to generate, depending if it is a full moon and the autumnal equinox is approaching. If more than a minute passes and a game has not been generated, it is possible that the program is trying to solve an impossible set of equations. Over time we have caught these instances, but there may be others we might have missed. In that case you may need to kill the program, and re-launch it.
 
    As this is a beta program, there are a few other quirks we are aware of that will be addressed. They include the fact that not all ten digits are being used in every game, some games have few digits (only one or two digit numbers), the selector wheel bitmap needs to be prettied up, and that the status bar and edit controls need attention.
 
Sudoku   For those that are interested, the Ziffern algorithms and program structure can serve as the basis for a Sudoku puzzle program (or Soduko for us dyslexic folks). It could use the same algorithms and program structure, plus the number wheel selector control. One would need to extend them further, in order to handle the array of nine sets of nine digits.
 
    Based on the number of inquires we have received, we have taken the first step and written a Sudoku solver application called SSolver. This Windows based program will complete a Sudoku puzzle for you, filling in the blanks. Kind of takes the fun out of it, but if you want to know the answer right away, it will give it to you. In case you are wondering, a Sudoku puzzle is just a specific instance of a warehousing problem, which is solved through a heuristic. Unlike the warehousing problem where one is looking at a collection of possible solutions, a Sudoku puzzle requires a single exact answer. So we had to write some new "coin-flipping" routines to work out the exact answers, holding up the release of the solver. The program is now available for download, please see the Sudoku Solver page for details.
 
 
 
Release Schedule   Trial Version 0.6.1 (Beta 1) Ziffern Release [latest release]
 
    This version is now complete and can be collected below.
 
    A small change was made to the number selector control, in order to improve the graphics and make it look cleaner. This involved removing most of the anti-aliasing pixels, which did not work well in the Windows* 98 version. The previous version (0.6.0) with the original graphics is still available.
 
    It is intended that this program will be posted to SourceForge, assuming that they will have us there.
 
    Expected to be addressed in the Ziffern Version 0.7 (Beta 2) Release:
 
    1- Memory leak check
 
    2- Separate thread for splash screen
 
    3- Add help files
 
    Expected to be addressed in the Ziffern Version 0.8 (Beta 3) Release:
 
    4- Complete personalization
 
    5- Complete printing
 
    6- Complete serialization
 
    Expected to be addressed in the Ziffern Version 0.9 (Beta 4) Release:
 
    7- Improve clue handling and UI for guesses and answers
 
    8- Force every game to include all ten digits
 
 
 
Downloads   Prerequisites:
 
    1- Windows* operating system (Windows 2000, Windows XP)
      We are providing two installation files for Ziffern. One version will only run on Windows* 2000 or Windows* XP. The second installation file will run on Windows* 98, plus Windows* 2000 and Windows* XP. If you are going to run the game on the newer Windows* OS, please select the Windows* 2000 version. The Windows* 98 version runs a bit slower, as we had to use a GDI MaskBlt replacement function that is not available on Windows* 98.
 
      Note: it is always good practice to uninstall a previous version of the Ziffern program using the Windows* control panel "Add/Remove Programs" applet before installing a newer version!
 
    Version 0.6.1
Program - W2K

   Latest
This zip file contains an installation file set to install Ziffern on a Windows* 2000 or Windows* XP workstation. Just save the zip file to a directory and unzip it. Then run setup.exe, and answer the instructions as you would any other installation program. Pretty much no options, other than where to install the executable.
    Version 0.6.1
Program - W98

   Latest
This zip file contains an installation file set to install Ziffern on a Windows* 98 workstation. Just save the zip file to a directory and unzip it. Then run setup.exe, and answer the instructions as you would any other installation program. Pretty much no options, other than where to install the executable.
    Version 0.6.1
Source

   Latest
This zip file contains the Visual Studio project that was used to create the Ziffern application. It includes only the main project source folder, the "res" resource folder and the "hlp" help folders, along with all of their contents. It does not include any of the generated debug or release folders, nor the very large precompiled headers. We will let you generate those yourself.
 
    Version 0.6
Program - W2K
This older zip file is the same as that of the version 0.6.1 Windows* 2000 or Windows* XP zip file, except it has the original version files instead.
    Version 0.6
Program - W98
This older zip file is the same as that of the version 0.6.1 Windows* 98 zip file, except it has the original version files instead.
    Version 0.6
Source
This older zip file is the same as that of the version 0.6.1 source zip file, except it has the original version files instead, mainly the older bitmaps, if you really want to see them.
 
 
    * - Windows is a trademark of the Microsoft Corporation.
 
 
 
    Return to open source page Navigate to home page
 
 
 

Valid XHTML 1.0! Valid CSS!

All rights reserved.   All site content copyright © 1997-2005 Artige Company     For more info... Legal      For more info... Privacy Policy
Last updated:
12-September-2005 01:38z