Work on the intro and the index chapter

This commit is contained in:
blinry 2021-01-11 19:16:35 +01:00
parent 4910e4d566
commit 8d333ce56a
31 changed files with 327 additions and 185 deletions

View file

@ -1,23 +1,24 @@
title = Interior design
cards = checkout commit-auto reset-hard file-new file-delete
cards = file-new file-delete
[description]
Our client want some new furniture! You'll discover that they have a very special taste - please add some more furniture that matches this style and make a commit!
Today has been stressful and exhausting. Let's make sure you know how to interact with your current environment, before doing fancy Git stuff.
You're moving into your student apartment, but soon discover that some furniture is missing!
[setup]
echo A yellow cupboard with lots of drawers. > cupboard
echo A really big yellow shelf. > shelf
git add .
git commit -m "A cupboard and a shelf"
echo A small yellow shelf. > shelf
[win]
NUM_FILES="$(git ls-tree --name-only -r HEAD | wc -l)"
YELLOW_FILES="$(git grep -l yellow HEAD | wc -l)"
test "$NUM_FILES" -ge 5 && test "$YELLOW_FILES" = "$NUM_FILES"
# Add two more pieces of furniture (in matching colors).
NUM_FILES="$(ls | wc -l)"
YELLOW_FILES="$(grep -l yellow * | wc -l)"
test "$NUM_FILES" -ge 4 && test "$YELLOW_FILES" = "$NUM_FILES"
[congrats]
Thanks! Our clients says that they really like what you picked!
Don't you immediately feel more at home?

View file

@ -1,10 +1,11 @@
title = Unexpected Visitors
cards = checkout commit-auto reset-hard file-new file-delete
cards = file-new file-delete
[description]
*ring ring* Oh no! You wanted to meet with your parents in your student apartment and your alarm did not go off in time to clean your room!
"Coming!" you yell while you jump out of bed. Now quick! Remove all litter and trash you can find by using `rm [file]` and commit your changes.
"Coming!" you yell while you jump out of bed. Now quick!
[setup]
@ -12,14 +13,17 @@ echo Very smelly socks. > socks
echo A tiny couch table. > table
echo An empty energy drink can. > can
echo An empty bag of chips. > bag_of_chips
git add .
git commit -m "weekend"
[win]
NUM_FILES="$(git ls-tree --name-only -r HEAD | wc -l)"
test "$NUM_FILES" -eq 1 && test "$(git ls-tree --name-only -r HEAD)" = "table"
# Remove all litter and trash.
! ls | grep bag_of_chips &&
! ls | grep can &&
! ls | grep socks
# But make sure to keep important things!
ls | grep table
[congrats]
Your parents are happy to see you (and of course your neat and tidy apartment)!
Your parents are happy to see you (and, of course, your neat and tidy apartment)!

View file

@ -1,28 +1,27 @@
title = No sleep required
cards = checkout commit-auto reset-hard file-new file-delete file-rename
cards = file-new file-delete file-rename
[description]
Our client just let us know they don't need sleep! Huh.
Actually, you decide that you don't need any sleep.
Because of that, they won't require a bed, and have asked you to build some other piece of furniture from the wood.
Because of that, you won't require a bed, and can build some other piece of furniture from the wood!
Can you rename the object into something else, give it a new description, and make a commit from that?
[setup]
echo A yellow cupboard with lots of drawers. > cupboard
echo A really big yellow shelf. > shelf
echo A comfortable, yellow bed with yellow cushions. > bed
git add .
git commit -m "Initial furniture"
[win]
NUM_FILES="$(git ls-tree --name-only -r HEAD | wc -l)"
NUM_BEDS="$(git ls-tree --name-only -r HEAD | grep '^bed$' | wc -l)"
test "$NUM_BEDS" = 0 && test "$NUM_FILES" -ge 3
# Rename the bed into something else, and give it a new description!
NUM_FILES="$(ls | wc -l)"
! test -f bed && test "$NUM_FILES" -ge 3 && ! grep -r "yellow bed" .
[congrats]
Neat! It even still looks a bit comfortable!
You head out, eager for your first lesson at time travel school!

3
levels/files/sequence Normal file
View file

@ -0,0 +1,3 @@
files-add
files-delete
files-move