27 lines
468 B
Go
27 lines
468 B
Go
package main
|
|
|
|
import "main/gadget"
|
|
|
|
type Player interface {
|
|
Play(string)
|
|
Stop()
|
|
}
|
|
|
|
func playlist(device Player, songs []string) {
|
|
for _, song := range songs {
|
|
device.Play(song)
|
|
}
|
|
device.Stop()
|
|
}
|
|
|
|
func main() {
|
|
var player Player
|
|
player = gadget.TapePlayer{}
|
|
mixtape := []string{"Red Plesen'", "Coco Jambo","Barbied Girl"}
|
|
playlist(player,mixtape)
|
|
|
|
player = gadget.TapeRecorder{}
|
|
mixtape = []string{"Dectl'", "Carmen","Scatman"}
|
|
playlist(player,mixtape)
|
|
}
|