Live data from Hacker News

Build Pong in Your Terminal with Go for Some Reason

earthly.dev

21–30 of 44 posts

Re: Build Pong in Your Terminal with Go for Some Reason

#22

I also have been using Go with Tcell recently. Making small games is how I have always learned new programming languages. I am coming off of a couple of years of playing with C to understand languages better, and free myself from the complex stacks that I use at work. I've been chatting with a highly-educated PL friend of mine about my language likes/dislikes, and he would always remark on really pragmatic choices Go…

I don't really buy into go (it's not my type of language), but I wanted to ask a genuine question: are there many semi-mainstream languages that don't have modules that _just work_, or an official plugin for VSCode that just works? I've never found that to be a "plus", as much as it is the bare minimum. and nowadays I don't see that many up and coming languages that miss out on it. Admittedly though the cross compila…

You tell me, what other language has a drop-in solution that provides module management, formatting, integration with the debugger, intellisense docs, linting with static analysis while I'm typing, and even testing? The plug-in is actually made by the Go Team at Google, its not like adding Black and Poetry etc. in python, its not even like the moving target that is create-react-app or whatever people use now in JS/TS. Those are much older languages, but what would you compare it to?

I'm not saying Go is the only modern language, its pretty retro in some ways, but it has an exceptional tooling story. The fact that its mainly based around the official go tool helps.

Re: Build Pong in Your Terminal with Go for Some Reason

#23
I always love projects that build from nothing and go step-by-step to build something more complex. Reminds me of one of my favorite posts of a similar style building out "Metaballs" with different algorithms: http://jamie-wong.com/2014/08/19/metaballs-and-marching-squa....

Nice work!

Re: Build Pong in Your Terminal with Go for Some Reason

#26
post #2

I've been trying to learn go by building Pong in my terminal. Here is part One where I create a bouncing ball.

Thanks! Was great fun following along. Noticed a small typo in the first code segment, `screen` becomes `s` when calling s.Init().

Looking forward to part 2!

  func main() {
  
      screen, err := tcell.NewScreen()
  
      if err != nil {
          log.Fatalf("%+v", err)
      }
      if err := s.Init(); err != nil {
          log.Fatalf("%+v", err)
      }
  }

Re: Build Pong in Your Terminal with Go for Some Reason

#27
Fantastic game! Have you considered using the Bubble Tea [1] library?

I recently used Bubble Tea to write a Flappy Bird-like game [2] and it was incredibly fun. It splits your app up into a Model (state), a View function (that uses the model to return a string), and an Update function (that updates the model), like Elm. Plus the other Charm libraries are great for styling terminal output, spring physics, etc.

[1] https://github.com/charmbracelet/bubbletea [2] https://github.com/kbrgl/flapioca

Re: Build Pong in Your Terminal with Go for Some Reason

#28

Earlier quoted context omitted.

I don't really buy into go (it's not my type of language), but I wanted to ask a genuine question: are there many semi-mainstream languages that don't have modules that _just work_, or an official plugin for VSCode that just works? I've never found that to be a "plus", as much as it is the bare minimum. and nowadays I don't see that many up and coming languages that miss out on it. Admittedly though the cross compila…

You tell me, what other language has a drop-in solution that provides module management, formatting, integration with the debugger, intellisense docs, linting with static analysis while I'm typing, and even testing? The plug-in is actually made by the Go Team at Google, its not like adding Black and Poetry etc. in python, its not even like the moving target that is create-react-app or whatever people use now in JS/TS…

Rust also has those things. (It also has performance profiling, fuzz testing, benchmarking tools, etc, etc., as I'm guessing golang does.)

Re: Build Pong in Your Terminal with Go for Some Reason

#30
post #2

I've been trying to learn go by building Pong in my terminal. Here is part One where I create a bouncing ball.

Thanks! Was great fun following along. Noticed a small typo in the first code segment, `screen` becomes `s` when calling s.Init(). Looking forward to part 2! func main() { screen, err := tcell.NewScreen() if err != nil { log.Fatalf("%+v", err) } if err := s.Init(); err != nil { log.Fatalf("%+v", err) } }

Thank you! I noticed a few grammar errors as well so I’ll be sure to update this.
Post reply on HN