Skip to content

Simple collaborative bot drawing "game"

Notifications You must be signed in to change notification settings

K1ll3rF0x/paintbots

 
 

Repository files navigation

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.

About

Simple collaborative bot drawing "game"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 54.4%
  • Clojure 21.2%
  • Python 6.1%
  • TypeScript 6.0%
  • Prolog 4.3%
  • Java 3.1%
  • Other 4.9%