Last active
March 18, 2016 22:28
-
-
Save kazuminn/5c120adc428821b78e9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
i := &keybord{instrument: "piano"} | |
run i.SoToSi() | |
sg.wait() | |
} | |
struct keybord type { | |
instrument string | |
} | |
struct sourceMusic interface { | |
soHandler() | |
raHandler() | |
siHandler() | |
} | |
func (r *keybord) SoToSi() { | |
for { | |
select { | |
case so := <-ソを受信 | |
go soHandler() | |
case ra := <-ラを受信 | |
go raHandler() | |
case si := <-シを受信 | |
go siHandler() | |
} | |
} | |
} | |
func soHandler() { | |
playSound(path) | |
} | |
func raHandler() { | |
playSound(path) | |
} | |
func siHandler() { | |
playSound(path) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
動かないので、注意してください。