Day 2 Complete!

master
sigonasr2 1 year ago
parent 284fa07830
commit ce1cda06b4
  1. 138
      Day 2/Day 2.vcxproj
  2. 27
      Day 2/Day 2.vcxproj.filters
  3. 5
      Day 2/Day2_1.txt
  4. 100
      Day 2/Day2_2.txt
  5. 231
      Day 2/main.cpp
  6. 6695
      Day 2/olcPixelGameEngine.h
  7. 10
      Project3.sln

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{fc99e3f2-b7d0-44f4-8f65-e390976ac73b}</ProjectGuid>
<RootNamespace>Day_2</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="olcPixelGameEngine.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="olcPixelGameEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

@ -0,0 +1,5 @@
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green

@ -0,0 +1,100 @@
Game 1: 9 red, 5 blue, 6 green; 6 red, 13 blue; 2 blue, 7 green, 5 red
Game 2: 6 red, 2 green, 2 blue; 12 green, 11 red, 17 blue; 2 blue, 10 red, 11 green; 13 green, 17 red; 15 blue, 20 red, 3 green; 3 blue, 11 red, 1 green
Game 3: 20 green, 1 blue, 7 red; 20 green, 7 blue; 18 red, 8 green, 3 blue; 7 red, 6 blue, 11 green; 11 red, 6 blue, 16 green
Game 4: 6 blue, 6 green; 2 blue, 5 green, 1 red; 9 blue, 1 red, 1 green; 1 red, 6 green, 8 blue; 4 green, 1 red, 1 blue
Game 5: 5 red, 4 blue, 11 green; 10 green, 3 blue, 18 red; 13 red, 13 green, 2 blue
Game 6: 1 blue, 15 green, 7 red; 2 blue, 4 green, 1 red; 1 blue, 13 green, 11 red; 2 blue, 10 red, 9 green
Game 7: 8 green, 1 blue, 1 red; 2 red, 2 green, 3 blue; 2 red, 1 blue
Game 8: 5 green, 9 blue, 2 red; 7 green, 3 red, 1 blue; 7 blue, 2 red, 1 green; 4 blue, 2 red, 14 green; 1 red, 5 blue, 12 green; 7 green, 9 blue, 3 red
Game 9: 11 red, 6 blue; 2 blue, 8 red, 9 green; 8 green, 13 red, 14 blue; 2 blue, 7 red, 9 green
Game 10: 3 red, 3 blue, 4 green; 4 red, 3 green, 2 blue; 13 red, 4 blue, 3 green; 6 blue, 5 green, 8 red; 10 red, 5 blue, 3 green
Game 11: 8 blue, 2 green, 4 red; 2 red, 13 blue, 2 green; 7 red, 3 green, 13 blue; 8 blue, 4 red; 12 blue, 6 red; 18 blue, 3 red, 1 green
Game 12: 15 red, 2 blue; 3 red, 5 green, 1 blue; 2 blue, 3 green, 6 red; 9 red, 4 green, 4 blue; 3 green
Game 13: 3 red, 3 green, 14 blue; 3 red, 14 blue, 1 green; 3 green, 4 blue; 7 blue, 1 red, 4 green
Game 14: 1 green, 2 red, 4 blue; 3 green, 5 blue, 11 red; 12 red, 2 green; 1 blue, 3 green, 4 red
Game 15: 1 red, 3 green, 4 blue; 2 red, 3 green, 2 blue; 10 green, 3 red, 3 blue; 5 red, 11 green, 3 blue
Game 16: 5 red, 12 blue, 12 green; 8 red, 5 blue; 11 green, 5 blue, 12 red; 4 green, 10 blue, 1 red; 1 blue
Game 17: 18 green, 15 red, 5 blue; 5 blue, 4 green, 14 red; 4 red, 7 blue, 9 green
Game 18: 2 red, 12 blue, 2 green; 15 blue, 4 red; 14 red; 11 red, 5 green, 5 blue
Game 19: 4 red, 2 blue, 4 green; 5 red; 7 green, 1 blue; 1 green, 4 red, 2 blue
Game 20: 5 green, 1 blue; 3 blue, 9 green; 14 blue, 7 green; 7 green, 1 red, 1 blue; 7 green, 2 blue
Game 21: 6 blue, 3 green, 8 red; 9 red, 1 green, 1 blue; 4 green, 7 red; 1 blue, 1 green, 12 red; 4 green, 9 red, 5 blue
Game 22: 1 red, 3 blue, 2 green; 12 green, 5 blue, 1 red; 1 green, 3 blue, 3 red; 1 red, 8 green, 2 blue
Game 23: 2 blue, 9 red, 14 green; 7 blue, 10 red; 7 blue, 7 green, 1 red
Game 24: 19 red, 3 green; 7 blue, 4 green, 12 red; 14 red, 3 green, 1 blue; 3 green, 14 red; 5 green, 7 blue, 18 red
Game 25: 12 red, 4 green, 3 blue; 3 blue, 12 red, 11 green; 3 red, 11 green, 2 blue
Game 26: 11 green, 2 red; 5 blue, 4 red; 1 green, 6 blue, 3 red; 9 red, 7 blue; 1 blue, 6 red, 1 green
Game 27: 10 red, 8 blue, 7 green; 6 green, 7 blue; 4 red, 10 green, 9 blue; 9 red, 2 green, 1 blue; 11 blue, 15 red, 9 green
Game 28: 3 blue, 2 red, 8 green; 3 red, 10 green; 11 green, 1 blue; 5 blue, 6 green, 7 red; 3 blue, 2 green
Game 29: 18 red, 1 blue; 3 red, 4 blue, 7 green; 1 blue, 16 green, 2 red; 3 blue, 6 green, 15 red; 1 red, 1 blue; 17 red, 6 green
Game 30: 10 red, 6 blue, 13 green; 2 green, 10 red, 4 blue; 4 red, 2 green, 2 blue
Game 31: 5 red, 13 green, 5 blue; 5 green, 12 blue, 5 red; 5 red, 3 green, 5 blue; 2 green, 3 red, 14 blue
Game 32: 2 blue, 14 red, 13 green; 11 red, 3 green, 1 blue; 9 red, 2 blue, 2 green; 5 blue, 3 red, 2 green; 4 blue, 8 green, 6 red; 12 red, 4 green, 5 blue
Game 33: 1 green, 15 blue; 1 red, 4 blue; 1 red, 1 green, 5 blue
Game 34: 1 green, 2 blue, 3 red; 11 red, 10 blue; 6 blue, 3 red
Game 35: 2 blue, 3 red, 1 green; 1 green, 9 blue, 8 red; 2 blue, 5 red; 2 green, 2 red, 2 blue; 1 red, 10 blue; 5 red, 9 blue
Game 36: 8 green, 1 red, 2 blue; 7 red, 5 green, 9 blue; 1 red, 10 green, 13 blue; 1 red, 10 green
Game 37: 1 green, 1 red; 2 green, 2 red; 2 green, 6 red; 7 red; 1 blue, 2 red
Game 38: 8 red, 7 green, 11 blue; 6 green, 10 blue, 11 red; 13 blue, 18 green, 7 red; 2 red, 7 blue, 12 green
Game 39: 4 blue, 8 red; 1 blue, 11 red, 2 green; 2 green, 3 blue, 12 red; 6 red, 1 green, 9 blue; 6 red, 1 blue, 1 green
Game 40: 2 blue, 17 red, 2 green; 4 red, 7 green; 4 blue, 1 green, 10 red; 6 green, 2 red; 6 red, 1 blue, 4 green; 5 green, 9 red, 4 blue
Game 41: 1 red, 8 blue; 3 green, 5 red, 3 blue; 8 blue, 1 green; 1 red, 9 blue; 5 red, 3 blue; 1 green, 4 red, 3 blue
Game 42: 7 green, 1 red, 10 blue; 11 blue, 1 green; 1 red, 17 blue, 2 green; 1 red, 4 green; 1 green, 3 blue; 11 blue, 1 red
Game 43: 5 green, 1 red; 5 blue, 3 green, 14 red; 7 green, 2 red, 11 blue; 3 red, 10 green, 4 blue; 5 green, 3 blue, 9 red; 8 green, 3 blue, 2 red
Game 44: 10 blue, 1 red, 2 green; 5 blue, 2 green, 2 red; 2 red, 2 green, 5 blue; 7 blue, 14 red, 1 green; 1 red, 2 green, 5 blue
Game 45: 16 green, 11 blue, 7 red; 6 blue, 8 red, 9 green; 7 green, 8 blue, 10 red; 13 red, 15 green, 8 blue; 3 red, 12 green
Game 46: 7 red, 2 green, 4 blue; 3 green, 7 blue; 2 blue, 5 red, 2 green; 3 green, 8 blue, 2 red
Game 47: 6 blue, 5 red; 5 red, 4 green, 5 blue; 4 green, 8 red; 5 red, 4 blue, 4 green; 5 blue, 5 green, 3 red; 5 blue, 2 green, 3 red
Game 48: 11 blue, 7 green, 2 red; 3 red, 8 green, 1 blue; 3 red
Game 49: 8 blue, 1 green, 3 red; 2 blue, 4 red; 6 red, 1 green; 2 red, 10 blue, 10 green
Game 50: 1 red, 8 green; 1 blue, 2 red, 8 green; 7 red, 1 blue; 7 red, 1 blue, 5 green; 6 green, 3 red
Game 51: 10 blue, 6 red; 10 red; 12 red, 5 blue; 11 red, 3 green, 3 blue
Game 52: 11 green, 7 red, 3 blue; 1 red, 9 blue, 8 green; 16 green, 2 blue, 8 red; 8 blue, 6 green; 3 blue, 5 red, 10 green; 8 red, 9 blue, 12 green
Game 53: 1 green, 4 blue, 11 red; 1 green, 12 red, 6 blue; 1 green, 5 red, 12 blue; 5 red, 11 blue; 1 blue, 11 red; 8 blue, 4 red, 1 green
Game 54: 3 blue, 2 green, 8 red; 2 blue, 5 red; 3 blue, 2 red, 2 green; 1 red, 9 blue; 5 red
Game 55: 1 green, 11 blue, 5 red; 16 blue, 11 green, 8 red; 16 blue, 2 red, 13 green
Game 56: 8 green, 6 blue, 6 red; 10 blue, 6 red, 9 green; 3 green, 13 blue, 6 red; 4 green, 5 blue, 3 red
Game 57: 6 green, 6 blue; 1 green, 1 red; 14 green, 1 blue
Game 58: 1 blue; 1 red; 1 red, 3 green, 1 blue; 1 red
Game 59: 5 green, 10 red; 1 green, 2 blue, 6 red; 8 red, 3 green, 2 blue; 4 green, 1 blue
Game 60: 2 red, 8 green; 1 blue, 3 green, 1 red; 2 green, 1 blue, 5 red; 1 red, 13 green, 1 blue; 4 red, 6 green, 1 blue
Game 61: 2 red, 2 green; 15 red, 1 green, 3 blue; 20 red; 7 red, 2 blue; 8 red, 5 blue, 1 green
Game 62: 4 green, 12 red, 14 blue; 11 red, 3 blue, 13 green; 6 green, 16 blue, 7 red; 7 red, 10 blue, 11 green
Game 63: 2 green, 8 red, 3 blue; 1 red; 2 blue, 8 red; 5 blue, 2 red; 1 green, 5 blue, 10 red; 1 green, 3 blue, 11 red
Game 64: 12 blue, 2 red, 4 green; 4 green, 3 red, 5 blue; 9 blue, 1 red, 4 green; 7 green, 7 blue, 1 red; 1 red, 10 blue, 2 green
Game 65: 4 blue, 2 green, 1 red; 1 blue, 4 red, 3 green; 5 green, 3 red; 1 red, 2 green, 15 blue; 3 blue, 3 red
Game 66: 1 red, 7 blue, 1 green; 3 red, 1 green, 1 blue; 1 green, 9 red, 2 blue; 2 green, 2 blue; 5 red, 3 green, 3 blue; 1 blue, 5 red
Game 67: 6 green; 17 green, 5 blue; 3 blue, 3 red, 9 green; 2 green, 4 blue; 1 red, 15 green
Game 68: 1 blue, 11 red, 8 green; 17 green, 3 blue, 8 red; 5 green, 8 red; 18 green, 7 red, 2 blue; 6 green
Game 69: 12 green, 13 blue, 2 red; 4 red, 14 green, 1 blue; 11 red, 15 green, 5 blue; 15 green, 9 red; 4 blue, 1 red, 5 green; 10 red, 20 green, 13 blue
Game 70: 6 red, 8 green, 7 blue; 5 blue, 1 red, 17 green; 2 red, 3 blue, 6 green; 7 blue, 1 red, 14 green; 7 red, 6 blue, 16 green
Game 71: 3 green, 3 blue, 3 red; 1 blue, 11 red, 2 green; 1 blue, 11 red
Game 72: 9 red, 17 blue, 1 green; 20 red, 3 green, 2 blue; 14 blue, 4 green, 11 red; 2 red, 12 blue, 7 green; 18 red, 13 blue, 7 green
Game 73: 6 green, 12 blue, 1 red; 10 blue, 5 red; 6 green, 17 blue, 3 red
Game 74: 1 green, 2 blue, 13 red; 2 blue, 2 green, 1 red; 2 green, 1 blue, 7 red; 1 red, 1 green
Game 75: 10 red, 2 green; 3 blue, 4 green; 9 red, 1 green
Game 76: 1 red, 3 green, 1 blue; 3 blue, 4 green, 6 red; 9 blue, 12 green, 2 red; 5 green, 1 red, 1 blue
Game 77: 3 blue, 4 red, 11 green; 8 green, 5 red; 7 blue, 11 green; 1 green, 3 blue, 6 red
Game 78: 15 blue, 5 green; 7 green, 9 blue; 7 green, 3 red, 2 blue
Game 79: 9 green, 6 red, 4 blue; 4 blue, 2 red, 14 green; 17 green, 2 blue, 4 red; 1 red, 2 green; 3 red, 3 green, 2 blue
Game 80: 1 green; 15 green, 1 red; 1 blue, 20 green, 1 red; 3 red, 15 green, 1 blue; 4 red, 3 green; 2 red, 18 green
Game 81: 4 blue, 1 green, 13 red; 13 blue, 19 red; 4 red, 13 blue; 8 blue, 10 red; 13 blue, 5 red; 1 green, 7 blue, 12 red
Game 82: 5 red, 3 blue; 4 red, 3 green, 9 blue; 19 blue, 1 green, 5 red; 5 green, 3 red, 10 blue
Game 83: 9 red, 3 blue, 5 green; 1 blue, 1 green, 11 red; 2 blue, 6 green, 18 red
Game 84: 2 green; 6 green, 5 red; 3 green, 1 red, 1 blue
Game 85: 2 blue, 6 red; 9 green, 5 red, 15 blue; 7 green, 10 red, 2 blue; 10 red, 6 blue, 2 green; 8 green, 5 red, 12 blue; 6 green, 5 blue, 6 red
Game 86: 2 blue, 12 red, 3 green; 3 red, 2 blue; 1 green, 2 blue, 2 red; 7 blue, 3 red, 1 green; 1 green, 2 blue, 5 red; 3 green, 14 red, 4 blue
Game 87: 3 blue, 1 green; 3 red, 2 blue, 1 green; 1 red, 3 blue; 10 red, 3 green; 5 red, 2 blue
Game 88: 3 blue, 9 red, 9 green; 9 blue, 11 red; 2 green, 11 blue; 2 blue, 14 red, 1 green; 7 green, 11 blue, 8 red; 9 red, 8 green, 3 blue
Game 89: 3 red, 1 blue, 16 green; 5 blue, 4 red, 3 green; 3 blue, 5 red, 5 green; 5 green, 8 blue, 2 red; 4 green, 2 red, 1 blue; 4 red, 1 green, 6 blue
Game 90: 7 green, 8 red; 1 blue, 7 green, 5 red; 4 green, 6 red
Game 91: 3 green, 6 red, 4 blue; 2 green, 9 red, 10 blue; 3 green, 12 blue; 1 red, 4 blue
Game 92: 12 green, 8 blue, 16 red; 6 red, 14 green, 4 blue; 3 green, 3 red, 10 blue; 9 blue, 6 red, 15 green; 14 green, 9 blue, 10 red
Game 93: 4 blue, 4 red, 9 green; 2 blue, 2 green, 6 red; 1 blue, 7 red; 7 blue, 17 red; 2 blue, 13 red, 10 green
Game 94: 4 green, 10 red; 9 red; 1 green, 3 blue, 14 red
Game 95: 9 green, 5 red; 3 blue, 11 red, 6 green; 4 red, 1 green; 13 green, 3 blue, 5 red; 1 red, 6 blue, 12 green; 7 red, 7 green
Game 96: 6 blue; 5 green, 2 blue, 2 red; 14 blue, 3 green
Game 97: 1 blue, 2 green, 5 red; 2 green, 8 blue, 9 red; 1 green, 8 blue, 6 red; 1 blue, 17 red; 2 green, 10 blue, 11 red
Game 98: 3 red, 12 blue, 2 green; 3 green, 4 blue, 4 red; 1 red, 11 blue, 2 green; 1 blue, 3 red
Game 99: 2 green, 9 red; 8 red, 4 green, 9 blue; 8 blue, 13 red; 10 green, 8 blue, 6 red; 11 green, 2 red, 13 blue
Game 100: 5 blue, 2 green, 7 red; 14 red, 15 green, 1 blue; 3 blue, 3 red; 8 green, 10 red, 6 blue; 6 blue, 4 red, 8 green

