Initial commit
This commit is contained in:
parent
2c47f47f34
commit
c71bf9dd84
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Compilation files.
|
||||||
|
ShiftCipher/bin
|
||||||
|
ShiftCipher/obj
|
||||||
|
|
||||||
|
Testing/bin
|
||||||
|
Testing/obj
|
||||||
|
|
||||||
|
# Visual Studio stuff.
|
||||||
|
ShiftCipher/.vs
|
||||||
|
Testing/.vs
|
||||||
34
Program.cs
34
Program.cs
@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace Shift_Cipher
|
|
||||||
{
|
|
||||||
class Program
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
string shiftedAlphabet = "", finalStr = "", alphabet = "abcdefghijklmnopqrstuvwxyz";
|
|
||||||
Console.Write("Enter a string to be shifted: ");
|
|
||||||
string input = Console.ReadLine();
|
|
||||||
Console.Write("Enter an amount to shift the string between 1 and 25 inclusive: ");
|
|
||||||
string shiftS = Console.ReadLine();
|
|
||||||
int shift = Convert.ToInt32(shiftS);
|
|
||||||
shiftedAlphabet += alphabet.Substring(shift) + alphabet.Substring(0, shift);
|
|
||||||
input = input.ToLower();
|
|
||||||
for(int i = 0; i < input.Length; i++)
|
|
||||||
{
|
|
||||||
if (input.Substring(i, 1).Equals(" "))
|
|
||||||
{
|
|
||||||
finalStr += " ";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for(int j = 0; j < alphabet.Length; j++)
|
|
||||||
{
|
|
||||||
if (input.Substring(i, 1).Equals(alphabet.Substring(j, 1)))
|
|
||||||
finalStr += shiftedAlphabet.Substring(j, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Console.WriteLine("Shifted String: " + finalStr);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
BIN
ShiftCipher/.vs/ShiftCipher/v17/.suo
Normal file
BIN
ShiftCipher/.vs/ShiftCipher/v17/.suo
Normal file
Binary file not shown.
9
ShiftCipher/Program.cs
Normal file
9
ShiftCipher/Program.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace JacobMaurer.ShiftCipher;
|
||||||
|
|
||||||
|
public static class ShiftCipher
|
||||||
|
{
|
||||||
|
static ShiftCipher()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Loaded");
|
||||||
|
}
|
||||||
|
}
|
||||||
10
ShiftCipher/ShiftCipher.csproj
Normal file
10
ShiftCipher/ShiftCipher.csproj
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
31
ShiftCipher/ShiftCipher.sln
Normal file
31
ShiftCipher/ShiftCipher.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.4.33213.308
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftCipher", "ShiftCipher.csproj", "{ED2BA0A8-49A4-48C7-B22C-EA120D871199}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testing", "..\Testing\Testing.csproj", "{C58B7E62-8A1D-4F1C-A160-C5E6366A3C57}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{ED2BA0A8-49A4-48C7-B22C-EA120D871199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{ED2BA0A8-49A4-48C7-B22C-EA120D871199}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{ED2BA0A8-49A4-48C7-B22C-EA120D871199}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ED2BA0A8-49A4-48C7-B22C-EA120D871199}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C58B7E62-8A1D-4F1C-A160-C5E6366A3C57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C58B7E62-8A1D-4F1C-A160-C5E6366A3C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C58B7E62-8A1D-4F1C-A160-C5E6366A3C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C58B7E62-8A1D-4F1C-A160-C5E6366A3C57}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {50ADF85F-11D5-416F-A8B0-0D30F1634269}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@ -1,8 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 16
|
|
||||||
VisualStudioVersion = 16.0.30320.27
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shift_Cipher", "Shift_Cipher\Shift_Cipher.csproj", "{3720F8E0-09B0-47FB-AED7-81451CD7558D}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{3720F8E0-09B0-47FB-AED7-81451CD7558D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{3720F8E0-09B0-47FB-AED7-81451CD7558D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{3720F8E0-09B0-47FB-AED7-81451CD7558D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{3720F8E0-09B0-47FB-AED7-81451CD7558D}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {B3BEA252-4714-4C9F-AFD6-06D70481A1CC}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
11
Testing/Program.cs
Normal file
11
Testing/Program.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using JacobMaurer.ShiftCipher;
|
||||||
|
|
||||||
|
namespace JacobMaurer.Testing;
|
||||||
|
|
||||||
|
public static class Program
|
||||||
|
{
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Testing/Testing.csproj
Normal file
14
Testing/Testing.csproj
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ShiftCipher\ShiftCipher.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Loading…
x
Reference in New Issue
Block a user