microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.3.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

katas/content/random_numbers/random_number/solution.md

8lines · modecode

1We can reuse the `RandomBit` and `RandomNBits` operations from earlier exercises.
2
3We'll generate an $N$-bit random number by calling the `RandomNBits` operation, where $N$ is the bitsize of $max - min$. We can repeat this process until the result is less than or equal than $max - min$, and return that number plus $min$.
4
5@[solution]({
6 "id": "random_numbers__random_number_solution",
7 "codePath": "Solution.qs"
8})
9