Separate lib, new problems and script for web

This commit is contained in:
2026-08-26 22:25:19 +01:00
parent 6fd6d70b04
commit afdab7d4bd
44 changed files with 1060 additions and 211 deletions
+15
View File
@@ -0,0 +1,15 @@
# usaco reset/rm/delete <name>
[[ $# -ge 1 ]] || usage
dir="$(find_problem "$1")"
name="$(basename "$dir")"
io="$(detect_io "$dir" || true)"
io="${io:-$name}"
echo "This resets ${dir#$ROOT/} to a fresh template:"
echo " main.cpp -> re-created from template (old one saved as main.cpp.bak)"
echo " removes compiled binary and $io.out (tests/ and $io.in are kept)"
read -r -p "Reset '$name'? [y/N] " ans
[[ "$ans" == y || "$ans" == Y ]] || { echo "Aborted."; exit 1; }
[[ -f "$dir/main.cpp" ]] && cp "$dir/main.cpp" "$dir/main.cpp.bak"
fresh_main "$dir" "$io"
rm -f "$dir/main" "$dir/a.out" "$dir/$io.out"
echo "Reset $name (old solution in main.cpp.bak)"