Exemplo n.º 1
0
func main() {
	wall, _ := pixelutils.PixelPusher()
	pixel := pixelutils.NewPixel()
	bigPixel := pixelutils.DimensionChanger(pixel, 5*4, 18)
	textPixel := pixelutils.NewImageWriter(bigPixel, pixelutils.Green)

	colons := colonGenerator()
	for {
		pixelutils.Empty(bigPixel)
		textPixel.Cls()
		fmt.Fprintf(textPixel, "%02d%s%02d", time.Now().Hour(), <-colons, time.Now().Minute())
		wall <- pixel
		time.Sleep(500 * time.Millisecond)
	}
}
Exemplo n.º 2
0
func main() {
	wall, _ := pixelutils.PixelPusher()
	pixel := pixelutils.NewPixel()

	bigPixel := pixelutils.DimensionChanger(pixel, 16, 12)
	textPixel := pixelutils.NewImageWriter(bigPixel, pixelutils.Red)
	for i := 0; i < 5; i++ {
		if i > 3 {
			panic("CRASH")
		}
		fmt.Fprintf(textPixel, "%d ", 3-i)
		wall <- pixel
		time.Sleep(1 * time.Second)
	}
}