home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MANSET.ZIP / MANSET.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-03-25  |  1.6 KB  |  70 lines

  1. {$U+,V-}
  2.  
  3. program manset;
  4. var z,zi,tz,tzi,c,ci,size,acorn,bcorn,mside,nside,mgap,ngap:real;
  5.     m,n:integer;
  6.     count,clr:byte;
  7.     Picname:String[8];
  8.     ch:char;
  9.     Buffer : Array[1..128,1..256] of Char;
  10.     Bufffile: File;
  11. {$I \turbo\Graph.p }
  12.  
  13.  
  14. Procedure GetClr(Var Count,Clr:Byte);
  15. Begin
  16.      Case Count of
  17.           100..200   : Clr:= 0;
  18.           1..99      : Clr:= Count mod 7+1;
  19.      End;
  20. End;
  21.  
  22. begin;
  23. Write('Picture Name ?  ');
  24. Readln(Picname);
  25. If Length(Picname)>8 then halt;
  26. Assign(Bufffile,Picname+'.pic');
  27. Rewrite(Bufffile);
  28. Write(' Enter Real corner  ? ');Readln(Acorn);
  29. Write(' Enter Imaginary corner  ?  ');Readln(bcorn);
  30. Write(' Enter Side length   ?  ');Readln(Mside);
  31. GraphColorMode;
  32. GotoXY(34,1);Write(Acorn:6:4);
  33. GotoXY(34,3);Write(Bcorn:6:4);
  34. GotoXY(34,5);Write(MSide:6:4);
  35. GotoXY(34,7);Write(PicName);
  36. nside:=mside*(16.8/14.6);
  37. mgap:=mside/200;
  38. ngap:=nside/256;
  39. for m:=0 to 199 do
  40.     begin
  41.     for n:= 0 to 255 do
  42.         begin
  43.         c:=n*ngap+acorn;
  44.         ci:=m*mgap+bcorn;
  45.         count:=0;
  46.         z:=0;
  47.         zi:=0;
  48.         repeat
  49.             tz:=z*z-zi*zi;
  50.             tzi:=2*z*zi;
  51.             tz:=tz+c;
  52.             tzi:=tzi+ci;
  53.             size:=sqr(tz*tz+tzi*tzi);
  54.             count:=count+1;
  55.             if count>100 then size:=2.1;
  56.             z:=tz;
  57.             zi:=tzi;
  58.         until size>2.0;
  59.         GetClr(count,clr);
  60.         plot(n,m,clr);
  61.         end;
  62.         Gotoxy(36,24);Write(m);
  63.     end;
  64. GetPic(Buffer,0,0,319,199);
  65. BlockWrite(BuffFile,Buffer,256);
  66. Close(BuffFile);
  67. read(kbd,Ch);
  68. TextMode;
  69. end.
  70.