diff --git a/levels/contrib/template b/levels/contrib/template new file mode 100644 index 0000000..40a8329 --- /dev/null +++ b/levels/contrib/template @@ -0,0 +1,31 @@ +[description] + +This text will be shown when the level starts. + +It describes the task or puzzle the player can solve. + +[congrats] + +This text will be shown after the player has solved the level. + +Can contain additional information, or bonus exercises. + +[setup] + +# Bash commands that set up the initial state of the level. An initial +# `git init` is always done automatically. The default branch is called `main`. + +echo You > people_who_are_awesome +git add . +git commit -m "Initial commit" + +[win] + +# Bash commands that check whether the level is solved. Write these as if you're +# writing the body of a Bash function. Make the function return 0 if it's +# solved, and a non-zero value otherwise. You can use `return`, and also, Bash +# functions return the exit code of the last statement, which sometimes allows +# very succinct checks. + +# Check whether the file has at least two lines in the latest commit: +test "$(git show HEAD:people_who_are_awesome | wc -l)" -ge 2