Giter VIP home page Giter VIP logo

Comments (12)

ArtemGr avatar ArtemGr commented on June 5, 2024

Hi, quality!

I'm loath to intruduce a syntax that depends on punctuation too much.

roll20 is going the punctuation way and if we'd use the punctuation for something else then we're precluding ourselves from throwing compatibility bridges to roll20. For example, the [] syntax is used to embed extra information in the roll: https://wiki.roll20.net/Dice_Reference#Including_Additional_Information

roll20 seems to be a defacto standard for most people I've heard from, so branching the syntax in a different direction doesn't look attractive.

So to introduce a new syntax I'd rather go literal and functional way, like spelling /r repeat (4d6k3, 6).

(cf. https://app.roll20.net/forum/post/541966/repeat-roll-command ?)

This also includes the possibility of a command specifically tailored for D&D character creation, like /r char (which can be specialized to different systems with /r char (fate)).

If there is a roll20 syntax for repeating we could also emulate it, but I haven't found any with my cursory search.


How does that sound to you?

What would be your preference, implement the /r char first or /r repeat ($dice, $n)?

What seems to be better, /r repeat ($dice, $n) or /r repeat ($n, $dice)?

I'm also thinking of /r repeat_$n ($dice) so as not to make people memorize the correct order of arguments.

from sidekick.

qualityshepherd avatar qualityshepherd commented on June 5, 2024

Sounds great. Yeah /r char is cool because it's easy to remember/type/short... but /r repeat (dice, n) seems right... and will save you from adding a ton of custom rolls. I feel like the repeat_n is less intuitive, but I write code, so... bias?

from sidekick.

qualityshepherd avatar qualityshepherd commented on June 5, 2024

Great dice btw... very clean install. Where do you have this running?

from sidekick.

ArtemGr avatar ArtemGr commented on June 5, 2024

kk

Great dice btw... very clean install.

Thanks! I guess it goes down to proper docs.

Where do you have this running?

I've a couple of servers on server4you.de. The bot is a separate process, binary created with the Rust programming language. Currently it runs from a single server only, but given some spare time I'd like to implement a high availability setup where the bot's hosted on two servers.

from sidekick.

arcandio avatar arcandio commented on June 5, 2024

FWIW, I feel like the repeat argument makes more sense after the dice argument as in /r repeat ($dice, $n). I wonder if you could shorten/clarify that with /repeat ($dice, $n)? Just a thought.

from sidekick.

ArtemGr avatar ArtemGr commented on June 5, 2024

I feel like the repeat argument makes more sense after the dice argument

Okay, got it.

I wonder if you could shorten/clarify that with /repeat ($dice, $n)? Just a thought.

That's a tough call. We're not the only bot around. Other bots might be using "repeat" in some form (Nadeko has ".repeat", for example).

I should think about it some more.

from sidekick.

arcandio avatar arcandio commented on June 5, 2024

Yeah, that's what I was afraid of. Plus, keeping all the functionality on the same command is less confusing I think. /r is probably the way to go.

from sidekick.

qualityshepherd avatar qualityshepherd commented on June 5, 2024

Yeah, dice then repeat arg makes sense. I feel like maybe you want to keep
the /r command... vs using /repeat. But I could be talked into it. But
I like /r repeat (4d6d1, 6) kinda thing.

On Mon, Nov 21, 2016 at 8:14 AM, Joe Bush [email protected] wrote:

FWIW, I feel like the repeat argument makes more sense after the dice
argument as in /r repeat ($dice, $n). I wonder if you could
shorten/clarify that with /repeat ($dice, $n)? Just a thought.

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADJWWspJFor88Fgn-r8iqo-jSrB46n0Mks5rAac-gaJpZM4Kwgv2
.

from sidekick.

ArtemGr avatar ArtemGr commented on June 5, 2024

So I've stretched the code to its limits (given that I have two separate parsers, one for the dice and another for the math, and I wanted repeat to be friendly with both), but it works.

Here's something straight from the unit test:

  mock (&[1, 2, 3, 4]);
  assert_eq! (dice ("repeat (1d20 + 1d20, 2)") .unwrap(), "(1)+(2) = 3, (3)+(4) = 7");
  mock (&[1, 2, 3, 4]);
  assert_eq! (dice ("repeat (2d6 > 3, 2)") .unwrap(), "(~~1~~ ~~2~~, 0 successes) = 0, (~~3~~ 4, 1 success) = 1");

  mock (&[1, 2, 3, 4, 5]);
  assert_eq! (dice ("1d20 + max (repeat (1d20 + 1d20, 2))") .unwrap(), "(1)+max(5,9) = 10");
  mock (&[1, 2, 3, 4]);
  assert_eq! (dice ("min (repeat (2d6 > 3, 2))") .unwrap(), "min(0,1) = 0");

In other words, you can do stuff like /r max (repeat (3d6, 2)) + min (repeat (3d6 > 3, 2)).

from sidekick.

qualityshepherd avatar qualityshepherd commented on June 5, 2024

Great!

from sidekick.

qualityshepherd avatar qualityshepherd commented on June 5, 2024

Works great in discord... are you going to add this to the readme?

from sidekick.

ArtemGr avatar ArtemGr commented on June 5, 2024

Yep, I think I've added a short mention of it already.

from sidekick.

Related Issues (20)

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.