diff --git a/x-tba/slices/21-bouncing-ball-project/01-draw-the-board/main.go b/18-bouncing-ball-project/01-draw-the-board/main.go similarity index 100% rename from x-tba/slices/21-bouncing-ball-project/01-draw-the-board/main.go rename to 18-bouncing-ball-project/01-draw-the-board/main.go diff --git a/x-tba/slices/21-bouncing-ball-project/02-add-a-buffer/main.go b/18-bouncing-ball-project/02-add-a-buffer/main.go similarity index 100% rename from x-tba/slices/21-bouncing-ball-project/02-add-a-buffer/main.go rename to 18-bouncing-ball-project/02-add-a-buffer/main.go diff --git a/x-tba/slices/21-bouncing-ball-project/03-create-the-drawing-loop/main.go b/18-bouncing-ball-project/03-create-the-drawing-loop/main.go similarity index 100% rename from x-tba/slices/21-bouncing-ball-project/03-create-the-drawing-loop/main.go rename to 18-bouncing-ball-project/03-create-the-drawing-loop/main.go diff --git a/x-tba/slices/21-bouncing-ball-project/04-finalize/main.go b/18-bouncing-ball-project/04-finalize/main.go similarity index 90% rename from x-tba/slices/21-bouncing-ball-project/04-finalize/main.go rename to 18-bouncing-ball-project/04-finalize/main.go index 06f9b56..f7a4de4 100644 --- a/x-tba/slices/21-bouncing-ball-project/04-finalize/main.go +++ b/18-bouncing-ball-project/04-finalize/main.go @@ -9,11 +9,9 @@ package main import ( "fmt" - "os" "time" "github.com/inancgumus/screen" - "golang.org/x/crypto/ssh/terminal" ) func main() { @@ -26,12 +24,9 @@ func main() { ) // get the width and height of the terminal dynamically *** - width, height, err := terminal.GetSize(int(os.Stdout.Fd())) - if err != nil { - fmt.Println("cannot get width and height", err) - return - } + width, height := screen.Size() width /= 2 // our emoji is 2 chars wide + height-- // for the border var ( px, py int // ball position diff --git a/x-tba/slices/21-bouncing-ball-project/README.md b/18-bouncing-ball-project/README.md similarity index 100% rename from x-tba/slices/21-bouncing-ball-project/README.md rename to 18-bouncing-ball-project/README.md