From c36dd556603ce6905066710497cd6d85488a3f0b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 16 Apr 2019 16:23:03 +0300 Subject: Added the personal project Chopsticks with it's original logs --- .../cSharpVersion/FingerGameCSharp/App.config | 6 ++ .../FingerGameCSharp/FingerGameCSharp.csproj | 53 ++++++++++++++ .../cSharpVersion/FingerGameCSharp/Program.cs | 85 ++++++++++++++++++++++ .../FingerGameCSharp/Properties/AssemblyInfo.cs | 36 +++++++++ 4 files changed, 180 insertions(+) create mode 100644 Chopsticks/cSharpVersion/FingerGameCSharp/App.config create mode 100644 Chopsticks/cSharpVersion/FingerGameCSharp/FingerGameCSharp.csproj create mode 100644 Chopsticks/cSharpVersion/FingerGameCSharp/Program.cs create mode 100644 Chopsticks/cSharpVersion/FingerGameCSharp/Properties/AssemblyInfo.cs (limited to 'Chopsticks/cSharpVersion/FingerGameCSharp') diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp/App.config b/Chopsticks/cSharpVersion/FingerGameCSharp/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp/FingerGameCSharp.csproj b/Chopsticks/cSharpVersion/FingerGameCSharp/FingerGameCSharp.csproj new file mode 100644 index 0000000..cb72676 --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp/FingerGameCSharp.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1} + Exe + FingerGameCSharp + FingerGameCSharp + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp/Program.cs b/Chopsticks/cSharpVersion/FingerGameCSharp/Program.cs new file mode 100644 index 0000000..15b61fa --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp/Program.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FingerGameCSharp +{ + class Program + { + static void Main(string[] args) + { + int p1 = 1; + int p2 = 1; + int e1 = 1; + int e2 = 1; + int sel = 0; + + for (; ; ) + { + if (sel == 0) Console.WriteLine($"{e1} {e2}\r\n-----\r\n{p1} * {p2}\r\n"); + else Console.WriteLine($"{e1} * {e2}\r\n-----\r\n{p1} {p2}\r\n"); + + char yourHand = Console.ReadLine()[0]; + char toHand = Console.ReadLine()[0]; + Console.WriteLine(); + + if (sel == 0) + { + if (yourHand == 'l' && p1 != 5) + { + if (toHand == 'l' && e1 != 5) e1 += p1; + else if (toHand == 'r' && e2 != 5) e2 += p1; + sel = 1; + } + else if (yourHand == 'r' && p2 != 5) + { + if (toHand == 'l' && e1 != 5) { e1 += p2; sel = 1; } + else if (toHand == 'r' && e2 != 5) { e2 += p2; sel = 1; } + else Console.WriteLine("Please select valid enemy hand! (You will have to reselect your hand too!)"); + } + else + { + Console.WriteLine("Please select a valid hand!"); + } + } + else + { + if (yourHand == 'l' && e1 != 5) + { + if (toHand == 'l' && p1 != 5) { p1 += e1; sel = 0; } + else if (toHand == 'r' && p2 != 5) { p2 += e1; sel = 0; } + else Console.WriteLine("Please select valid enemy hand! (You will have to reselect your hand too!)"); + } + else if (yourHand == 'r' && e2 != 5) + { + if (toHand == 'l' && p1 != 5) { p1 += e2; sel = 0; } + else if (toHand == 'r' && p2 != 5) { p2 += e2; sel = 0; } + else Console.WriteLine("Please select valid enemy hand! (You will have to reselect your hand too!)"); + } + else + { + Console.WriteLine("Please select a valid hand!"); + } + + } + + if (p1 == 5 && p2 == 5) + { + Console.WriteLine("Player 2 wins! New game."); + p1 = 1; p2 = 1; e1 = 1; e2 = 1; + sel = 0; + } + else if (e1 == 5 && e2 == 5) + { + Console.WriteLine("Player 1 wins! New game."); + p1 = 1; p2 = 1; e1 = 1; e2 = 1; + sel = 1; + } + + Console.WriteLine(); + } + } + } +} diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp/Properties/AssemblyInfo.cs b/Chopsticks/cSharpVersion/FingerGameCSharp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..df1af1c --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FingerGameCSharp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FingerGameCSharp")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bc7a1a20-429c-45b9-a0bf-4fdc22ced6f1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] -- cgit v1.2.3