GithubHelp home page GithubHelp logo

termshape's People

Contributors

scriptprinter avatar zvibazak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sadafshafi

termshape's Issues

Ideia for a default background character

The current implementation: All shape functions use a space character (' ') to a background character, i think that an extra optional paramater to the background character is good.

Support text in a shape

Add option to add text that will be written in a shape.
Need to calc if text is not too long.

Add support for background characters

The current implementation: All shape functions use a space character (' ') to a background character, i think that an extra optional paramater to the background character is good.

Idea for a "custom" shape implementation

The function has 5 parameteres.

width, height, start_x, start_y and lines.

The function creates an empty canvas of width x height.
And start drawings the lines x and y from start_x and start_y.

Example

termshape.custom(10, 10, 0, 0, [(5, 5), (5, 2), (7, 8)])

   X 0  1  2  3  4  5  6  7  8  9
Y
0    *  -  -  -  -  -  -  -  -  -                           
1    -  *  -  -  -  -  -  -  -  -                            
2    -  -  *  -  -  *  -  -  -  -              
3    -  -  -  *  -  *  *  -  -  -           
4    -  -  -  -  *  *  -  *  -  -
5    -  -  -  -  -  *  -  *  -  -
6    -  -  -  -  -  -  -  *  -  -      
7    -  -  -  -  -  -  -  *  -  -
8    -  -  -  -  -  -  -  *  -  -                           
9    -  -  -  -  -  -  -  -  -  -

Observation: the '-' is a space by default (' '), this is just to better style.
I don't know if I explained right, but for any questions, create a comment.

Add parameters validation

When i use a negative value, such as get_square(-5, -5):
ValueError: min() arg is an empty sequence is raised.

Is something relationated with this lines:

# calc min_x, min_y for range with negative values
min_x = abs(min(list_x))
min_y = abs(min(list_y))

in the function make_shape().

And I don't think if is allowed to use a negative number.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.