Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local computer = require("computer")
- melody = {
- {660, 0.1}, {660, 0.1}, {0, 0.1}, {660, 0.1},
- {0, 0.1}, {510, 0.1}, {660, 0.1}, {0, 0.1},
- {770, 0.1}, {0, 0.3}, {380, 0.1}, {0, 0.3},
- {510, 0.1}, {0, 0.1}, {380, 0.1}, {0, 0.1},
- {320, 0.1}, {0, 0.2}, {440, 0.1}, {0, 0.1},
- {480, 0.1}, {0, 0.1}, {450, 0.1}, {0, 0.1},
- {430, 0.1}, {0, 0.1}, {380, 0.1}, {660, 0.1},
- {760, 0.1}, {860, 0.1}, {0, 0.1},
- {700, 0.1}, {800, 0.1}, {660, 0.1}, {0, 0.1},
- {520, 0.1}, {580, 0.1}, {480, 0.1}, {0, 0.2},
- {510, 0.1}, {0, 0.1}, {380, 0.1}, {0, 0.1},
- {320, 0.1}, {0, 0.2}, {440, 0.1}, {0, 0.1},
- {480, 0.1}, {0, 0.1}, {450, 0.1}, {0, 0.1},
- {430, 0.1}, {0, 0.1}, {380, 0.1}, {660, 0.1},
- {760, 0.1}, {860, 0.1}, {0, 0.1},
- {700, 0.1}, {800, 0.1}, {660, 0.1}, {0, 0.1},
- {520, 0.1}, {580, 0.1}, {480, 0.1}, {0, 0.2}
- }
- function music()
- for _, note in ipairs(melody) do
- print(note[1], note[2])
- if note[1] == 0 then os.sleep(note[2]) else computer.beep(note[1], note[2]) end
- end
- music()
- end
- music()
Advertisement