Giter Club home page Giter Club logo

roll's Introduction

roll

Build Status

Web and CLI interface to roll dice.

Usage

  • yarn dev and point browser to localhost:3449 for figwheel and watching the Rust backend. If you don't issue :cljs/quit at the REPL or you'll have to kill figwheel some other way.
  • yarn prod and point browser to localhost:8080 for the production build.
  • yarn demo for a dev server with no hot-reloading - point your browser to localhost:8080.

For EMACS/CIDER, run yarn emacs and then from Emacs invoke M-x cider-jack-in-clojurescript. You'll need to invoke (start-figwheel!). Further instructions can be found here.

The backend component also has two other CLI modes:

  • Invoke with repl as the first arg for a REPL which will evaluate commands in sequence separated by spaces and prompt for further input until a SIGINT.
  • Invoke with your command as space-separated arguments to run a single operation.

You can run the webserver directly via roll (cargo run) or roll serve (cargo run -- serve).

Command formats:

  • A list of valid rolls in XdX format, separated by spaces - 1d2 2d4 3d8
  • A list of string identifier to lookup in the item table - blello, blello, ian
  • A multiplier followed by either a list of valid rolls or a string identifier - 3 1d7, 3 1d8 2d9, 3 blello, 3 blello ian

The multiplier is a little buggy on the web side - it only rolls out the first trailing arg. Stay tuned.

Web server endpoints:

  • GET /roll/:cmd where :cmd is any of the above, but separated by slashes instead of spaces: /roll/1d6, /roll/2d8/3d9, /roll/3/10d20, /roll/9/blello/ian
  • GET /items returns all the items stored in db.sqlite
  • POST /item with an application/json request body like '{"name": "blaster","damage": "1d8"}' to insert that item into the DB

Dependencies

  • Stable rust 1.25.0+
  • Java JRE 1.8+
  • yarn
  • lein
  • cargo-watch

Libraries

Rust Crates

ClojureScript Libraries

roll's People

Contributors

deciduously avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dsrich

roll's Issues

Style

You gotta do what you gotta do

Optimize

There's a lot of slow crap going on here.

  • Multipliers should look up everything first, and then run the command
  • Don't load the item table again each Lookup command - just once on invoke

Redo the style

Especially the roll hx but really the whole thing, come on

Actix

You may have nuked your reference from gotham for new_item.

its here

Rewrite in Yew?

Now that IMPACT has moved to a TypeScript frontend in TTR...

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.