-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtiemer.cs
More file actions
72 lines (69 loc) · 1.87 KB
/
tiemer.cs
File metadata and controls
72 lines (69 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using static System.Console;
using static System.Threading.Thread;
using static System.ConsoleColor;
//maybe ill use later
/*
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
*/
namespace tiemerNET
{
internal class tiemer
{
static void count(int sec = 0)
{
sec = Int32.Parse(ReadLine());
if (sec < 0)
{
while (sec < 0)
{
Clear();
ForegroundColor = Yellow;
Write("\aIncorrect value! ");
ForegroundColor = White;
WriteLine("Try again");
Write("Seconds: ");
sec = Int32.Parse(ReadLine());
}
}
Clear();
for (int i = sec; ; i--)
{
ForegroundColor = Yellow;
Write(i);
ForegroundColor = White;
Write(" sec remaining");
Sleep(1000);
Clear();
if (i <= 1)
{
Clear();
ForegroundColor = Yellow;
WriteLine("\aTIME UP!1!!");
ForegroundColor = White;
Sleep(1000);
break;
}
}
}
static void Main()
{
Title = "Tiemer.net";
Clear();
BackgroundColor = White;
ForegroundColor = Black;
WriteLine("Type some seconds to begin");
BackgroundColor = Black;
ForegroundColor = White;
WriteLine("1 min = 60 sec");
Write("Seconds: ");
count();
WriteLine("Press any key to exit . . .");
ReadKey();
Clear();
}
}
}