MASTER MIND

 Below is a GUI for my version of a board game called "Master Mind".

 The object of the game is to guess a color coded sequence.
       
 The program generates a code consisting of 4 colors of which, any can be, one of 5 to 8 colors.  

 The object is to guess the code by making code guesses and receiving grading responses from the program.  

 The guesses are entered by setting the color of 4 buttons.  

 The graded response are either for :
  A
correct color in the correct position a white marker.
  A
correct color in the incorrect position is indicated by a black marker.  
  A
Missed guesses are indicated by a red marker.  

 The program keeps records for 4 players.  The GIU shows the editable help file, (normally out of view).

: "abccba" : "abcXcba" : "abccba" : "abcXcba" "abccba" : "abcXcba" : "abccba" : "abcXcba" :

     Palindromulator : IsPalitable() : NumString()

   The GUI above, is a thread that was spawned from my head,  when I said, I wonder what the natural occurrence of palindromic formations is in
the English Language.  

See: (
http://en.wikipedia.org/wiki/Palindrome )  

   A friend of mine is interested in the subject of palindromes. From the perspective of this program,  it searches text for either a pattern of
"abc
Xcba" what I call a "centered" palindrome, and of the format "abccba", what I call a "mirrored" palindrome.  

   The program simply gathers at least 10 characters from before and after a selected index character.  Spaces and punctuation's are removed
along with null characters and carriage return line feed escape codes produced when 7-bit ASCII is converted to double byte character sets like
Unicode.  
   
   I wrote a function called
IsPalitable(string , int, optional string) AS string, a filter that optionally removes any character or accepts any character
requested.  It starts out with a case statement to remove all the VBNull and the other control type characters.  

   As space is made available by removing undesirable characters additional characters are shifted in from both ends until at least, (for the settings
shown above), 10 characters are collected on either side of the index character.  Then it looks for mirrored text formations around the index
character.  

   It keeps a record of what it finds in a MSFlexGrid Control that dumps to file about every 1,000 finds.  Each character in the  file is tested at least
20 times as the index character moves from the front to the end of file.  

   On my main box, a 2.4Gig FSB533 P-IV with all the background processes going on like Norton Stuff,  the program can only manage to select
about 30 new index characters per second.  

   If I run the program on my laptop with minimal background processes, a 700MHz P-III it tops out at about 113 indexes per second,  I think that
translated to about 2 hours of search time per million character indexes.

   So far the files I have searched include :
War and Peace,
Origin of Species,
Inviable Man,
Alice in Wonderland,
One of Lincoln's speeches.

   Maybe as much as 10 million characters by now.

   The program is optionally case sensitive and will spell out number with letters if that option is selected.  

   A dynamic window extends beyond the normal search window the size of which is a function of characters processed per second and simply
keeps increasing or decreasing the amount of additional characters made available to replace removed characters with out doing the one more,  
one more, one more character thing as it would do without the dynamic window. It keeps doing what it is doing as long as the CPS increases, else
do the opposite.
  

               
 This VB project actually contains 3 unrelated forms or utilities :

Palindromulator, above.
Multi Font Viewer, below.
BMP Icon Editor, on the VB 6.0.40 vector page.

     The BMP icon editor, I made it because the one supplied with my $3k copy of AutoCAD is just to small.  I wanted to add 20 of some
new tools to the ACAD allowing me to nudge objects by various numbers of mills in all four directions with minimal mouse clicks.  That
started out with learning the various version types of BMPs about 12 in number,  with some odd flavors,  along with the different BMP file
headers and Bitmap headers, pallets and compression.  

   24-bit BMPs don't need a color pallet because the 24 bits can simply hold the system color values and in the pixel location where for
BMPs of lesser bits will contain the index into the color pallet contained in the BMP file.  When a BMP file is directly viewed the image is
normally upside down.  

   The icons I wanted to edit were 16x16 so I just stripped the headers off and put the bitmap into a MSHSFlexgrid Control that allowed me
to vary the font to make the bitmap easier to see.  Some views of the GUI show a template BMP that I can edit more by deleting pixels than
adding them.  The program can deal with the file as pixels or bytes.


   The third form is a
Multiple Font Viewer, that will hold 16 fonts side by side,  16 characters to a page.  All the font properties are
adjustable. This makes more sense to me than only looking at one font at a time and having to remember the details of another font that I
really would simply like to see side by side and save that brain cell.  

   When I was a kid I owned a letter press, about a tone of iron that could easily damage a tank.  Along with the press I had 50 cases of
lead hand type, from 6 to 72 point.  With the side by side view I can actually see the difference between a :

ProggyClean.ttf
ProggyCleanCE.ttf
ProggyCleanSZ.ttf

wingding.ttf
wingding2.ttf
wingding3.ttf

   The same font in bold and normal, side by side as well as the same font at 6 and 7 points.  And I can make those little tinny picture fonts
visible to the naked eye.

   I'm not done with this utility yet,  but so far it holds the names of the up to 16 displayed fonts,  a list of additionally selected fonts in a
"drop down list box", comboBox control.  That control can be loaded with the standard Windows Common Dialog control in show fonts
mode.  

   What started this one was that I wanted to make a list of all the fixed pitched or mono space fonts on my machine.  I have 458 fonts in the
Windows Fonts folder.  I have another set of around 350 that are used when I convert an AutoCAD DXF  file into a PostScript file.  I get to
make use of my PostScript SIMM in my 1600CM.  Printing PostScript using the SIMM module gives me a much higher image resolution
than any other image file type I use.  I don't think I have actually used any HPGCL commands with any of my printers.  I do have the
language reference for it,  if I need or want to.

   Fixed pitch fonts are very useful to people who write code.  When I debug code I will look for errors by looking at the text pattern not the
text and try to find discontinuity in the pattern that would indicate a missing comma or a zero, cap O thing or the 1,l thing in Courier as "1,l,".

  I have used courier "0000" for code for ever, never thought about it until I went searching for
lists of fixed pitch fonts on the Web.

   I want to add a fixed pitch font list to the viewer.  It is not hard to test for various levels of monofontism but a list is quicker.
                                   Work Log Tool
                                                       [ DEC, 2001 ]

I wanted a way to track time and progress on projects.  It started out as a stop watch. Now has 3 time groups :
    Session time.  Total of time between using "Start" and "Pause" or "Pause" and "Stop".  
(Work period)
    Elapse time.   Total of session times in 1 standard 24 hour day.        (Work Day)
    Total time.    Total Project Time.        (Man Hours)

    The program stores time as seconds, and uses a Long data type.  That basically limits my projects to a little over 68 years before I
would have to start a second Log.

    The Log text file is displayed in the upper text box.  
    A Project Title can be held in the middle text box.
    The bottom text box is for comments.



































   

   
    The thing that took me the longest to get working correctly was to handle elapse time across midnight.  I could have taken an easier
way out and just keep track of seconds for the elapse times.  But I wanted my normal 10ms of accuracy.  The ET would go negative at
midnight and I would get a divide by zero error.  Where I last worked,  I usually wasn't at work at midnight.  If I was working at home, I just
stopped the clock for a minute at 12:00, "start" and continued.

    Not elegant by any means.

    But until I found out where the error was getting generated from,  it was not worth the time.  Try a fix and wait until the next time I
worked across midnight.  

    A few months ago,  I decided, it was time to take the time to keep more of the time I was loosing.

    Anyhow, fixed, no negative ET and 10ms resolution, where before I only had one clock in my timer function,  now it has 10.  But that's
for another day.

   Below is a screen capture of my VB Editor as I have it look for my use.          
   Green text is comments,  Red text are Visual Basic Keywords.

   This is the procedure that grades the guesses, and colors the grading      indicators and if
indicated, terminates the current game.
   I use programmable error trapping,
controlled by the "UseErrTrp" FLAG.

   I cut and paste the declaration into the
string variable, "ErTrpID" that is returned by
the error handler to indicate where the
program bombed.
VB 6.0.05
[=> Palindromulanculator <=]

  I wrote this one several years ago. Originally it was for practicing,  
loading subscripted instances of a an object. I also wanted a small
keyboard for the mouse

  For the character keys there is only one button in the form at load time.  
The 34 other button objects  are loaded, labeled & positioned with a
loop.  

 By Default, the button's instance number,  is set to be the character code
of the button's caption text.

    There is a single number text box located between 2 arrow buttons.  
The number is an index into an offset value.  The arrow buttons change
the index.  The index number ranges from -1 to 6.

    The offset value is added to the button instance number to change the
character code for the button caption text.  Not all button characters
change with the index value.

 
Single Font Viewer, Keyboard, Notepad.
[Feb 2001]

Top text box is scratch pad space.
The
middle text box contains the keyboard text.
The
bottom text box contains the font name.
The top
check boxes expand the two upper text boxes.
Keyboard text is displayed in the named font.
    
    The "Font" button opens the Common Dialog Control Box in font
mode.

    The "Code check box will cause the character code of the buttons to
be displayed.

    The "NUM", "CAP" & "low" option buttons are index presets.

    "Del" = Delete Last Character.
    "Save" = Copy Keyboard Text to Top Text Box.
    "Clear" = Keyboard Text.
    "ClipBrd" = Keyboard Text to Windows Clip Board.
    "Reset" Default Faunt = Courier New

    Having the character set on the keys for easy selection.  
Combined with the,
copy Keyboard to Clip Board, makes it easy
to insert, "symbols"
, "wingdings" and other graphic characters into
other applications.
Work Log Tool
Date & Time / Comments & Class
Pressing the "UpDate" button, (top of Log text) Copies the
Comments Text into the Log along with the Date and
Time.

    The "Job Code" frame, below the Comments Text box, contains option
buttons that allow for the selection of a job class code.  The code is added
to the Loge when it is updated.  There are 13 Job Class Codes,  the
default setting at program start-up is, "Time Travel".

   The Log file is simple ASCII text.  The tool keeps track of current labor
costs.
Mono-Fontatic

Courier New <=-> -1-l-J-I-L-i-j-o-0-O-  20pt

Courier New, <=-> -1-l-J-I-L-i-j-o-0-O-  18pt

Envy Code R,  <=-> -1-l-J-I-L-i-j-o-0-O- Zeros "0000", almost look 3-D.  14pt
Envy Code R,  <=-> -1-l-J-I-L-i-j-o-0-O- Zeros "0000", almost look 3-D.  16pt
Envy Code R,  <=-> -1-l-J-I-L-i-j-o-0-O- Zeros "0000", almost look 3-D.  18pt

I like the ProFontWindows for the zeros as in "0000", <=-> -1-l-J-I-L-i-j-o-0-O-.  14pt
I like the ProFontWindows for the zeros as in "0000", <=-> -1-l-J-I-L-i-j-o-0-O-.   16pt
I like the ProFontWindows for the zeros as in "0000", <=-> -1-l-J-I-L-i-j-o-0-O-.   18pt
I like the ProFontWindows for the zeros as in "0000", <=-> -1-l-J-I-L-i-j-o-0-O-.   20pt

(But the image seems to change a lot when only changing the pitch. 14pt - 20pt see how the zeros change ?)

The Bitstreams Vera Sans Mono is also one that I like.  Zeros as "0000", <=-> -1-l-J-I-L-i-j-o-0-O-  12pt
The Bitstreams Vera Sans Mono is also one that I like.  Zeros as "0000", <=-> -1-l-J-I-L-i-j-o-0-O-  14pt
The Bitstreams Vera Sans Mono is also one that I like.  Zeros as "0000", <=-> -1-l-J-I-L-i-j-o-0-O-  16pt

The DejaVu Sans Mono.  Zeros as "0000", 1lL".  <=-> -1-l-J-I-L-i-j-o-0-O-  18pt
The DejaVu Sans Mono.  Zeros as "0000", 1lL".  <=-> -1-l-J-I-L-i-j-o-0-O-  20pt
The DejaVu Sans Mono.  Zeros as "0000", 1lL".  <=-> -1-l-J-I-L-i-j-o-0-O-  22pt
Shown
above,
is a
screen
capture,
(JPG),
of the
text below,
(TTF)
as it
appears
on my PC.
If the two images don't match :

DejaVu Sans Mono can be found here,
http://dejavu.sourceforge.net/wiki/index.php/Download.

Bitstreams Vera Sans Mono can be found here,
http://www.dafont.com/theme.php?cat=503

ProFonyWindows can be found here,
http://www.fontspace.com/carl-osterwald/profontwindows

Envy Code R can be found here, "Monospaced"
http://en.wikipedia.org/wiki/List_of_typefaces