This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Pow(x, n int) int { | |
return int(math.Pow(float64(x), float64(n))) | |
} | |
func Permutations(array []int) [][]int { | |
size := len(array) | |
total := Pow(2, size) | |
permutations := make([][]int, 0, total) | |
for i := 0; i < total; i++ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for y := range pic { | |
pic[y] = make([]uint8, dx) | |
for x := range pic[y] { | |
pic[y][x] = uint8(x*y) |
NewerOlder