Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
using System; internal class Program { static int MaxPercent = 100; static int LengthBar = 10; static char Sing = '#'; static char EmtySing = '_'; static void Main(string[] args) { Console.CursorVisible = false; DrawBar(40, ConsoleColor.Green, 0, 0); DrawBar(80, ConsoleColor.Blue, 30, 0); for (int i = 0; i <= MaxPercent; i++) { DrawBar(i, ConsoleColor.Yellow, 15, 3); Thread.Sleep(30); } Console.ReadKey(); } static void DrawBar(int filledPercent, ConsoleColor color, int positionX, int positionY) { int remainingPoints = filledPercent * LengthBar / MaxPercent; int emptyPoints = LengthBar - remainingPoints; ConsoleColor defaultColor = Console.ForegroundColor; string bar = ""; FillBar(ref bar, remainingPoints, Sing); FillBar(ref bar, emptyPoints, EmtySing); Console.SetCursorPosition(positionX, positionY); Console.Write('['); Console.ForegroundColor = color; Console.Write(bar); Console.ForegroundColor = defaultColor; Console.Write(']'); } static void FillBar(ref string bar, int cauntPoint, char sing) { for (int i = 0; i < cauntPoint; i++) { bar += sing; } } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)