% Truchet’s problem: examples

%==================================================

% D. Roegel’s solution for Denis Girou’s pstricks competition.

% This solution is written in METAPOST.

% The source file may be formatted using the mft program.

% (the program used for volumes B and E of Computers & Typesetting) % Send comments and improvements to roegel@loria.fr. % ————————————————————————- % Here are several examples. Each beginfig endfig environment

% produces one PostScript file.

%

% We load the tiling macros.

input tiling

randomseed := 23; % this is useful when you want to have always the same tilings.

beginfig(1); TilingLineWidth := 1mm; TruchetTiling(3, 4); endfig;

beginfig(2); TilingUnit := 2cm; TruchetTilingFill := true; TileColors(red, blue); TruchetTiling(5, 3); endfig;

beginfig(3); TilingUnit := 2cm; TruchetTilingFill := true; TileColors((1, 1, 1), (0, 0, 0)); TruchetTiling(2, 3); endfig;

beginfig(4); TilingUnit := 1cm; TruchetTilingFill := true; TileColors((0.5, 0, 1), (0, 1, 0)); TruchetTiling(4, 4); endfig;

beginfig(5); TilingUnit := 1cm; TruchetTilingFill := true; TruchetTiling(10, 10); endfig;

end