-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.unstable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[workspace] | ||
members = ["./*/src/.."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Aoc 2021 | ||
|
||
Rust + Deno :heart: | ||
|
||
## Generate a new day with Rust | ||
|
||
```bash | ||
cargo generate --git https://github.com/icyJoseph/advent-of-code.git template --name day-1 | ||
``` | ||
|
||
## Run Rust binaries | ||
|
||
```bash | ||
cargo run --bin day-1 | ||
``` | ||
|
||
## Run Deno scripts | ||
|
||
```bash | ||
deno run --allow-read --allow-write deno/day-1.ts | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
authors = ["Joseph Chamochumbi <[email protected]>"] | ||
edition = "2018" | ||
name = "day-1" | ||
version = "0.1.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[dependencies] | ||
aoc = {git = "https://github.com/icyJoseph/advent-of-code.git"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use aoc; | ||
|
||
fn solve(raw: String) -> () { | ||
println!("{}", raw); | ||
} | ||
|
||
fn main() { | ||
let input = aoc::get_input(2021, 1); | ||
|
||
let raw_input = std::fs::read_to_string("./input/day-1.in").expect("Error reading input"); | ||
|
||
solve(input); | ||
solve(raw_input); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const input = await Deno.readTextFile("./input/day-1.in"); | ||
|
||
/** | ||
* Part One | ||
*/ | ||
|
||
console.log("Part One:", input); | ||
|
||
/** | ||
* Part Two | ||
*/ | ||
console.log("Part Two:", input); |