Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mj41/algorithm-spiralmatrix
Various Perl 6 Sequences for spirals in matrix (two-dimensional arrays).
https://github.com/mj41/algorithm-spiralmatrix
algorithm matrix perl6-module raku spiral-matrix
Last synced: 9 days ago
JSON representation
Various Perl 6 Sequences for spirals in matrix (two-dimensional arrays).
- Host: GitHub
- URL: https://github.com/mj41/algorithm-spiralmatrix
- Owner: mj41
- License: apache-2.0
- Created: 2019-09-19T15:30:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-04T19:54:12.000Z (over 3 years ago)
- Last Synced: 2024-11-13T13:50:46.885Z (2 months ago)
- Topics: algorithm, matrix, perl6-module, raku, spiral-matrix
- Language: Raku
- Homepage:
- Size: 54.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algorithm::SpiralMatrix
Various Raku Sequences for spirals in matrix (two-dimensional
arrays).For overview see [docs/test-output.md](docs/test-output.md)
and [docs/distance-variants.md](docs/distance-variants.md).## Synopsis
```raku
use Algorithm::SpiralMatrix;my $i = 1;
for square_distance(order => 'clockwise') -> ($x,$y) {
say "{$i++} $x,$y";
last if $i > 25;
}
```will print
```
1 0,0
2 0,-1
3 1,0
4 0,1
5 -1,0
6 1,-1
8 -1,1
9 -1,-1
...
24 -2,2
25 -2,-2
````## Description
This module provides implementation of algorithms to generate various
spiral sequences in matrix (two-dimensional array).## Related links
* [zero2cx/spiral-matrix](https://github.com/zero2cx/spiral-matrix) (Python)
* [bangjunyoung/SpiralMatrixSharp](https://github.com/bangjunyoung/SpiralMatrixSharp) (F#)
* [Exercism: spiral-matrix](https://github.com/exercism/problem-specifications/blob/master/exercises/spiral-matrix/description.md)## Installation
Rakudo Raku distribution contains *zef*. Use
zef install Algorithm::SpiralMatrix
If you have a local copy of this repository use
zef install .
in the module directory.
## Support
Feel free to share your suggestions, patches or comment
[https://github.com/mj41/Algorithm-SpiralMatrix/issues](https://github.com/mj41/Algorithm-SpiralMatrix/issues).## Licence and Copyright
This is free software. Please see the [LICENCE file](LICENSE).
© Michal Jurosz, 2019