Skip to content

Commit

Permalink
Add top level structure (#11)
Browse files Browse the repository at this point in the history
* Move current solution into 2020 folder.
* Add top level readme.
  • Loading branch information
jp7677 authored Aug 25, 2021
1 parent 69fe026 commit 5303bb3
Show file tree
Hide file tree
Showing 72 changed files with 261 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
inc/* linguist-vendored
2020/inc/* linguist-vendored
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- name: Compile and run
- name: Compile and run AoC2020
run: |
cd 2020
./build/make.sh
time ./cmake-build-release/adventofcode
1 change: 1 addition & 0 deletions 2020/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake-build-*
8 changes: 8 additions & 0 deletions 2020/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 2020/.idea/adventofcode.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions 2020/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions 2020/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions 2020/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions 2020/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cppStandard": "c++17",
"intelliSenseMode": "${default}"
}
],
"version": 4
}
22 changes: 22 additions & 0 deletions 2020/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Build and debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmake-build-debug/adventofcode",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build (Debug)",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
59 changes: 59 additions & 0 deletions 2020/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"files.exclude": {
".vscode/**": true,
".idea/**": true,
".github/**": true,
".gitignore": true,
".gitattributes": true,
"cmake-build-*/**": true
},
"C_Cpp.errorSquiggles": "Enabled",
"files.associations": {
"iostream": "cpp",
"algorithm": "cpp",
"sstream": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp",
"future": "cpp",
"stop_token": "cpp"
}
}
82 changes: 82 additions & 0 deletions 2020/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "Configure (Debug)",
"command": "/usr/bin/cmake",
"args": [
"-DCMAKE_BUILD_TYPE=Debug",
"-B./cmake-build-debug"
],
"problemMatcher": [],
"group": "build",
"presentation": {
"clear": true,
"showReuseMessage": false
}
},
{
"type": "shell",
"label": "Build (Debug)",
"command": "/usr/bin/cmake",
"args": [
"--build",
"./cmake-build-debug",
"--target",
"all",
"--",
"-j",
"9"
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true,
"showReuseMessage": false
}
},
{
"type": "shell",
"label": "Configure (Release)",
"command": "/usr/bin/cmake",
"args": [
"-DCMAKE_BUILD_TYPE=Release",
"-B./cmake-build-release"
],
"problemMatcher": [],
"group": "build",
"presentation": {
"clear": true,
"showReuseMessage": false
}
},
{
"type": "shell",
"label": "Build (Release)",
"command": "/usr/bin/cmake",
"args": [
"--build",
"./cmake-build-release",
"--target",
"all",
"--",
"-j",
"9"
],
"problemMatcher": [
"$gcc"
],
"group": "build",
"presentation": {
"clear": true,
"showReuseMessage": false
}
}
]
}
File renamed without changes.
39 changes: 39 additions & 0 deletions 2020/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Advent of Code 2020 C++

From <https://adventofcode.com/2020>. Better late than never ;)

## System requirements

- build-essentials (gcc)
- cmake

Only Linux/gcc has been tested. Other platforms might just work though.

## Compile & run (Release)

```bash
./build/make.sh
./cmake-build-release/adventofcode
```

The command line arguments from <https://github.com/catchorg/Catch2/blob/devel/docs/command-line.md#specifying-which-tests-to-run> apply to the executable, e.g. use `./cmake-build-release/adventofcode --success "Day 01 - Part 1*"` to run a single test only including showing verbose test results.

## Recompile & run (Debug)

```bash
./build/run.sh
```

The command line arguments for the test runner (see above) are passed by the `run.sh` script to the executable.

## Results

Enjoying all the stars...

![Final AoC map](https://github.com/jp7677/adventofcode/raw/main/map.png)

## Other cool solutions

- <https://github.com/Dricus/adventofcode>
- <https://github.com/StefRave/advent-of-code-2020>
- <https://github.com/ErikSchierboom/advent-of-code>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 5 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
# Advent of Code 2020 C++
# Advent of Code

From <https://adventofcode.com/2020>. Better late than never ;)
From <https://adventofcode.com/>. Better late than never ;)

## System requirements
## The years

- build-essentials (gcc)
- cmake
- Advent of Code 2020 C++ <https://github.com/jp7677/adventofcode/tree/main/2020>

Only Linux/gcc has been tested. Other platforms might just work though.

## Compile & run (Release)

```bash
./build/make.sh
./cmake-build-release/adventofcode
```

The command line arguments from <https://github.com/catchorg/Catch2/blob/devel/docs/command-line.md#specifying-which-tests-to-run> apply to the executable, e.g. use `./cmake-build-release/adventofcode --success "Day 01 - Part 1*"` to run a single test only including showing verbose test results.

## Recompile & run (Debug)

```bash
./build/run.sh
```

The command line arguments for the test runner (see above) are passed by the `run.sh` script to the executable.

## Results

Enjoying all the stars...

![Final AoC map](https://github.com/jp7677/adventofcode/raw/main/map.png)

## Other cool solutions

- <https://github.com/Dricus/adventofcode>
- <https://github.com/StefRave/advent-of-code-2020>
- <https://github.com/ErikSchierboom/advent-of-code>
Enjoy the stars...

0 comments on commit 5303bb3

Please sign in to comment.