diff options
Diffstat (limited to 'Chopsticks/cSharpVersion')
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp.exe | bin | 0 -> 6144 bytes | |||
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp.sln | 25 | ||||
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp/App.config | 6 | ||||
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp/FingerGameCSharp.csproj | 53 | ||||
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp/Program.cs | 85 | ||||
| -rw-r--r-- | Chopsticks/cSharpVersion/FingerGameCSharp/Properties/AssemblyInfo.cs | 36 | ||||
| -rw-r--r-- | Chopsticks/cSharpVersion/How to play.txt | 4 |
7 files changed, 209 insertions, 0 deletions
diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp.exe b/Chopsticks/cSharpVersion/FingerGameCSharp.exe Binary files differnew file mode 100644 index 0000000..f7453cb --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp.exe diff --git a/Chopsticks/cSharpVersion/FingerGameCSharp.sln b/Chopsticks/cSharpVersion/FingerGameCSharp.sln new file mode 100644 index 0000000..a8c5537 --- /dev/null +++ b/Chopsticks/cSharpVersion/FingerGameCSharp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2050 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FingerGameCSharp", "FingerGameCSharp\FingerGameCSharp.csproj", "{BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4ABD7B32-E0EE-465F-8E92-B97DD3A3B6F5} + EndGlobalSection +EndGlobal 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 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + </startup> +</configuration>
\ 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{BC7A1A20-429C-45B9-A0BF-4FDC22CED6F1}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>FingerGameCSharp</RootNamespace> + <AssemblyName>FingerGameCSharp</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ 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")] diff --git a/Chopsticks/cSharpVersion/How to play.txt b/Chopsticks/cSharpVersion/How to play.txt new file mode 100644 index 0000000..035f3df --- /dev/null +++ b/Chopsticks/cSharpVersion/How to play.txt @@ -0,0 +1,4 @@ +-type l or r to select your right or left hand +-type l or r to select which enemy hand you want to add fingers to +!all hands to the left side of the screen are l, all to the right are r +star * shows who's turn it is
\ No newline at end of file |
