File:Чёртова лестница.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Чёртова_лестница.png(637 × 477 pixels, file size: 7 KB, MIME type: image/png)

Captions

Captions

Devil's staircase

Summary

[edit]
Description
English: Devil's staircase
Русский: Чёртова лестница
Date
Source Own work
Author Владислав Молдован

pascal src code

[edit]
uses GraphABC; 

procedure RLine(x, y, x1, y1: real):=Line(Round(x), Round(y), Round(x1), Round(y1)); 

function Distance(x, y, x1, y1: real):= Sqrt(Sqr(x1 - x) + Sqr(y1 - y)); 

procedure Draw(x, y, x1, y1: real);
begin
  var dx := (x1 - x) / 3;
  var my := (y1 + y) / 2; 
  
  RLine(x + dx, my, x + 2 * dx, my);
  var x2 := x + 2 * dx;
  
  if Distance(x, y, x1, y1) < 10 then 
  begin
    RLine(x, y, x + dx, my); 
    RLine(x2, my, x1, y1); 
  end 
  else 
  begin
    Draw(x, y, x + dx, my); 
    Draw(x2, my, x1, y1); 
  end; 
end;

begin
  SetWindowIsFixedSize(true);
  
  var W := Window.Width; 
  var H := Window.Height;
  
  SetSmoothingOff();
  
  LockDrawing();
  Draw(0, H, W, 0); 
  FloodFill(W - 1, H - 1, clBlack);
  Redraw();
end.

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:14, 1 September 2017Thumbnail for version as of 14:14, 1 September 2017637 × 477 (7 KB)Владислав Молдован (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata