Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MagicPaper-1.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

MagicPaper-1.1.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page