-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mixtape Assignment - Arrays
92 lines (65 loc) · 2.08 KB
/
Mixtape Assignment - Arrays
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// It is the era of the cassette tape and making a homemade mixtape for that special someone is no laughing matter. It’s serious business! ♪♪
“The making of a good compilation tape is a very subtle art. Many do’s and don’ts. First of all, you’re using someone else’s poetry to express how you feel. This is a delicate thing.” - High Fidelity
Cassette Tape
Write a program in Mixtape.swift that holds the ultimate playlist of music in a Swift array.
//Code
// Dedicating to atif aslam and his songs which made childhood amazing
print(".------------------------.")
print("| Atif Only 90 min |")
print("| __ ______ __ |")
print("| ( )|).....|( ) |")
print("| (__)|)_____|(__) |")
print("| ________________ |")
print("|___/_._o________o_._\\___|")
var mixtape = [String]()
mixtape.append("Atif Aslam - Doorie")
mixtape.append("Atif Aslam - Tere Liye")
mixtape.append("Atif Aslam - Paniyo Sa")
mixtape.append("Atif Aslam - Pehli Nazar Me")
mixtape.append("Atif Aslam - Aadat")
mixtape.append("Atif Aslam - Janam Janam")
mixtape.append("Atif Aslam - O Mere Khuda")
mixtape.append("Atif Aslam - O Saathi")
mixtape.append("Atif Aslam - Ranj Jo Lagyo")
mixtape.append("Atif Aslam - Jeena Jeena")
let songcount = mixtape.count
print (songcount)
mixtape.remove(at: 8)
mixtape.insert("Atif Aslam - Rafta Rafta", at: 4)
// ======
// Side A
// ======
print("Side A\n")
for i in 0 ..< mixtape.count/2 {
print("\(i+1). \(mixtape[i])")
}
print()
// ======
// Side B
// ======
print("Side B\n")
for i in mixtape.count/2 ..< mixtape.count {
print("\(i+1). \(mixtape[i])")
}
print()
/// Output ///
.------------------------.
| Atif Only 90 min |
| __ ______ __ |
| ( )|).....|( ) |
| (__)|)_____|(__) |
| ________________ |
|___/_._o________o_._\___|
10
Side A
1. Atif Aslam - Doorie
2. Atif Aslam - Tere Liye
3. Atif Aslam - Paniyo Sa
4. Atif Aslam - Pehli Nazar Me
5. Atif Aslam - Rafta Rafta
Side B
6. Atif Aslam - Aadat
7. Atif Aslam - Janam Janam
8. Atif Aslam - O Mere Khuda
9. Atif Aslam - O Saathi
10. Atif Aslam - Jeena Jeena