keltia / dices-rs Goto Github PK
View Code? Open in Web Editor NEWSmall package to deal with dice rolling in Rust (clone of dices-go).
Small package to deal with dice rolling in Rust (clone of dices-go).
We need to implement completion.
Dices> mouv
INFO - roll = Res { list: [3, 3, 1], sum: 5, bonus: -2, flag: None }
We can do better.
doom
is a real command but doesn't need to. Handle real aliases stored in a aliases
file store along the history.
Dices> open d4
[src\bin\dices\main.rs:176] &res = Ok(
Res {
list: [
1,
],
sum: 1,
bonus: 0,
flag: None,
},
)
INFO - roll = Res { list: [1], sum: 1, bonus: 0, flag: None }
If we have an alias pointing to a new command or another alias, the parser is re-entered once but not twice. Make it recursive somehow?
If you run open d4 +1
, bonus is not taken into account.
The current move
command is currently fixed, it should take a bonus argument.
The current system duplicate code between Dice::roll() and DiceSet::roll(). There is also interaction between each Dice and Result.
While doing the sum, it does not take into account the bonus/malus.
main()
currently does too many things and knows about Engine internals. Fix it.
You can probably easily make the parser blow up with defining an alias pointing to another one which points to the first one. We should limit recursion to something sensible like 5.
There is Command::execute()
which deals with builtin commands (like dice
and open
) but all the other commands are handled in Engine
or directly in main()
. This should me fixed.
When parsing new commands, we recurse into the parser until we reach to a Builtin or Alias. Argument to the previous level need to be concatened to the new input so in the lowest level, dice/open need to accept multiple "+/- int".
We can not have quit = exit
because exit
is not a Cmd
. mouv = move +è
because it compiles to dice
. Still having aliases to Commnad
would be nice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.