chore(build): create build script
This commit is contained in:
parent
51c4dd6c65
commit
479648eea0
6 changed files with 39 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
/target
|
/target
|
||||||
/ignore
|
/binaries
|
||||||
|
|
13
.vscode/settings.json
vendored
Normal file
13
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.svn": true,
|
||||||
|
"**/.hg": true,
|
||||||
|
"**/CVS": true,
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/Thumbs.db": true,
|
||||||
|
"**/target": true,
|
||||||
|
"**/Cargo.lock": true,
|
||||||
|
"**/euler.png": true
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,8 +4,6 @@ version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "euler"
|
default-run = "euler"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.0.4", features = ["derive"] }
|
clap = { version = "4.0.4", features = ["derive"] }
|
||||||
owo-colors = "3.5.0"
|
owo-colors = "3.5.0"
|
||||||
|
@ -15,3 +13,9 @@ reqwest = "0.11"
|
||||||
tokio = { version = "1.23", features = ["full"] }
|
tokio = { version = "1.23", features = ["full"] }
|
||||||
regex = "1"
|
regex = "1"
|
||||||
html-escape = "0.2.13"
|
html-escape = "0.2.13"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
opt-level = "z"
|
||||||
|
strip = true
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
|
14
build.sh
Executable file
14
build.sh
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cargo build --release --bin "[0-9]*" -q
|
||||||
|
cargo build --release --bin "[0-9]*" -q --target x86_64-pc-windows-gnu
|
||||||
|
|
||||||
|
find ./target/release -maxdepth 1 -type f -perm 755 | while read file; do
|
||||||
|
arr=(${file//\// })
|
||||||
|
mv $file binaries/linux/${arr[3]}
|
||||||
|
done
|
||||||
|
|
||||||
|
find ./target/x86_64-pc-windows-gnu/release -maxdepth 1 -type f -perm 755 | while read file; do
|
||||||
|
arr=(${file//\// })
|
||||||
|
mv $file binaries/win64/${arr[4]}
|
||||||
|
done
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
All of the solutions here are written in rust. [main.rs](src/main.rs) is the home to my helper command line that can scaffold files for me quickly, prefaced with a statement of the problem! As per the rules of the challenge, I may only publish the solutions to the first 100 problems here, so I will stop after that but still continue the challenge.
|
All of the solutions here are written in rust. [main.rs](src/main.rs) is the home to my helper command line that can scaffold files for me quickly, prefaced with a statement of the problem! As per the rules of the challenge, I may only publish the solutions to the first 100 problems here, so I will stop after that but still continue the challenge.
|
||||||
|
|
||||||
|
I originally started the challenge in [the-honk](https://github.com/newtykins/the-honk) in TypeScript, and am currently in the process of porting over all of my already completed challenges. Check out my old work [here](https://github.com/newtykins/the-honk/tree/main/challenges/euler).
|
||||||
|
|
||||||
## Challenge Completion
|
## Challenge Completion
|
||||||
|
|
||||||
### <!-- completed -->15<!-- completed --> out of 100 public challenges completed.
|
### <!-- completed -->15<!-- completed --> out of 100 public challenges completed.
|
||||||
|
@ -111,3 +113,5 @@ All of the solutions here are written in rust. [main.rs](src/main.rs) is the hom
|
||||||
- [ ] 98 - Anagramic squares
|
- [ ] 98 - Anagramic squares
|
||||||
- [ ] 99 - Largest exponential
|
- [ ] 99 - Largest exponential
|
||||||
- [ ] 100 - Arranged probability
|
- [ ] 100 - Arranged probability
|
||||||
|
|
||||||
|
<sub>Check out Project Euler <a href="https://projecteuler.net">here</a>.</sub>
|
||||||
|
|
|
@ -23,7 +23,6 @@ fn count_lattice_paths(width: usize, height: usize) -> usize {
|
||||||
if width != height {
|
if width != height {
|
||||||
return binomial(width + height, width).unwrap();
|
return binomial(width + height, width).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// (2n, n)
|
// (2n, n)
|
||||||
else {
|
else {
|
||||||
let mut result: usize = 1;
|
let mut result: usize = 1;
|
||||||
|
|
Loading…
Reference in a new issue