Advertisement
sutasuu

pic4(steps)

Oct 30th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Asymptote 0.52 KB | Source Code | 0 0
  1. import geometry;
  2.  
  3. size(9cm,0);
  4. defaultpen(fontsize(12pt));
  5. dotfactor = 4;
  6.  
  7.  
  8. for(int i = 0; i<8; ++i){
  9.   if  (i<=3){
  10.     draw( (i,i)--(i,i+1)--(i+1,i+1) );
  11.     label(string(i), (i,i+1)--(i+1,i+1), N);
  12.   }
  13.   if ( (i>3) & (i<=5) ) draw( (i,i)--(i,i+1)--(i+1,i+1), dashed );
  14.   if  (i==6){
  15.     draw( (i,i)--(i,i+1)--(i+1,i+1) );
  16.     label("n", (i,i+1)--(i+1,i+1), N);
  17.   }
  18.   if  (i>6){
  19.     draw( (i,i)--(i,i+1)--(i+1,i+1) );
  20.     label("n+" + string(i-6), (i,i+1)--(i+1,i+1), N);
  21.   }
  22. }
  23.  
  24.    
  25.  
  26. addMargins(2mm,2mm);
Tags: C++ Asymptote
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement