microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
sccarda/PythonApiDocs

Branches

Tags

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

Clone

HTTPS

Download ZIP

katas/content/marking_oracles/bit_sum_div_3/Verification.qs

21lines · modecode

1namespace Kata.Verification {
2 import KatasUtils.*;
3 import Std.Arrays.*;
4
5 function F_BitSumDivisibleBy3(args : Bool[]) : Bool {
6 return Count(x -> x, args) % 3 == 0;
7 }
8
9 @EntryPoint()
10 operation CheckSolution() : Bool {
11 for n in 3..6 {
12 if not CheckOracleImplementsFunction(n, Kata.Oracle_BitSumDivisibleBy3, F_BitSumDivisibleBy3) {
13 Message($"Test failed for n = {n}");
14 return false;
15 }
16 }
17
18 Message("Correct!");
19 true
20 }
21}
22