(* Copyright (C) 2000-2001 Samuel Thibault This program is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program ; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. This License should be available in the same directory as this program, in a file called COPYING. If not, you may ask the webmaster or ftpmaster *) (* Picture it: le prog de dessin bitmap le plus pourri du monde *) #open "graphics";; open_graph "";; let fini=ref false;; let taille_x=16;; let taille_y=16;; let couleurencours=ref black;; let affichelacouleurencours () = set_color !couleurencours; fill_rect 0 16 16 16;; let init ()= for i=0 to 15 do for j=0 to 15 do for k=0 to 15 do set_color (16*j+16*k*256+16*i*65536); plot (16*j+k) i done; done; done; affichelacouleurencours (); moveto 64 16; set_color black; draw_string "Quit";; let finit ()= fini:=false; let yoyo=dump_image (get_image 16 16 16 16) in close_graph ();yoyo ;; let changepoint x y= set_color !couleurencours; plot (x+16) (y+16); fill_rect (x*4) (y*4+32) 4 4;; let cestparti()= while not !fini do if button_down () then begin while button_down() do () done; let position=mouse_pos () in if snd position < 16 then begin couleurencours:=point_color (fst position) (snd position); affichelacouleurencours () end else if snd position < 32 then if fst position>=64 then fini:=true else if (fst position <32) & (fst position>=16) then changepoint (fst position - 16) (snd position - 16) else () else if snd position < 96 then if fst position<64 then changepoint (fst position / 4) ((snd position - 32 ) /4) end done;; let go ()= init(); cestparti(); finit();;