Lagt till och kopplat aktuell data till projekten

This commit is contained in:
2018-12-15 17:07:54 +01:00
parent c428484938
commit f7e20aaa17
18 changed files with 5423 additions and 7 deletions

53
2018_05/2018_05.csproj Normal file
View File

@ -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>{97FEEF32-81BC-4DC5-9D3D-6552E989D4AC}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>_2018_05</RootNamespace>
<AssemblyName>2018_05</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>

6
2018_05/App.config Normal file
View File

@ -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>

63
2018_05/Program.cs Normal file
View File

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using static System.Console;
namespace _2018_05
{
class Program
{
static void Main(string[] args)
{
int removes = 0;
string resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181205\2018_05_data.txt");
//string resTab = "dabAcCaCBAcCcaDA";
int varv = 0;
string nextStr = nextLevelStr(resTab,ref removes, ref varv);
while (removes > 0)
{
nextStr= nextLevelStr(nextStr, ref removes, ref varv);
}
WriteLine($"Resulterande sträng : {nextStr} , {nextStr.Length} tkn");
ReadKey();
}
private static string nextLevelStr(string resTab,ref int removes, ref int varv)
{
string tmp = "";
removes = 0;
WriteLine($"inLängd: {resTab.Length}");
foreach(char tkn in resTab.ToCharArray())
{
tmp += tkn;
if (tmp.Length > 1)
{
string v = tmp.Substring(tmp.Length - 2, 1);
string z = tmp.Substring(tmp.Length - 1, 1);
if ((v.ToUpper()== v && z.ToLower() == z || (z.ToUpper() == z && v.ToLower() == v))
&& (v.ToUpper() == z.ToUpper()))
{
if (tmp.Length > 2)
{
tmp = tmp.Substring(0, tmp.Length - 2);
removes++;
}
else tmp = "";
}
}
}
WriteLine($"varv {++varv} ; aktuell längd: {tmp.Length} removes = {removes}");
return tmp;
}
}
}

View File

@ -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("2018_05")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("2018_05")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[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("97feef32-81bc-4dc5-9d3d-6552e989d4ac")]
// 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")]