![]() On the Additional tab select TPaintBox and drop it on the form.From the Standard palette choose a TButton and drop it on the form (in the upper left corner).Press F12 (this will give us the form editor).Uses PegDatastructures, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs Add the following code to the PegDatastructures unit (after the classes in the uses section and before the implementation section):.And we'll encapsulate all this in a class that handles all the data manipulation. We'll simulate this by a simple matrix that has cells of a certain type (empty, occupied and not accessible). The basic elements of a Peg Solitaire board are the marbles, the board structure and the empy places. Save the unit as PegDatastructures.pas (and press the lowercase button that pops up). ![]() So the first step will be the creation of a separate unit for our Solitaire data structures. It's always a good idea to seperate gui related code from data structure definitions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |