Hi @tomijaga , It’s the first time I heard about the Motoko “on-chain” package manager “mops”. Is this the standard way to use existing Motoko packages?
I read also in the “mops” we page that I should install the base package using “mops”: mops add base but this is weird because the bas3e package was already available by default. Excuse me for diverting topic but I would like to use the fuzz package and this using mops is something new
Mops is the state of the art and a much better experience than vessel. As a community we likely need do some maintenance and get some of the classic packages in there, but I’m trying to publish anything new that I build there.
Maybe you get base for free? I’m not sure…I think it may default to the latest version and add base for you. @ZenVoich would be able to clear that up.
You need to install the most recent version of the motoko compiler (v0.10.1) that contains the textLowercase() function in the prim module and then update dfx to use the newly installed compiler.
Installing the mocv cli tool (also created by @ZenVoich ) and following the setup instructions should fix the issue.
If you want a permutation (i.e. no repetitions) then you need to some own code on top of fuzz. I don’t think that’s provided by fuzz or any other pseudo-random number library.
You could push your selections into a Set until the desired number are found. There is likely a more efficient way, but depending on your use case, that would likely be the most compact using existing libraries.