@ -0,0 +1,231 @@
#pragma region Hidden Setup Stuff
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
using namespace olc;
enum Run{
FILE1,
FILE2
};
// Override base class with your custom functionality
class AoC2023 : public olc::PixelGameEngine
{
std::vector<std::string>lines;
bool waitForRender=false;
void wait(int pauseMs=0){
waitForRender=true;
while(waitForRender);
std::this_thread::sleep_for(std::chrono::milliseconds(pauseMs));
}
#pragma endregion
#include <limits>
const int DAY = 2;
Run runInput=FILE2;
void doStuff2(){
while(true){ //lines is accessible as a global.
int id=1;
long powerSum=0;
for(std::string&line:lines){
bool allowed=true;
std::string strippedLine=line.substr(line.find(':')+2);
size_t semiColon=strippedLine.find(';');
int min_red=0,min_green=0,min_blue=0;
#pragma region Parse by Semi-Colon
while(semiColon!=std::string::npos){
std::string pull=strippedLine.substr(0,semiColon);
#pragma region Parse by Spaces
size_t space=pull.find(' ');
while(space!=std::string::npos){
std::string numb=pull.substr(0,space);
int number=atoi(numb.c_str());
if(pull[space+1]=='b'){
if(number>min_blue)min_blue=number;
}else
if(pull[space+1]=='g'){
if(number>min_green)min_green=number;
}else
if(pull[space+1]=='r'){
if(number>min_red)min_red=number;
}
if(pull.find(' ',space)==std::string::npos)break;
pull=pull.substr(pull.find(' ',space)+1);
space=pull.find(' ');
}
#pragma endregion
strippedLine=strippedLine.substr(semiColon+2);
semiColon=strippedLine.find(';');
}
#pragma endregion
#pragma region Parse by Spaces
std::string pull=strippedLine;
size_t space=pull.find(' ');
while(space!=std::string::npos){
std::string numb=pull.substr(0,space);
int number=atoi(numb.c_str());
if(pull[space+1]=='b'){
if(number>min_blue)min_blue=number;
}else
if(pull[space+1]=='g'){
if(number>min_green)min_green=number;
}else
if(pull[space+1]=='r'){
if(number>min_red)min_red=number;
}
if(pull.find(' ',space)==std::string::npos)break;
pull=pull.substr(pull.find(' ',space)+1);
space=pull.find(' ');
}
#pragma endregion
uint32_t power=min_red*min_green*min_blue;
std::cout<<"======="<<std::endl;
powerSum+=power;
id++;
}
std::cout<<"Sum of Power: "<<powerSum<<std::endl;
break;
//wait(0); //Wait for 0ms and render the screen (calls draw())
}
}
void doStuff(){
while(true){ //lines is accessible as a global.
int id=1;
int limit_red=12,limit_green=13,limit_blue=14;
int idSum=0;
for(std::string&line:lines){
bool allowed=true;
std::string strippedLine=line.substr(line.find(':')+2);
size_t semiColon=strippedLine.find(';');
#pragma region Parse by Semi-Colon
while(semiColon!=std::string::npos){
int red=0,green=0,blue=0;
std::string pull=strippedLine.substr(0,semiColon);
#pragma region Parse by Spaces
size_t space=pull.find(' ');
while(space!=std::string::npos){
std::string numb=pull.substr(0,space);
int number=atoi(numb.c_str());
if(pull[space+1]=='b'){
blue=number;
}else
if(pull[space+1]=='g'){
green=number;
}else
if(pull[space+1]=='r'){
red=number;
}
if(pull.find(' ',space)==std::string::npos)break;
pull=pull.substr(pull.find(' ',space)+1);
space=pull.find(' ');
}
#pragma endregion
std::cout<<"Pulled out "<<red<<" red, "<<blue<<" blue, "<<green<<" green"<<std::endl;
if(allowed)allowed=!(red>limit_red||green>limit_green||blue>limit_blue);
strippedLine=strippedLine.substr(semiColon+2);
semiColon=strippedLine.find(';');
}
#pragma endregion
#pragma region Parse by Spaces
int red=0,green=0,blue=0;
std::string pull=strippedLine;
size_t space=pull.find(' ');
while(space!=std::string::npos){
std::string numb=pull.substr(0,space);
int number=atoi(numb.c_str());
if(pull[space+1]=='b'){
blue=number;
}else
if(pull[space+1]=='g'){
green=number;
}else
if(pull[space+1]=='r'){
red=number;
}
if(pull.find(' ',space)==std::string::npos)break;
pull=pull.substr(pull.find(' ',space)+1);
space=pull.find(' ');
}
#pragma endregion
std::cout<<"Pulled out "<<red<<" red, "<<blue<<" blue, "<<green<<" green"<<std::endl;
if(allowed)allowed=!(red>limit_red||green>limit_green||blue>limit_blue);
std::cout<<"======="<<std::endl;
if(allowed)idSum+=id;
id++;
}
std::cout<<"Sum of IDs: "<<idSum<<std::endl;
break;
//wait(0); //Wait for 0ms and render the screen (calls draw())
}
}
void draw(){ //Only use Sprites! If using decals, you must reference global variables!
Clear(BLACK);
int count=0;
for(std::string&line:lines){
DrawString({0,count*32},line,WHITE,4);
count++;
}
}
#pragma region Hidden Engine Stuff
public:
AoC2023()
{
// Name your application
std::string fileName="day"+std::to_string(DAY)+"_1.txt";
if(runInput==FILE2){fileName="day"+std::to_string(DAY)+"_2.txt";}
std::ifstream file(fileName);
while(file.good()){
std::string line;
std::getline(file,line);
lines.push_back(line);
}
sAppName = "Advent of Code 2023 - Day "+std::to_string(DAY);
}
public:
bool OnUserCreate() override
{
return true;
}
bool OnUserUpdate(float fElapsedTime) override
{
static std::thread aocSolver(&AoC2023::doStuff2,this);
if(waitForRender){
draw();
waitForRender=false;
}
return true;
}
};
int main()
{
AoC2023 game;
if (game.Construct(640, 480, 2,2))
game.Start();
return 0;
}
#pragma endregion

