Terminal-based Tetris - Part 1: Procedural polyomino generation

This is the first part of a series of tutorials on creating a terminal-based Tetris clone with Go. Code for this tutorial is available on GitLab. go get gitlab.com/tslocum/terminal-tetris-tutorial/part-1 # Download and install ~/go/bin/part-1 # Run For a complete implementation of a Tetris clone in Go, see netris. Disclaimer Tetris is a registered trademark of the Tetris Holding, LLC. Rocket Nine Labs is in no way affiliated with Tetris Holding, LLC.

tview and you - Creating Rich Terminal User Interfaces

This is an introduction to using tview (or cview) to create rich terminal-based user interfaces with Go. Primitives The Primitive interface is as follows: type Primitive interface { Draw(screen tcell.Screen) GetRect() (int, int, int, int) SetRect(x, y, width, height int) InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive)) Focus(delegate func(p Primitive)) Blur() GetFocusable() Focusable } Box is the only primitive implemented. It has a size, padding amount, optional border, optional title and background color.