Git Product home page Git Product logo

randomart's Introduction

RandomArt

This is a C++ implementation of Andrej Bauer's RandomArt algorithm. It is based on and very similar in structure to his random-art.org Python implementation, but much faster and using a different grammar. All of the following images were generated by this program.

Building

Running make should compile the program, yielding the executable ./run. The program has no external dependencies.

Usage

./run "some text"

This will generate a random image, using the hash of some text you provide as a seed. This is deterministic; the image is always the same for a given input string.

./run

Running the program without arguments will use the hash of the current time in milliseconds as the seed.

In both cases, the image is written in Netpbm PPM format out to random.ppm. By default the program generates a 1000x1000 image, but this can be easily changed by editing main.cpp

Functionality

The program creates a tree of image operations with a specified depth. The default depth is 5. Increasing the depth increases both runtime and level of detail. This is an example tree:

The actual trees generated by the program are much larger. The operations are generated using a Mersenne Twister PRNG, seeded with the hash of whatever input string you give the program. Note that this program just uses the std::unordered_map hasher, which is not cryptographically secure.

See also

randomart's People

Contributors

alexaschor avatar

Watchers

 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.