Skip to content

arturtr/ulam_spiral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages