A magical extendable paper :)
Project description
MagicPaper
A magical extendable paper to have fun with ...
Just like someone who said: it's not much, but it's honest work :) .
What's this?
It's just papers in terminal! You can create combinations of them that leads to something interesting ...
Let's try
It's just simple (as it is)
from magic_paper import Paper
paper = Paper()
print(paper)
+---------+
|█████████|
|█████████|
|█████████|
+---------+
Now combine them ...
paper = Paper(right=Paper(bottom=Paper(right=Paper())))
print(paper)
+---------+---------+
|█████████|█████████|
|█████████|█████████|
|█████████|█████████|
+---------+---------+---------+
|█████████|█████████|
|█████████|█████████|
|█████████|█████████|
+---------+---------+
You can change sizes
vertical_paper = Paper(width=3)
print(vertical_paper)
horizontal_paper = Paper(height=1)
print(horizontal_paper)
combined = Paper(width=3, bottom=Paper(height=1))
print(combined)
+---+
|███|
|███|
|███|
+---+
+---------+
|█████████|
+---------+
+---+
|███|
|███|
|███|
+---------+
|█████████|
+---------+
You can use EmptyPaper
for gaps.
from magic_paper import EmptyPaper, Paper
combined = Paper(
height=1,
bottom=Paper(
width=3,
bottom=EmptyPaper(
bottom=Paper(
width=3,
bottom=Paper(
height=1,
right=EmptyPaper(height=1, right=Paper(height=1), bring_back=True),
),
),
bring_back=True,
),
),
right=EmptyPaper(
height=1,
right=Paper(
height=1,
bottom=EmptyPaper(
width=5,
right=Paper(
width=3,
bottom=EmptyPaper(
bring_back=True,
bottom=Paper(
width=3,
),
),
),
bring_back=True,
),
),
bring_back=True,
),
)
print(combined)
+---------+ +---------+
|█████████| |█████████|
+---+-----+ +-----+---+
|███| |███|
|███| |███|
|███| |███|
+---+ +---+
+---+ +---+
|███| |███|
|███| |███|
|███| |███|
+---------+ +---------+
|█████████| |█████████|
+---------+ +---------+
Use >>
, <<
, /
, ^
to create new combination of papers.
maze = (
Paper()
>> (
Paper()
/ ( # Guess what this dose ...
Paper()
>> (
Paper()
>> (
Paper()
>> (
Paper() # <- On top of this <-
# |
^ ( #----- Attach everything inside this ( ) ----
# |
Paper() # <------------ this ------------- |
# | |
<< Paper() # Attach this on the left of -- |
# |
) # ---------------------------------------------
)
)
)
)
)
)
print(maze)
How it's going to looks like:
------>-------->-------
+---------+---------+ +---------+---------+ |
|█████████|█████████| |█████████|█████████| |
|█████████|█████████| |█████████|█████████| v
|█████████|█████████| |█████████|█████████| |
+---------+---------+---------+---------+---------+ |
--<------ |█████████|█████████|█████████|█████████| |
^ |█████████|█████████|█████████|█████████| |
| |█████████|█████████|█████████|█████████| v
| +---------+---------+---------+---------+ |
--------<---------<--------<---------<-------
Now it's time for you to imagine ...
zero_six_seven = Paper(
right=Paper(
right=Paper(
right=EmptyPaper(
right=Paper(
right=Paper(
right=Paper(
right=EmptyPaper(
right=Paper(
right=Paper(
right=Paper(
bottom=Paper(
bottom=Paper(
bottom=Paper(bottom=Paper())
)
)
)
)
),
bring_back=True,
),
bottom=Paper(
bottom=Paper(
bottom=Paper(
bottom=Paper(
left=Paper(
left=Paper(
top=Paper(
top=Paper(right=Paper())
)
)
)
)
)
)
),
)
)
),
bring_back=True,
),
bottom=Paper(
bottom=Paper(
bottom=Paper(
bottom=Paper(
left=Paper(
left=Paper(top=Paper(top=Paper(top=Paper())))
)
)
)
)
),
)
)
)
print(zero_six_seven)
You will need an screen with higher width, if shape below looks wired!
+---------+---------+---------+ +---------+---------+---------+ +---------+---------+---------+
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|█████████|█████████|
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|█████████|█████████|
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|█████████|█████████|
+---------+---------+---------+ +---------+---------+---------+ +---------+---------+---------+
|█████████| |█████████| |█████████| |█████████|
|█████████| |█████████| |█████████| |█████████|
|█████████| |█████████| |█████████| |█████████|
+---------+ +---------+ +---------+---------+---------+ +---------+
|█████████| |█████████| |█████████|█████████|█████████| |█████████|
|█████████| |█████████| |█████████|█████████|█████████| |█████████|
|█████████| |█████████| |█████████|█████████|█████████| |█████████|
+---------+ +---------+ +---------+---------+---------+ +---------+
|█████████| |█████████| |█████████| |█████████| |█████████|
|█████████| |█████████| |█████████| |█████████| |█████████|
|█████████| |█████████| |█████████| |█████████| |█████████|
+---------+---------+---------+ +---------+---------+---------+ +---------+
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|
|█████████|█████████|█████████| |█████████|█████████|█████████| |█████████|
+---------+---------+---------+ +---------+---------+---------+ +---------+
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
Built Distribution
File details
Details for the file MagicPaper-1.1.1.tar.gz
.
File metadata
- Download URL: MagicPaper-1.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ca178caa51b857e61bfe7fb8532ec02a345baea3f80c51aee72db6ef1b0ca0d |
|
MD5 | d948f713ad19b5bcc0f6dd71d20635bd |
|
BLAKE2b-256 | f7c37586c69e2a8f64e0f522d0ea5c05920348451788ca6e16b9cb03a089b3e5 |
File details
Details for the file MagicPaper-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: MagicPaper-1.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3badbd336b66f4c721f58028e489fd835b21af9458f98d0730a6638e6da1ad29 |
|
MD5 | 9dd0a1d50c57adf915f851747786afe0 |
|
BLAKE2b-256 | 5ac863ed791996cc3f04a5d3f67ba4f79ed6b6fddb25afd6683a844c58c68e97 |