1
0
mirror of https://gitlab.com/MisterBiggs/aoc2021.git synced 2025-06-15 14:36:50 +00:00

part 1 finished

This commit is contained in:
Anson Biggs 2021-12-01 05:19:57 +00:00
parent c7134ff0fe
commit aa30dfc940
118 changed files with 2131 additions and 1 deletions

View File

@ -1 +1 @@
# Advent of Code 2021
# Advent of Code 2021

View File

@ -0,0 +1,9 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/rust/.devcontainer/base.Dockerfile
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): buster, bullseye
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/rust:0-${VARIANT}
# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@ -0,0 +1,46 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/rust
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
// Use bullseye when on local on arm64/Apple Silicon.
"VARIANT": "buster"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.executable": "/usr/bin/lldb",
// VS Code don't watch files under ./target
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"matklad.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

2000
day1/input.txt Normal file

File diff suppressed because it is too large Load Diff

7
day1/rust/Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "rust"
version = "0.1.0"

8
day1/rust/Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

21
day1/rust/src/main.rs Normal file
View File

@ -0,0 +1,21 @@
use std::fs;
fn main() {
let input = fs::read_to_string("../input.txt").expect("Could not read file");
let lines: Vec<&str> = input.lines().collect();
let mut previous: i32 = 10000;
let mut increases = 0;
for line in lines.iter() {
let current = line.parse::<i32>().unwrap();
if previous < current {
increases += 1;
}
previous = current;
}
println!("Increases: {}", increases);
}

View File

@ -0,0 +1 @@
{"rustc_fingerprint":8951012926787345897,"outputs":{"17598535894874457435":{"success":true,"status":"","code":0,"stdout":"rustc 1.56.0 (09c42c458 2021-10-18)\nbinary: rustc\ncommit-hash: 09c42c45858d5f3aedfa670698275303a3d19afa\ncommit-date: 2021-10-18\nhost: x86_64-unknown-linux-gnu\nrelease: 1.56.0\nLLVM version: 13.0.0\n","stderr":""},"2797684049618456168":{"success":false,"status":"exit status: 1","code":1,"stdout":"","stderr":"error: `-Csplit-debuginfo` is unstable on this platform\n\n"},"931469667778813386":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/usr/local/rustup/toolchains/1.56.0-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"15537503139010883884":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n","stderr":""}},"successes":{}}

View File

@ -0,0 +1,3 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/

View File

View File

@ -0,0 +1 @@
414370587e4d41da

View File

@ -0,0 +1 @@
{"rustc":9905615409658916977,"features":"[]","target":6632464988501252979,"profile":7309141686862299243,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/rust-10ce82290ab491be/dep-bin-rust"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1 @@
07102407e87e7c02

View File

@ -0,0 +1 @@
{"rustc":9905615409658916977,"features":"[]","target":6632464988501252979,"profile":1021633075455700787,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/rust-1cca38097a20abf3/dep-test-bin-rust"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1 @@
d42ffae028806915

View File

@ -0,0 +1 @@
{"rustc":9905615409658916977,"features":"[]","target":6632464988501252979,"profile":1021633075455700787,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/rust-b0e0ec352a451380/dep-test-bin-rust"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1 @@
08addd976c5103c6

View File

@ -0,0 +1 @@
{"rustc":9905615409658916977,"features":"[]","target":6632464988501252979,"profile":9251013656241001069,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/rust-b1940457c108ea9a/dep-bin-rust"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1 @@
5aa98089e93fc7a3

View File

@ -0,0 +1 @@
{"rustc":9905615409658916977,"features":"[]","target":6632464988501252979,"profile":7309141686862299243,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/rust-d72088a750e48170/dep-bin-rust"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View File

@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@ -0,0 +1,7 @@
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-10ce82290ab491be.rmeta: src/main.rs
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-10ce82290ab491be.d: src/main.rs
src/main.rs:
# env-dep:CLIPPY_ARGS=

View File

@ -0,0 +1,7 @@
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-b0e0ec352a451380.rmeta: src/main.rs
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-b0e0ec352a451380.d: src/main.rs
src/main.rs:
# env-dep:CLIPPY_ARGS=

Binary file not shown.

View File

@ -0,0 +1,5 @@
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-b1940457c108ea9a: src/main.rs
/workspaces/AoC2021/day1/rust/target/debug/deps/rust-b1940457c108ea9a.d: src/main.rs
src/main.rs:

Some files were not shown because too many files have changed in this diff Show More