Skip to content

Generate ascii art of arbitrarily large Sierpiński triangles

License

Notifications You must be signed in to change notification settings

NotThatRqd/ascii_sierpinski_triangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ascii_sierpinski_triangle

Generate ascii art of arbitrarily large Sierpiński triangles

Run using any Haskell compiler you want, it doesn't use any dependencies or anything. If you don't know how to use Haskell, just copy and paste the code in Main.hs into a Haskell Repl.it, click run, and type "main" into GHCI

Here are some examples of different sizes:

0:

/\

1:

 /\ 
/\/\

2:

   /\   
  /\/\  
 /\  /\ 
/\/\/\/\

3:

       /\       
      /\/\      
     /\  /\     
    /\/\/\/\    
   /\      /\   
  /\/\    /\/\  
 /\  /\  /\  /\ 
/\/\/\/\/\/\/\/\

4:

               /\               
              /\/\              
             /\  /\             
            /\/\/\/\            
           /\      /\           
          /\/\    /\/\          
         /\  /\  /\  /\         
        /\/\/\/\/\/\/\/\        
       /\              /\       
      /\/\            /\/\      
     /\  /\          /\  /\     
    /\/\/\/\        /\/\/\/\    
   /\      /\      /\      /\   
  /\/\    /\/\    /\/\    /\/\  
 /\  /\  /\  /\  /\  /\  /\  /\ 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

5:

                               /\                               
                              /\/\                              
                             /\  /\                             
                            /\/\/\/\                            
                           /\      /\                           
                          /\/\    /\/\                          
                         /\  /\  /\  /\                         
                        /\/\/\/\/\/\/\/\                        
                       /\              /\                       
                      /\/\            /\/\                      
                     /\  /\          /\  /\                     
                    /\/\/\/\        /\/\/\/\                    
                   /\      /\      /\      /\                   
                  /\/\    /\/\    /\/\    /\/\                  
                 /\  /\  /\  /\  /\  /\  /\  /\                 
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\                
               /\                              /\               
              /\/\                            /\/\              
             /\  /\                          /\  /\             
            /\/\/\/\                        /\/\/\/\            
           /\      /\                      /\      /\           
          /\/\    /\/\                    /\/\    /\/\          
         /\  /\  /\  /\                  /\  /\  /\  /\         
        /\/\/\/\/\/\/\/\                /\/\/\/\/\/\/\/\        
       /\              /\              /\              /\       
      /\/\            /\/\            /\/\            /\/\      
     /\  /\          /\  /\          /\  /\          /\  /\     
    /\/\/\/\        /\/\/\/\        /\/\/\/\        /\/\/\/\    
   /\      /\      /\      /\      /\      /\      /\      /\   
  /\/\    /\/\    /\/\    /\/\    /\/\    /\/\    /\/\    /\/\  
 /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\  /\ 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

About

Generate ascii art of arbitrarily large Sierpiński triangles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published