GithubHelp home page GithubHelp logo

pokecat's Introduction

pokecat

Description

pokecat is a utility that prints random pokemon (up to Generation IV) to the terminal using unicode block characters.

Structure

There are 3 Bash scripts, namely ./utils.sh, ./make_res.sh and ./pokecat.sh.

./utils.sh contains a function that checks for dependencies and is used by both ./make_res.sh and ./pokecat.sh for error handling. It has no dependencies.

./make_res.sh downloads the pokemon sprites from and preprocesses them with calls to PokeAPI and ImageMagick. It creates the directory ./res that contains 493 images, one for each pokemon, each named as ./res/ID-NAME.png. For it to work, we need svn, curl, jq and mogrify in PATH. For convenience, ./res has been included in the repository, so there is no need to run ./make_res.sh.

./pokecat.sh prints a random pokemon from ./res to the terminal using catimg (the only dependency of ./pokecat.sh). You can trivially change catimg to any terminal image viewer of your choice.

Instructions

  1. Install dependencies. For example, for ./pokecat.sh on macOS:

    brew install catimg
    

    , or on Ubuntu:

    apt install catimg
    
  2. Clone the repository:

    git clone https://github.com/gvlassis/pokecat.git
    
  3. cd to the cloned repository and run a script. For example, for ./pokecat.sh:

    cd pokecat
    ./pokecat.sh
    
  4. You can create a link of your choice (e.g. pkcat) and add it to a directory that is in your PATH. For example, assuming ~/.local/bin is in your PATH:

    ln -sf "${PWD}/pokecat.sh" "${HOME}/.local/bin/pkcat"
    pkcat
    

    Another good idea might is to call ./pokecat.sh in your shell's initialization script (e.g. .bashrc, .zshrc). For example, for Bash:

    printf "${PWD}/pokecat.sh\n" >> "${HOME}/.bashrc"
    

pokecat's People

Contributors

gvlassis avatar

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.