From 1c8226ec02c09062996b0839170542ae8be521ca Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 16 Apr 2021 12:00:55 -0500 Subject: [PATCH] chore: add remaining untracked files --- day_5/.gitignore | 2 ++ day_5/CMakeLists.txt | 6 ++++++ day_5/main.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 day_5/.gitignore create mode 100644 day_5/CMakeLists.txt create mode 100644 day_5/main.cpp diff --git a/day_5/.gitignore b/day_5/.gitignore new file mode 100644 index 0000000..36e2c82 --- /dev/null +++ b/day_5/.gitignore @@ -0,0 +1,2 @@ +/.idea +/cmake-build-debug diff --git a/day_5/CMakeLists.txt b/day_5/CMakeLists.txt new file mode 100644 index 0000000..6bbc557 --- /dev/null +++ b/day_5/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.19) +project(day_5) + +set(CMAKE_CXX_STANDARD 20) + +add_executable(day_5 main.cpp) \ No newline at end of file diff --git a/day_5/main.cpp b/day_5/main.cpp new file mode 100644 index 0000000..7806a60 --- /dev/null +++ b/day_5/main.cpp @@ -0,0 +1,45 @@ +#include + +struct Seat { + uint32_t row; + uint32_t column; +}; + +Seat getSeat(std::string &str) { + Seat test = {}; + uint8_t hor_low = 0; + uint8_t hor_high = 127; + + for (char c : str) { + switch (c) { + case 'F': + uint8_t diff = hor_high - hor_low; + hor_high -= diff; + break; + case 'B': + uint8_t diff = hor_high - hor_low; + + break; + case 'L': + break; + case 'R': + break; + default: + throw std::exception {}; + } + } + return test; +} + + + +int main() { + std::string seat = "FBFBBFFRLR"; + + + + + + + return 0; +}