Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Ulam Spiral

Create matrix for Ulam Spiral

Output

$ ruby ulam_spiral.rb 
Put square length as parameter

$ ruby ulam_spiral.rb 5
Input:  5
Output: 5 is not a perfect square

$ ruby ulam_spiral.rb 49
Input:  49
Output: 37 36 35 34 33 32 31 
        38 17 16 15 14 13 30 
        39 18  5  4  3 12 29 
        40 19  6  1  2 11 28 
        41 20  7  8  9 10 27 
        42 21 22 23 24 25 26 
        43 44 45 46 47 48 49 

About

Create matrix for Ulam Spiral

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages