Sample Code from Dudley J. Benton, Ph.D.

Six+ complete and fully functional sample codes are included in this zip file: samplecode102.zip. I hope you find them helpful. If you do, send me an Email.

3D Chess: The knight's tour is when the knight, alone on the chessboard, makes 64 moves, landing on each square once and only once. There are several solutions to this problem. The simple algorithm I use finds different solutions depending on which square you start.knights_tour_in_3D.zip The algorithm in plain C is available: knights_tour_inC.zip and a 16-bit version written entirely in assembler (will not run on a 64-bit system except in a virtual box) is also available knights_tour_16bit.zip more here> knight's_tour

LONGAGO draws a star field with familiar scrolling yellow text while playing the Star Wars® theme. It illustrates how to draw moving stars and scrolling text without flicker. It also illustrates how to use a WAV file as a resource, load it, and play it.

DRAWPLOT shows how to draw a chart or graph.

SHOCOLORS shows the current colors used by Windows® along with the name of each.

SPINCUBE is a screen saver that illustrates how to paint a spinning cube without flicker. It also loads images from BMP, GIF, or JPG files.

TOOLBAR illustrates how to load a toolbar, assign commands to the buttons, and display tool tips when the cursor is over a button.

TREEVIEW illustrates how to create and fill a tree structure (i.e., a nested list of things).

WALKDIR illustrates how to find all files and also handles very long path names. Based on  walkdir.c, there is also emptydir.c that finds all the empty folders on a drive (also with very long file names).

return to home page