Giter VIP home page Giter VIP logo

paintbots's Introduction

Paintbots!

A collaborative canvas where participants program "bots" that move on the canvas and color in cells. The server contains a web UI to watch the canvas in (near) realtime to see how the art is being generated.

The server will also periodically save a PNG of the canvas that can be turned into a video at the end of a session.

Running

Start by running clojure -m paintbots.main. Then open browser at http://localhost:31173

See bots folder for sample bots using simple bash scripts.

Alternatively, you can run local server using Docker without needing to install Clojure: docker run -p 31173:31173 antitadex/paintbots:latest

Bot commands

Each bot must be registered to use. All bot commands are POSTed using simple form encoding to the server. See bots folder _utils.sh on how it uses curl to post commands.

Command Parameters Description
register register=name register a bot with the given name (if not already registered), returns id
info id=ID&info no-op command that just returns bots current
move id=ID&move=DIR move from current to position to direction DIR, which is one of LEFT, RIGHT, UP or DOWN
paint id=ID paint the current position with the current color
color id=ID&color=COL set the current color to COL, which is one of 0-f (16 color palette)
msg id=ID&msg=MSG say MSG, displays the message along with your name in the UI
clear id=ID&clear clear the pixel at current position
look id=ID look around, returns ascii containing the current image (with colors as above)
bye id=ID&bye deregister this bot (id no longer is usable and name can be reused)
bost id=ID&bots return (JSON) information about all registered bots

Register command returns just the ID (as plain text) for future use. All other commands return your bot's current position and color.

paintbots's People

Contributors

k1ll3rf0x avatar tatut 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.