seed: curriculum content

This commit is contained in:
2026-05-07 14:32:44 +00:00
parent 9258534803
commit ec76f4f56b
100 changed files with 2846 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
---
type: challenge
title: "The Maker"
xp: 50
duration: 25
difficulty: 2
---
# The Maker
> **[INCOMING — Mission Control, Earth]**
>
> Cadet, you've walked the field. Now build something.
>
> When your script runs, a stale file `cargo-old.txt` is sitting in
> your working directory. Build a cargo bay with three rooms — `food/`,
> `water/`, `tools/` — each holding an empty `manifest.txt`. Then
> delete the stale file.
>
> Three commands:
>
> - `mkdir` — make a directory (use `-p` to make nested ones at once)
> - `touch` — create an empty file
> - `rm` — delete (be careful — there is no trash)
>
> [END TRANSMISSION]
## Your Task
In `starter/starter.sh`, write the commands to:
1. Create `cargo/food/`, `cargo/water/`, `cargo/tools/`
2. Create an empty `manifest.txt` in each room
3. Remove `cargo-old.txt`
## Objectives
- All three room directories exist
- Each contains an empty `manifest.txt`
- `cargo-old.txt` no longer exists

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# The Maker — build a cargo bay.
#
# When this script runs, a stale file `cargo-old.txt` is in your
# working directory. Your script must:
#
# 1. Create directories: cargo/food, cargo/water, cargo/tools
# 2. Create an empty file `manifest.txt` in each of those three rooms
# 3. Remove cargo-old.txt
#
# Tools: mkdir (use -p for nested), touch, rm
# Your code here.

View File

@@ -0,0 +1,17 @@
#!/bin/bash
echo "stale entry" > cargo-old.txt
bash solution.sh > /dev/null 2>&1
N=0
check() {
N=$((N+1))
if eval "$1"; then echo "ok $N - $2"; else echo "not ok $N - $2"; fi
}
check '[ -d cargo/food ]' "cargo/food exists"
check '[ -d cargo/water ]' "cargo/water exists"
check '[ -d cargo/tools ]' "cargo/tools exists"
check '[ -f cargo/food/manifest.txt ] && [ ! -s cargo/food/manifest.txt ]' "cargo/food/manifest.txt exists and is empty"
check '[ -f cargo/water/manifest.txt ] && [ ! -s cargo/water/manifest.txt ]' "cargo/water/manifest.txt exists and is empty"
check '[ -f cargo/tools/manifest.txt ] && [ ! -s cargo/tools/manifest.txt ]' "cargo/tools/manifest.txt exists and is empty"
check '[ ! -f cargo-old.txt ]' "cargo-old.txt removed"