Skip to content

Commit 95a5fe9

Browse files
committed
Update script, adding new wc challenge
1 parent b13e1d1 commit 95a5fe9

File tree

14 files changed

+134
-7
lines changed

14 files changed

+134
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
.idea

Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[workspace]
7-
members = [ "challenges/simple-parser" ]
7+
members = [ "challenges/foo", "challenges/simple-parser" , "challenges/wc-command"]
88

99
[dependencies]

challenges/foo/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "foo"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
rust-coding-challenges = { path = "../../" }

challenges/foo/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# foo
2+
3+
## Given By
4+
5+
## Topics
6+
7+
## Main Functions
8+
9+
## Example Output
10+
11+
## Usage Example
12+

challenges/foo/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub fn solve() -> Result<(), String> {
2+
// TODO: Implement the solution for foo
3+
Ok(())
4+
}

challenges/foo/src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use foo::solve;
2+
use rust_coding_challenges::utils::read_text_file_from_args;
3+
4+
fn main() -> std::io::Result<()> {
5+
let content = read_text_file_from_args()?;
6+
7+
// Print results or perform other actions as needed
8+
Ok(())
9+
}

challenges/foo/tests/test.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#[cfg(test)]
2+
mod tests {
3+
use super::*;
4+
use foo::solve;
5+
6+
#[test]
7+
fn test_solve() {
8+
// Call the solve function and check for expected results
9+
let result = solve();
10+
assert!(result.is_ok());
11+
// Add more assertions based on expected behavior
12+
}
13+
}

challenges/wc-command/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "wc-command"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
rust-coding-challenges = { path = "../../" }

challenges/wc-command/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# wc-command
2+
3+
## Given By
4+
5+
## Relevant Background Knowledge
6+
7+
## Main Functions
8+
9+
## Example Output
10+
11+
## Usage Example
12+

0 commit comments

Comments
 (0)