File diff suppressed because it is too large Load Diff

@ -7,6 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AoC Template", "Project3\Pr
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Day 1", "Day 1\Day 1.vcxproj", "{88A141D8-466C-4157-BBE9-403B26E8C218}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Day 1", "Day 1\Day 1.vcxproj", "{88A141D8-466C-4157-BBE9-403B26E8C218}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Day 2", "Day 2\Day 2.vcxproj", "{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
@ -31,6 +33,14 @@ Global
{88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x64.Build.0 = Release|x64 {88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x64.Build.0 = Release|x64
{88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x86.ActiveCfg = Release|Win32 {88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x86.ActiveCfg = Release|Win32
{88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x86.Build.0 = Release|Win32 {88A141D8-466C-4157-BBE9-403B26E8C218}.Release|x86.Build.0 = Release|Win32
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Debug|x64.ActiveCfg = Debug|x64
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Debug|x64.Build.0 = Debug|x64
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Debug|x86.ActiveCfg = Debug|Win32
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Debug|x86.Build.0 = Debug|Win32
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Release|x64.ActiveCfg = Release|x64
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Release|x64.Build.0 = Release|x64
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Release|x86.ActiveCfg = Release|Win32
{FC99E3F2-B7D0-44F4-8F65-E390976AC73B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Loading…
Cancel
Save