Fichier labyrinthe.jps — Modifié le 3 Mai 2006 à 14 h 13

labyrinthe.pdf
Source
%% auteur : 

%% gh
%% Labyrinthe

%% échelle et étendue de l'image
60 setxunit
0 6 setxrange
0 6 setyrange

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% définitions des couleurs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/coul0 {0 0 0 0.5 setcmykcolor} def %gris
/coul1 {noir} def
/coul2 {orange} def
/coul3 {rouge} def
/coul4 {bleu} def

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% les cases colorées
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/fillstyle {coul1 fill} def 
0 0 1 1 frame*
2 0 3 1 frame*
5 0 6 2 frame*
3 1 4 2 frame*
1 2 3 3 frame*
0 3 1 4 frame*
2 3 5 4 frame*
0 5 1 6 frame*
2 5 3 6 frame*
4 5 5 6 frame*

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% les cadres de tableau
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/axevertical { % pour représenter les axes verticaux
  setxvar x
  [x 0 x 6] (-) ligne
  } def
/axehorizontal { % pour représenter les axes horizontaux
  setxvar x
  [0 x 6 x] (-) ligne
  } def
% On pourrait faire ça à la main :
% [0 0 0 6] (-) ligne
% 1 axevertical

% Mais je préfère utiliser une boucle : c'est la première fois que je 
% le fais...
coul1
2 setlinewidth
0 1 6 {
/i exch def 
i axevertical 
i axehorizontal
} for

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% On indique la sortie
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
setPalatino
coul4
(sortie) 3.5 6 [1.7 dup] dctext