Skip to content

Commit a27e0e7

Browse files
authored
Merge pull request #6 from jgimeno/master
Create golang version.
2 parents 5bed0fd + 253736c commit a27e0e7

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ cd song
2727
dotnet run
2828
```
2929

30+
A [Go](https://golang.org/) version can be found in the [golang](golang) folder; produce the song with:
31+
32+
go run main.go
33+
34+
3035
You can find out more about the London Code Dojo at our [homepage](http://www.meetup.com/London-Code-Dojo/).
3136

3237
## Objective

golang/main.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
song := `
7+
There was an old lady who swallowed a fly.
8+
I don't know why she swallowed a fly - perhaps she'll die!
9+
There was an old lady who swallowed a spider;
10+
That wriggled and wiggled and tickled inside her.
11+
She swallowed the spider to catch the fly;
12+
I don't know why she swallowed a fly - perhaps she'll die!
13+
There was an old lady who swallowed a bird;
14+
How absurd to swallow a bird.
15+
She swallowed the bird to catch the spider,
16+
She swallowed the spider to catch the fly;
17+
I don't know why she swallowed a fly - perhaps she'll die!
18+
There was an old lady who swallowed a cat;
19+
Fancy that to swallow a cat!
20+
She swallowed the cat to catch the bird,
21+
She swallowed the bird to catch the spider,
22+
She swallowed the spider to catch the fly;
23+
I don't know why she swallowed a fly - perhaps she'll die!
24+
There was an old lady who swallowed a dog;
25+
What a hog, to swallow a dog!
26+
She swallowed the dog to catch the cat,
27+
She swallowed the cat to catch the bird,
28+
She swallowed the bird to catch the spider,
29+
She swallowed the spider to catch the fly;
30+
I don't know why she swallowed a fly - perhaps she'll die!
31+
There was an old lady who swallowed a cow;
32+
I don't know how she swallowed a cow!
33+
She swallowed the cow to catch the dog,
34+
She swallowed the dog to catch the cat,
35+
She swallowed the cat to catch the bird,
36+
She swallowed the bird to catch the spider,
37+
She swallowed the spider to catch the fly;
38+
I don't know why she swallowed a fly - perhaps she'll die!
39+
There was an old lady who swallowed a horse...
40+
...She's dead, of course!
41+
`
42+
fmt.Printf(song)
43+
}

0 commit comments

Comments
 (0)