squiral - square spiral
Project description
squiral
square spiral
Welcome to Squiral!
Here is an example:
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
The basic idea behind printing this matrix is
to start from the middle of the matrix and then moving:
right
>> down
>> left
>> up
and not returning to the same row again.
Install
PyPI
pip install squiral
GitHub
pip install git+https://github.com/sadikkuzu/squiral.git
Usage
In console:
buddha@dharma:~$ squiral 7
43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20 7 8 9 10 27
40 19 6 1 2 11 28
39 18 5 4 3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31
buddha@dharma:~$ squiral --help
usage: squiral [-h] size
positional arguments:
size squiral size
optional arguments:
-h, --help show this help message and exit
In python:
>>> import squiral as sq
>>> sq.printout(sq.produce(5))
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
>>>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
squiral-0.2.1.tar.gz
(4.0 kB
view hashes)