go 15-project-retro-led-clock

2026-08-30 浏览 (1)

NOTES

  • I've explained the challenges and the solutions step by step
  • So, if you get stuck, you can check out the next step without having to look at the entire final solution
  • You can find the explanations and solutions by clicking on the header links below

GET SOCIAL

  • Click the link below to tweet your solution when you complete: http://bit.ly/GOTWEET-CLOCK
  • Discuss your solution with other gophers here: http://bit.ly/LEARNGOSLACK

GOALS:

👉 STEP #1 — Print the Digits

  • Define a new placeholder type
  • Create the digit arrays from 0 to 9
  • Put them into the "digits" array
  • Print them side-by-side

👉 STEP #2 — Print the Clock

  • Get the current time
  • Create the clock array
  • Print the clock
  • Add the separators

👉 STEP #3 — Animate the Clock

  • Create an infinite loop to update the clock
  • Update the clock every second
  • Clear the screen before the infinite loop
  • Move the cursor to the top-left corner of the screen before each step of the infinite loop

👉 BONUS: STEP #4 — Blink the Clock

  • Blink the separators

👉 FULL ANNOTATED SOLUTION

你可能感兴趣的文章

go main

go main

go main

go main

go main

go Header

go main

go main

go main

go main

  • 所属分类: 后端技术
  • 本文标签: golang
  • 版权声明: 本文链接 https://seaxiang.com/blog/cjTynvSl