microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
samples/language/MultiFileProject/src/Main.qs
18lines · modeblame
ce8303b0Alex Hansen1 years ago | 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/`. | |
ff95d996Alex Hansen2 years ago | 10 | |
ce8303b0Alex Hansen1 years ago | 11 | import Particle.*; |
| 12 | function 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})") | |
ff95d996Alex Hansen2 years ago | 18 | } |