microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
jan

Branches

Tags

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

Clone

HTTPS

Download ZIP

katas/content/key_distribution/random_array/Solution.qs

11lines · modepreview

namespace Kata {
    import Std.Random.*;

    operation RandomArray(N : Int) : Bool[] {
        mutable array = [false, size = N];
        for i in 0..N - 1 {
            set array w/= i <- DrawRandomInt(0, 1) == 0;
        }
        return array;
    }
}