/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/csharp/tutorials/snippets/top-level-statements/Utilities.cs
24 строки
544 B
Bartosz Klonowski
Present the full `ShowConsoleAnimation` method in Top-level statements tutorial (#41352)
11 июн 2024, 20:58
Не верифицирован
11 июн 2024, 20:58
7ea071f
Код
Авторство
О чём код?
using System; using System.Threading.Tasks; namespace MyNamespace; public static class Utilities { // <Animation> public static async Task ShowConsoleAnimation() { string[] animations = ["| -", "/ \\", "- |", "\\ /"]; for (int i = 0; i < 20; i++) { foreach (string s in animations) { Console.Write(s); await Task.Delay(50); Console.Write("\b\b\b"); } } Console.WriteLine(); } // </Animation> }