I did not find it in the language ref so I understand one can’t generate pseudo random numbers. Are there plans to add it?
FAQ page says they are working on it.
@mieszko @makoto, there is a pseudo-random number generator in Cadence right now actually.
unsafeRand is the name of the built in function. We’re a little bit behind on documentation, but we are doing an overhaul of the cadence formal language spec next week to include all of the features that have been added recently.
Docs UX request - fixed sidebar for section navigation please!
@ebreuers Can you be more specific? What is the problem you are having?
No worries! I just notice navigating the docs is a little tricky as the anchor links are all at the top of the page. I spend a lot of time jumping back up to the Table of Contents navigation and navigating back and forth.
It would be great to have a fixed sidebar on the left or right side of the screen with anchor links to each section. (ie. so I can jump from “Interfaces” to “Resources”) Does that make more sense?
Moving it into the sidebar would be huge if possible: https://www.dropbox.com/s/gxvkoizjf8bw3zb/Screen%20Shot%202020-07-24%20at%201.34.48%20PM.png?dl=0
@MaxStarka Did you implement the sidebar navigation for the language docs in an extension?
Long story short, the current tool we are using for our docs is not very customizable and we are planning on porting the docs to something different and more effective which will have the sidebar navigation.
@ebreuers What other language or tool documentation can you point us to as being docs that are really well organized and easy to understand? It would be great to know what works for you and others so we can improve our own!
You betcha! I’m sure the community would be willing to help out too
Gatsby JS has some of the best doc swag going right now imo:
@ebreuers There is small extension for Chrome:
Which will enable “Omnibox Search” overlay, when you press Ctrl+Alt+F (and I suppsoe Cmd+Option+F on Mac)
@flowjosh My interpreter (flow v.0.5.1 commit: 2cc6bb4142344a65dc3c1481e58a01085390cf23) doesn’t seem to know
unsafeRand as I’m getting:
WARN ERR [4af8be] Execution failed:
cannot find variable in this scope:
unsafeRand. not found in this scope
Also I couldn’t find any mention of it in the
@MaxStarka another awesome tool, thank you!
The function signature is
fun unsafeRandom(): UInt64.
I plan to update the documentation shortly (https://github.com/onflow/cadence/issues/237)
Thanks, got it thanks to the github issue. For the record it’s actually called