microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
465 stars 93 forks source link

Make code examples in /samples/language folder more user-friendly #1470

Closed tcNickolas closed 6 months ago

tcNickolas commented 7 months ago

Is your feature request related to a problem? Please describe. Currently the code samples in the /samples/language folder don't produce any output; they evaluate some expressions, but the results are only listed in the comments, not printed for the user to see. This makes any mistakes (such as https://github.com/microsoft/qsharp/pull/1467) hard to spot, and the experience of using them not intuitive.

Describe the solution you'd like We can add some Message commands to print the results of expression evaluation instead of assigning them to variables in most cases (unless, of course, assigning a value to a variable is the point of the example). This will let user compare the results with what they should be easily.

tcNickolas commented 6 months ago

Taking Array.qs for example:

goshua13 commented 6 months ago

Working on this