Entonces no hay Pull request, no

main
Jaime9070 2023-12-03 13:34:32 +01:00
parent e98bb258b7
commit 0b53a480f6
26 changed files with 535 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdventOfCode", "AdventOfCode\AdventOfCode.csproj", "{4D56E1C0-374C-446F-A0FD-42048ADE935D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DayOne", "DayOne\DayOne.csproj", "{0988CC6B-5B4F-4CC7-814A-C07D27244099}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4D56E1C0-374C-446F-A0FD-42048ADE935D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D56E1C0-374C-446F-A0FD-42048ADE935D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D56E1C0-374C-446F-A0FD-42048ADE935D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D56E1C0-374C-446F-A0FD-42048ADE935D}.Release|Any CPU.Build.0 = Release|Any CPU
{0988CC6B-5B4F-4CC7-814A-C07D27244099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0988CC6B-5B4F-4CC7-814A-C07D27244099}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0988CC6B-5B4F-4CC7-814A-C07D27244099}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0988CC6B-5B4F-4CC7-814A-C07D27244099}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D68AC081-FF6A-4D9B-B3C3-91B8B49A3B8A}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DayOne\DayOne.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,10 @@
using DayOne;
Console.WriteLine("Hello, World!");
var calibrator = new CalibratorReader(@"C:\Users\aime Fernández\Documents\calibraciones.txt");
var calibrationFound = calibrator.ObtainCalibrationValue();
Console.WriteLine($"The calibration found was {calibrationFound}");
Console.ReadLine();

View File

@ -0,0 +1,132 @@
{
"format": 1,
"restore": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj": {}
},
"projects": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj",
"projectName": "AdventOfCode",
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj",
"packagesPath": "C:\\Users\\aime Fernández\\.nuget\\packages\\",
"outputPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\aime Fernández\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj": {
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.100\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"projectName": "DayOne",
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"packagesPath": "C:\\Users\\aime Fernández\\.nuget\\packages\\",
"outputPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\aime Fernández\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\aime Fernández\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.4.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\aime Fernández\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,97 @@
{
"version": 3,
"targets": {
"net6.0": {
"DayOne/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"compile": {
"bin/placeholder/DayOne.dll": {}
},
"runtime": {
"bin/placeholder/DayOne.dll": {}
}
}
}
},
"libraries": {
"DayOne/1.0.0": {
"type": "project",
"path": "../DayOne/DayOne.csproj",
"msbuildProject": "../DayOne/DayOne.csproj"
}
},
"projectFileDependencyGroups": {
"net6.0": [
"DayOne >= 1.0.0"
]
},
"packageFolders": {
"C:\\Users\\aime Fernández\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj",
"projectName": "AdventOfCode",
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj",
"packagesPath": "C:\\Users\\aime Fernández\\.nuget\\packages\\",
"outputPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\aime Fernández\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj": {
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "avWdlvoS1X0O3Uxvyo8ecT8LX0KwJO1URNCLTCWu5AcKYyO+xw6F/3ZtS00l0lYIcPnuw1dlWLhXMDu6iMMtYQ==",
"success": true,
"projectFilePath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\AdventOfCode\\AdventOfCode.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@ -0,0 +1,21 @@
namespace AdventOfCode;
public class CalibratorEvaluator
{
public static int ObtainLineCalibration(string line)
{
var firstDigit = -1;
var lastDigit = -1;
foreach (var character in line)
{
if (char.IsDigit(character))
{
firstDigit = firstDigit == -1 ? (int)char.GetNumericValue(character) : firstDigit;
lastDigit = (int)char.GetNumericValue(character);
}
}
return firstDigit * 10 + lastDigit;
}
}

View File

@ -0,0 +1,27 @@
using AdventOfCode;
namespace DayOne;
public class CalibratorReader
{
public string FilePath { get; set; }
public CalibratorReader(string filePath)
{
FilePath = filePath;
}
public int ObtainCalibrationValue()
{
using StreamReader reader = new StreamReader(FilePath);
var calibrationResult = 0;
while (!reader.EndOfStream)
{
// Read a line from the file
string line = reader.ReadLine() ?? "Something failed";
calibrationResult = calibrationResult + CalibratorEvaluator.ObtainLineCalibration(line);
}
return calibrationResult;
}
}

View File

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,68 @@
{
"format": 1,
"restore": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj": {}
},
"projects": {
"C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"projectName": "DayOne",
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"packagesPath": "C:\\Users\\aime Fernández\\.nuget\\packages\\",
"outputPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\aime Fernández\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\aime Fernández\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.4.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\aime Fernández\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,74 @@
{
"version": 3,
"targets": {
"net6.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net6.0": []
},
"packageFolders": {
"C:\\Users\\aime Fernández\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"projectName": "DayOne",
"projectPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"packagesPath": "C:\\Users\\aime Fernández\\.nuget\\packages\\",
"outputPath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\aime Fernández\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"C:\\Program Files\\dotnet\\library-packs": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.100\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "lGT3L74pRGDbU2rdSM09wsxQT036mnSb7LRBeqSFDMG/I2ffuVE70tLiTVur8fBM4u4alvP8YwNfhVq069nBOQ==",
"success": true,
"projectFilePath": "C:\\CSharp Blazor\\adventOfCode_2023\\CSharp\\AdventOfCode\\DayOne\\DayOne.csproj",
"expectedPackageFiles": [],
"logs": []
}