Skip to content

Instantly share code, notes, and snippets.

@Comamoca
Created May 1, 2022 15:25
Show Gist options
  • Save Comamoca/f72ae139904688a63a7fbaaf8d82d0aa to your computer and use it in GitHub Desktop.
Save Comamoca/f72ae139904688a63a7fbaaf8d82d0aa to your computer and use it in GitHub Desktop.
Nimでプログレスバー
import std/terminal
import std/[os, strutils]
for i in 0..100:
stdout.styledWriteLine(fgGreen, "▬".repeat i, if i > 50: fgGreen else: fgYellow, "\t", $i , "%")
sleep 42
cursorUp 1
eraseLine()
stdout.resetAttributes()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment