The highest use of repeated utilization in the Tile engine, except that the ground is the wall, everyone recalls the building wall in Caesar III, or pull the wire, the road in the simcity2000, the road, each object has only a dozen basic pictures. Su is coming, and cross-handling is the procedure automatically selects the correct pattern. Suppose we do a map editor, this feature should not be less :-) In fact, this problem has already appeared in the text mode. That is the processing of the table line. In the text mode, the straight line cannot be drawn. When we need to draw a form, you need to use the ASCII character to splicing the needed graphics. Successful text editor, all of which draw a custom table. The most The problem that needs to be resolved is how to choose the appropriate ASCII code correctly when the form line is crossed. If you use multi-layer conditions to determine it is a very stupid method. The most concise program is to put the stitching of the stitching according to certain order (serial number 2 The in-form can reflect the surrounding connection state). Then the correct element is calculated by a simple formula. Specifically, the up and down left and right connectors are expressed. By reading the current icon Whether there is a connection to generate a number, check the table getting the correct icon. :-) Below with a small program, you can complete the above features, interested friends can read :-) / * wall cross TILE process. Similar to the table of text methods, we need to target the correct ASCII code for the cross-output of the table line. If you use multi-layer conditions to judge, it is a very stupid method. The most simple program is the picture of the splicing Press in a certain order (the 2-way form of the serial number can reflect the surrounding connection). Then the correct element is calculated by a simple formula. The following procedure demonstrates this algorithm. The output is as follows. ┳┳┳ ┓ ┗ ┫ ┫ ┓ ┓ ╋ ┫ ┫ ┻ ┻ ┻ ━ ━ ━ ━ ┛ Procedures are not commented, but it should be easy to understand. If there is a problem, you can contact the author CloudWu@263.nethomepage: http://member.netese.com/~cloudwu cloud wind made from September 20, 1999 * / # include