From 821ecea5b3a6aea15494dd8e9674fac379a2e841 Mon Sep 17 00:00:00 2001 From: ​ Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: string guess --- string_guess/Program.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 string_guess/Program.cs (limited to 'string_guess/Program.cs') diff --git a/string_guess/Program.cs b/string_guess/Program.cs new file mode 100644 index 0000000..c8ad2ce --- /dev/null +++ b/string_guess/Program.cs @@ -0,0 +1,22 @@ +using System; + +Random r = new Random(); +string s = ""; +string keypress = ""; + +for(int i = 0; i < 6; i++) +{ + Console.Clear(); + for(int j = 0; j <= i; j++) + //s += r.Next(10); + s += ((char)r.Next(65, 90)); + Console.Write(s); + Thread.sleep(2000); + Console.Clear(); + keypress = Console.ReadLine(); + Console.Clear(); + if(s != keypress) return; + Console.Write("Success"); + Thread.Sleep(1000); + s = ""; +} -- cgit 1.4.1