GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — New dice-rolling app: InfiniDice! by yusufmte · Pull Request #1326 · InfiniTimeOrg/InfiniTime Conversation
Contributor
InfiniDice is a dice-rolling applet where you can roll random numbers from d2 to d99. The functionality is:
It starts at d2 (ie coinflip), and when you first open the app, a roll is made, so you get a "free" coinflip. Then you can change the number of sides and use it as a d6, d20, etc. The color of the result alternates with each roll (so that you can be sure it was actually rolled even when the result is the same). Tested on PineTime hardware with InfiniTime 1.10.0, and found to be in good working order. See video: infinidice.mp4I often find myself looking for dice and think this could come in handy for tabletop players :) Any testing, feedback, or suggestions on optimization would be appreciated!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
NeroBurner
requested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lovely app ❤️
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Thank you @NeroBurner kindly for your improvements on the code ❤️ Thank you everyone for your comments and feedback as well.
I definitely appreciate your sentiment, rolling multiples is a frequently needed and useful function of dice! 👍 However I tend to agree with @minacode , there's a value to keeping the interface simple and intuitive, and #565 already implements multi-roll in a lovely way. But I might be thinking about ways to implement that smoothly without crowding the UI too much. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Implemented rolling multiple dice in 52e4af5 (Thanks for the suggestion @FintasticMan ! 👍) The number of dice can range from 1-9 (default 1), and the sides can range from d2-d99 (default d2). The individual rolls are shown as well. Here's the new look: As before, any feedback or further suggestions are much appreciated. I'll try to keep it up to date with the official develop branch in the meantime. Thanks everyone :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Rebased to 1.14! (Very excited about the customizable user app selection implemented in this version of Infinitime.) I also want to bump this PR in general. It has been ready for a long time, and continuing to work great in 1.14. The shake-to-roll function implemented by @Poohl has been working super well also. This has probably been my most frequently used of the PineTime user apps, and have used it in a few different circles with very good success. Sometimes I have taken the PineTime off the band and passed it around during a tabletop game for players to roll. There have been numerous other PRs for dice apps in the past, so there is definitely interest in such an app from the PineTime community. I know there are a lot of PRs to review and a lot of more important work to do for Infinitime in general -- all on a volunteer basis, which I recognize and greatly appreciate! However, can the maintainers weigh in on the plans for this at some point? @JF002 Are there plans to add it to the 1.15 milestone? Thanks! :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I really like this app! A couple of concerns: do we really need the C++ random generator, is it that much better than C's rand? Could you try using rand with the bias elimination implemented in #881, and see what the difference in flash usage is? If the difference isn't too big, or if you think that rand really isn't good enough, I'd be very happy to use the better C++ generator.
Another concern is how well the shaking works when lower to sleep is also enabled. Could you check if there are any issues there? (I'm also not a big fan of the hack of enabling shake to wake if it's disabled to get it to work, but I don't think that needs to be solved now)
Thank you so much for this app, it's very nice, and I apologise for how long it's taking.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: FintasticMan <[email protected]>
Co-authored-by: FintasticMan <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of things.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@FintasticMan thank you for your kind words & thoughtful feedback/review, I really appreciate it!! ❤️ No apology necessary, you folks have been doing amazing work with InfiniTime and I know you have a ton on your plate!
I noticed that (1) According to official docs,
(2) As you mentioned, there is the possibility of modulo bias with (3) The
That's a great point; I am not sure as I haven't previously used lower to sleep on my own PineTime -- I will test this shortly and report back here soon! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for the thorough explanation. I think it shows you've put a lot of thought into this and I agree that using rand() is not well-suited for this application. Let's stick with the C++ random classes you've already implemented then! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Tested current version on PineTime hardware, it's working well! The lower-to-sleep & raise-to-wake continues to work inside & outside the Dice app when these are enabled, and the shake-to-roll works as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This looks good to me
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Awesome, thanks again!!! Let me know if anything else needed prior to merge! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@yusufmte thank you for your hard work and endurance! We can finally say: Alea iacta est |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thank you friend, and many thanks to all who contributed and reviewed along the way! 🎉 Alea iacta est, indeed! :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add new App `Dice.h` to randomly roll the dice(s). The number of dice can range from 1-9 (default 1), and the sides can range from d2-d99 (default d2). To have a haptic feedback we make Dice vibrate on roll. Regarding the use of C++ `<random>` library: There are known problems with `rand()` and `srand()` (see https://en.cppreference.com/w/cpp/numeric/random/rand) and the `<random>` library is preferred for this reason. The function used from `<random>` also avoids a very rare bias that would occur using `rand()` and modulo, when `RAND_MAX` is not a multiple of `d` and the initially generated number falls in the last "short" segment. This commit also updates the seed to derive entropy (via `seed_seq`) from a mix of the system tick count and the x,y,z components of the PineTime motion controller -- taking inspiration from and with credit to @w4tsn (InfiniTimeOrg#1199) Thanks for suggestions: * in Dice, when rolling 1d2, also show "HEADS" or "TAILS" -- suggestion by @medeyko * ui adjustments and result realignment -- suggestion by @Boteium --------- Co-authored-by: NeroBurner <[email protected]> Co-authored-by: Riku Isokoski <[email protected]> Co-authored-by: Paul Weiß <[email protected]> Co-authored-by: FintasticMan <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.