Beispiel #1
0
func page40_Exercise_Maps() {
	WordCount := func(s string) map[string]int {
		dict := make(map[string]int)
		for _, word := range strings.Fields(s) {
			dict[word] = dict[word] + 1
		}
		return dict
	}

	wc.Test(WordCount)
}
func main() {
	wc.Test(WordCount)
}
Beispiel #3
0
func main() {
	wc.Test(ContadorPalabras)
}
Beispiel #4
0
func main() {
	wc.Test(WordCount)
	print("\n")
}
Beispiel #5
0
func main() {
	mytest := "my test one one two test three two one two"
	fmt.Println(WordCount(mytest))
	wc.Test(WordCount)
}
Beispiel #6
0
func Exercise3() {
	wc.Test(wordCount)
}