View difference between Paste ID: WqvvgZGy and ZkWTkA39
SHOW: | | - or go back to the newest paste.
1
//star wars
2
            int[] melody = { 440, 440, 440, 349, 523, 440, 349, 523, 440, 0, 659, 659, 659, 698, 523, 415, 349, 523, 440, 0, 880, 880, 440, 440, 880, 831, 784, 698, 740, 0, 622, 659, 415, 440, 523, 0, 440, 523, 440, 0 };
3
4
            int[] durationTime = { 500, 500, 500, 350, 150, 500, 350, 150, 650, 500, 500, 500, 500, 350, 150, 500, 350, 150, 650, 500, 500, 500, 350, 150, 500, 350, 150, 650, 150, 500, 150, 500, 150, 1000, 500, 350, 150, 500, 350, 150, 650 };
5
6
7
            for (int i = 0; i < melody.Length; i++)
8
            {
9
                if (melody[i] != 0)
10
                {
11
                    Console.Beep(melody[i], durationTime[i]);
12
                }
13
                else
14
                {
15
                    // pause
16
                    System.Threading.Thread.Sleep(durationTime[i]);
17
                }
18
            }
19
20
21
22
23
24
25
26
            //Mario Bros
27
            int[] melody = { 659, 659, 0, 659, 0, 523, 659, 0, 784, 0, 392, 0, 523, 0, 392, 0, 330, 0, 440, 494, 0, 466, 0, 440, 0, 392, 659, 0, 784, 780, 0, 784, 0, 659, 0, 523, 587, 0, 494, 0, 523, 0, 392, 0, 330, 0, 440, 494, 0, 466, 0, 440, 0 };
28
29
            int[] durationTime = { 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 400, 200, 200, 200, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200 };
30
31
            for (int i = 0; i < melody.Length; i++)
32
            {
33
                if (melody[i] != 0)
34
                {
35
                    Console.Beep(melody[i], durationTime[i]);
36
                }
37
                else
38
                {
39
                    // pause
40
                    System.Threading.Thread.Sleep(durationTime[i]);
41
                }
42
            }