Skip to content

Instantly share code, notes, and snippets.

View aschobel's full-sized avatar

Andreas Schobel aschobel

View GitHub Profile
@aschobel
aschobel / pascal.go
Created January 6, 2012 02:08
Pascal's triangle using channels and goroutines
package main
import "fmt"
func worker(row int, input chan int, output chan int, done chan int) {
display := ""
previous := 0
for i := 0; i < row+1; i++ {
read := <-input
display += fmt.Sprintf("%d ", read)