Skip to content

Commit 445635f

Browse files
Initial commit
0 parents  commit 445635f

File tree

182 files changed

+14529
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+14529
-0
lines changed

.all-contributorsrc

Lines changed: 2257 additions & 0 deletions
Large diffs are not rendered by default.

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
3+
"waitFor": "onCreateCommand",
4+
"onCreateCommand": ".devcontainer/setup.sh",
5+
"updateContentCommand": "cargo build",
6+
"postCreateCommand": "",
7+
"postAttachCommand": {
8+
"server": "rustlings watch"
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"rust-lang.rust-analyzer"
14+
]
15+
}
16+
}
17+
}

.devcontainer/setup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
curl https://sh.rustup.rs -sSf | sh -s -- -y
3+
4+
# Update current shell environment variables after install to find rustup
5+
. "$HOME/.cargo/env"
6+
rustup install stable
7+
cargo install --force --path .

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*.rs]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4

.github/classroom/checkresult.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// TODO 判断文件是否存在
2+
3+
function judge(outputFile) {
4+
try {
5+
let jsonResult = JSON.parse(outputFile);
6+
let points = {};
7+
jsonResult.exercises.forEach(({ name, result }) => {
8+
if (result) {
9+
points[name] = [1,1]
10+
} else {
11+
points[name] = [0,1]
12+
}
13+
})
14+
return points;
15+
} catch(e) {
16+
return {};
17+
}
18+
}
19+
20+
module.exports.judge = judge;

0 commit comments

Comments
 (0)