Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
github-classroom[bot] authored Oct 29, 2023
0 parents commit 2a0cb1a
Show file tree
Hide file tree
Showing 172 changed files with 13,293 additions and 0 deletions.
2,257 changes: 2,257 additions & 0 deletions .all-contributorsrc

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
"waitFor": "onCreateCommand",
"onCreateCommand": ".devcontainer/setup.sh",
"updateContentCommand": "cargo build",
"postCreateCommand": "",
"postAttachCommand": {
"server": "rustlings watch"
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
}
}
7 changes: 7 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
curl https://sh.rustup.rs -sSf | sh -s -- -y

# Update current shell environment variables after install to find rustup
. "$HOME/.cargo/env"
rustup install stable
bash install.sh
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*.rs]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
20 changes: 20 additions & 0 deletions .github/classroom/checkresult.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// TODO 判断文件是否存在

function judge(outputFile) {
try {
let jsonResult = JSON.parse(outputFile);
let points = {};
jsonResult.exercises.forEach(({ name, result }) => {
if (result) {
points[name] = [1,1]
} else {
points[name] = [0,1]
}
})
return points;
} catch(e) {
return {};
}
}

module.exports.judge = judge;
Loading

0 comments on commit 2a0cb1a

Please sign in to comment.