microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
msoeken/depth_time

Branches

Tags

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

Clone

HTTPS

Download ZIP

samples/language/MultiFileProject/src/Main.qs

18lines · modecode

1// # Sample
2// Multi File Project
3//
4// # Description
5// Organizing code into multiple Q# source files is an important part of
6// writing readable and maintainable code. In this project, we have `Main.qs`,
7// and `Particle.qs`, which defines a new namespace for particle operations.
8// The presence of a Q# manifest file (`qsharp.json`) tells the compiler
9// to include all Q# files under `src/`.
10
11import Particle.*;
12function Main() : Unit {
13 let particleA = new Particle { X = 0, Y = 0, Z = 0 };
14 let particleB = new Particle { X = 1, Y = 1, Z = 1 };
15
16 let particleC = addParticles(particleA, particleB);
17 Message($"Particle C: Particle({particleC.X}, {particleC.Y}, {particleC.Z})")
18}
19