Giter VIP home page Giter VIP logo

once-in-a-pi's Introduction

Once in a π

Find any unicode string in π. Honoring pi day

A small python script that transforms a unicode string to numbers - using ord() - and tries to find that string of number in an approximation of π.

usage: once_in_a.py [-h] [--pi PI] [--to TO] lookup_string [lookup_string ...]

Find a random unicode string in an aproximation of PI

positional arguments:
  lookup_string  The unicode string you want to find

optional arguments:
  -h, --help     show this help message and exit
  --pi PI        Set your prefered approximation of π (default: 355/113)
  --to TO        Path to the file to write the results to.

NOTA BENE: the longer the string the longer the program will run, e.g. test is 116101115116 which is not a common pattern in π. For longer strings I suggest you use the flag --to and orphan the process.

Use

Make sure to have Python 3 installed.

  1. Get the code
# Clone the repository
git clone https://github.com/dasdachs/once-in-a-pi

or

curl https://raw.githubusercontent.com/dasdachs/once-in-a-pi/master/once_in_a.py > once_in_a.py
2. Run the code
```bash
python3 once_in_a.py [lookup] # POSIX
python once_in_a.py [lookup]  # Windows

once-in-a-pi's People

Contributors

dasdachs avatar

Watchers

James Cloos avatar  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.