GithubHelp home page GithubHelp logo

plardin / vexbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from noops-challenge/vexbot

0.0 0.0 0.0 4 KB

Ah, Vexbot. She's not really vexing–she just wants to keep everything in a straight line. And that's all she can talk about. Straight lines.

Home Page: https://noopschallenge.com/challenges/vexbot

JavaScript 89.18% HTML 10.82%

vexbot's Introduction

vexbot

👋 Meet Vexbot

Ah, Vexbot. She's not really vexing—she just wants to keep everything in a straight line. And that's all she can talk about. Straight lines.

With every request, Vexbot will send you up to a thousand lines—two pairs of coordinates and a speed.

↗ What can you do?

Just lines? That seems pretty boring...

Sure, you could just draw one line...

single-line

But when you draw a thousand it starts to get interesting...

many-lines

And when you start layering them...

lines-buildup

Or you could ask the nice Vexbot to connect all the lines for you...

connected-lines

And we haven't even gotten into what happens when you animate lines individually...

What's next? That's up to you!

✨ A few ideas

There are millions of things you can do with Vexbot, but here are a few ideas to get you started:

  • Bring it to life: With the connected parameter turned on, our little Vexbot gives you a thousand-jointed creature you can have wriggle across your screen.
  • Pickup Sticks: Ever play the game? Now's your chance to build it.
  • Don't touch the lines: Add a hero whom you navigate around the lines to a destination.

Have an idea of your own? Create an issue and we'll add it to the list!

🤖 API basics

You can request up to 1,000 pairs of coordinates, specify the magnitude and whether you want your lines connected, and set maximum x and y boundaries.

There's a single endpoint: api.noopschallenge.com/vexbot

The endpoint accepts five parameters, all optional:

  • count (optional, numeric): Between 1 and 1000. Number of lines to return
  • magnitude (optional, numeric): Between 1 and 100,000. Maximum length of lines.
  • connected (optional, numeric boolean): 1 or 0. If connected===1, then the b coordinate of each line will be the a coordinate of the next.
  • width (optional, numeric): Between 10 and 100,000. Maximum width of returned points.
  • height (optional, numeric): Between 10 and 100,000. Maximum height of returned points.

The endpoint returns a JSON object with an array named vectors of n length. Each item in the vectors has three properties: a, b, and speed.

Example return for a single line:

{
  "vectors": [
    {
      "a": {
        "x": 743,
        "y": 147
      },
      "b": {
        "x": 60,
        "y": 601
      },
      "speed": 71
    }
  ]
}

Complete API documentation: API.md

More about Vexbot here: https://noopschallenge.com/challenges/vexbot

vexbot's People

Contributors

doolittle 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.