-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
36 lines (22 loc) · 891 Bytes
/
main.dart
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
main () {
beerBottles(99);
beerBottle(2);
beerBott(1);
}
void beerBottles (int bottles) {
for (int i = 99 ; i > 2 ; i--) {
print ( "$i bottles of beer on the wall, $i bottles of beer.\nTake one down and pass it around, ${i-1} bottles of beer on the wall.");
print ('');
}
}
void beerBottle (int bottle) {
for (int i = 2 ; i > 1 ; i--) {
print ("$i bottles of beer on the wall, $i bottles of beer.\nTake one down and pass it around, ${i-1} bottle of beer on the wall.");
print ('');
}
}
void beerBott (int bott) {
for (int i = 1 ; i > 0 ; i--) {
print ("$i bottle of beer on the wall, $i bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.");
}
}