Skip to content

Commit 284b6c0

Browse files
committed
Testes e coisas do tipo
1 parent 596cca3 commit 284b6c0

File tree

192 files changed

+5153
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+5153
-42
lines changed
270 Bytes
Binary file not shown.
39.5 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<ApplicationIcon>índice.ico</ApplicationIcon>
8+
</PropertyGroup>
9+
10+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
11+
<Prefer32Bit>false</Prefer32Bit>
12+
</PropertyGroup>
13+
14+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<_LastSelectedProfileId>C:\Users\pudim\Documents\GitHub\Atividades-PUC\Aprendendo\Forms\Ceaser\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Compile Update="Form1.cs">
8+
<SubType>Form</SubType>
9+
</Compile>
10+
</ItemGroup>
11+
</Project>

Aprendendo/Forms/Ceaser/Ceaser.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31105.61
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ceaser", "Ceaser.csproj", "{21E26E90-95D8-41F4-B92B-2B113498A9CC}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{21E26E90-95D8-41F4-B92B-2B113498A9CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{21E26E90-95D8-41F4-B92B-2B113498A9CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{21E26E90-95D8-41F4-B92B-2B113498A9CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{21E26E90-95D8-41F4-B92B-2B113498A9CC}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {5BBC3992-A3AF-4CDF-A2D2-792C8AD13388}
24+
EndGlobalSection
25+
EndGlobal

Aprendendo/Forms/Ceaser/Form1.Designer.cs

Lines changed: 147 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Aprendendo/Forms/Ceaser/Form1.cs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows.Forms;
10+
using System.Text.RegularExpressions;
11+
12+
namespace Ceaser
13+
{
14+
public partial class Form1 : Form
15+
{
16+
public Form1()
17+
{
18+
InitializeComponent();
19+
}
20+
21+
private void button1_Click(object sender, EventArgs e)
22+
{
23+
List<char> abc = new List<char> { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; // lista char
24+
string valor = coeficiente.Text.Replace(",", "");
25+
valor = valor.Replace(".", "");
26+
if (valor == "")
27+
{
28+
resposta.Text = "Faltou coeficiente";
29+
}
30+
else
31+
{
32+
string respostaf = "";
33+
string codigu = codigo.Text.ToLower();
34+
List<char> codi = new List<char>(codigu);
35+
int k = Convert.ToInt32(valor);
36+
int lenght = abc.Count;
37+
if(checkBox1.Checked == true)
38+
{
39+
k = k - 2 * k;
40+
}
41+
resposta.Text = string.Format("{0}", k);
42+
for(int i = 0; codi.Count > i; i++)
43+
{
44+
for (int j = 0; abc.Count > j; j++) // Loop no alfabeto
45+
{
46+
if (codi[i] == abc[j]) // Checa se a letra da lista ta na do alfabeto
47+
{
48+
k = k % lenght; // Resultato = quantidade de voltas / Resto = quanto de k foi na volta
49+
if (checkBox1.Checked == true && (j + k) < 0)
50+
{
51+
52+
j = ((j + k) + lenght);
53+
respostaf += abc[j];
54+
break;
55+
}
56+
else if (checkBox1.Checked == true && (j + k) > 0)
57+
{
58+
respostaf += abc[j + k];
59+
break;
60+
}
61+
62+
63+
else if (j + k >= lenght)
64+
{
65+
j = ((j + k) - lenght);
66+
respostaf += abc[j];
67+
break;
68+
}
69+
else if (j + k < lenght)
70+
{
71+
respostaf += abc[j + k];
72+
break;
73+
}
74+
}
75+
}
76+
77+
}
78+
resposta.Text = respostaf;
79+
}
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)