chore: add remaining untracked files

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-04-16 12:00:55 -05:00
parent 0539c7dcb7
commit 1c8226ec02
3 changed files with 53 additions and 0 deletions

2
day_5/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/.idea
/cmake-build-debug

6
day_5/CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.19)
project(day_5)
set(CMAKE_CXX_STANDARD 20)
add_executable(day_5 main.cpp)

45
day_5/main.cpp Normal file
View File

@ -0,0 +1,45 @@
#include <iostream>
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;
}