diff --git a/content/post/tetris-1.md b/content/post/tetris-1.md index e9bbd9a..9e354fe 100644 --- a/content/post/tetris-1.md +++ b/content/post/tetris-1.md @@ -1,8 +1,10 @@ --- -title: "Textris - Part 1: Pieces and playfield - Creating a terminal-based Tetris clone" +title: "Textris - Creating a terminal-based Tetris clone - Part 1: Pieces and playfield" #date: 2019-11-26T01:42:18-07:00 categories: [tutorial] draft: true +aliases: + - /post/textris-1/ --- This is the first in a series of tutorials on creating a [terminal-based](https://en.wikipedia.org/wiki/Text-based_user_interface) [Tetris](https://en.wikipedia.org/wiki/Tetris) clone with [Go](https://golang.org). @@ -245,7 +247,7 @@ func (p Point) Neighborhood() []Point { } ``` -NewPoints calculates the neighborhood of each point of a mino and returns only new points. +NewPoints calculates the neighborhood of each point of a mino and returns only the new points. ```go func (m Mino) HasPoint(p Point) bool { @@ -263,9 +265,11 @@ func (m Mino) NewPoints() []Point { for _, p := range m { for _, np := range p.Neighborhood() { - if !m.HasPoint(np) { - newPoints = append(newPoints, np) + if m.HasPoint(np) { + continue } + + newPoints = append(newPoints, np) } } diff --git a/content/project/harmony.md b/content/project/harmony.md new file mode 100644 index 0000000..0301ea4 --- /dev/null +++ b/content/project/harmony.md @@ -0,0 +1,8 @@ +--- +title: harmony +summary: Voice and text communications platform +tags: +- Go + +external_link: "https://git.sr.ht/~tslocum/harmony" +---