examples/book/digital-artists/chapter1/Listing1.6.ck
raw| 1 | // Listing 1.6 Doing math with integers |
| 2 | |
| 3 | // arithmetic with integers |
| 4 | 220 => int myPitch; |
| 5 | |
| 6 | // add or subtract |
| 7 | myPitch + myPitch - 110 => int anotherPitch; |
| 8 | |
| 9 | // multiply |
| 10 | 2 * myPitch => int higherPitch; |
| 11 | |
| 12 | // divide |
| 13 | myPitch / 2 => int lowerPitch; |
| 14 | |
| 15 | // print them all out |
| 16 | <<< myPitch, anotherPitch, higherPitch, lowerPitch >>>; |
| 17 |