Solution Review: Devise Random Bit Generator
This lesson discusses the solution to the challenge given in the previous lesson.
We'll cover the following...
We'll cover the following...
Go (1.6.2)
package mainimport ("fmt")func main() {ch := make(chan int)// consumer:go func() {for {fmt.Print(<-ch, " ")}}()// producer:for i:=0; i<=100000; i++ {select {case ch <- 0:case ch <- 1:}}}
In the code above, at line 7, we make a channel ch
for integers. Then at line 9, we start an anonymous ...