More polish, hide unfinished chapters/levels

This commit is contained in:
blinry 2021-01-13 17:30:32 +01:00
parent be45b82e41
commit 5df4932ad5
19 changed files with 48 additions and 55 deletions

View file

@ -39,7 +39,7 @@ git checkout leap^^
[win] [win]
# Find the bad branches and delete them. Keep the best one. # Find the bad branches and delete them. Keep only the best one.
test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)" test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)"
[congrats] [congrats]

View file

@ -7,7 +7,7 @@ The yellow boxes are frozen points in time, we call them "commits"! You can trav
The grey panel below shows your current environment - click on an object to inspect or modify it! The grey panel below shows your current environment - click on an object to inspect or modify it!
Can you find out what happened here? Then, while on the latest commit, fix the problem, and make a new commit! Can you find out what happened here? Then, while on the latest commit, edit the files to fix the problem, and make a new commit!
[setup] [setup]

View file

@ -7,9 +7,7 @@ Note that there are two options to "travel to the end of a timeline":
First, you can directly travel to the commit, like we've done it before. First, you can directly travel to the commit, like we've done it before.
And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline, which is usually what we want! And second, you can travel to the branch label. In this case, when you make a new commit, the branch will grow with you, and still point at the end of the timeline!
Let's try both of these!
[setup] [setup]
@ -33,7 +31,7 @@ git branch -D main
[win] [win]
# Travel directly to the last commit of the birthday timeline, make a change to 'you', and make a commit # Travel directly to the last yellow commit of the birthday timeline, make a change to 'you', and make a commit
for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do
if test $(git rev-parse $commit^) = $(git rev-parse birthday); then if test $(git rev-parse $commit^) = $(git rev-parse birthday); then
return 0 return 0
@ -41,5 +39,5 @@ for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch
done done
return 1 return 1
# Travel to the 'concert' branch, make a change to 'you', and a commit. # Travel to the blue 'concert' branch, make a change to 'you', and a commit.
git show concert^ | grep "Go to the concert" git show concert^ | grep "Go to the concert"

View file

@ -11,15 +11,6 @@ Again, we want to make that our base reality - the "main" branch should point to
[setup] [setup]
echo "A friendly old lady.
Sells delicious baguettes." > mary
echo "A rebellious teenager.
Sells good coffee." > larry
echo "A snail. Literally a snail.
Sells donuts with an unspecified, slimy filling." > gary
echo "You do not have a baguette. echo "You do not have a baguette.
You do not have coffee. You do not have coffee.

View file

@ -1,18 +1,23 @@
title = Making copies title = Making backups
cards = cards =
[description] [description]
One month later, you're working on an essay about cats. One month later, you're working on an essay about cats.
You've started making backup copies of your essay regularly - you can look at them by clicking on them! You've started making backup copies of your essay regularly - you can look at them by clicking on them!
Your current version, essay4.txt, needs one more line You think that you're almost done - your current version, just needs one more line!
[congrats] [congrats]
Okay, this works. But you're a bit worried that two weeks from now, you'll have hundreds of copies of your essay, and it will be hard to keep track of all of them. Okay, this kind of works.
And especially when working with other people, sending copies back and forth doesn't seem ideal. Let's look at another way to do this! But you're a bit worried that two weeks from now, you'll have hundreds of copies of your essay, and it will be hard to keep track of all of them.
And especially when working with other people, sending copies back and forth doesn't seem ideal.
You wonder what would be a better way to do this.
[setup] [setup]
@ -20,7 +25,7 @@ rm -rf .git
echo "~ Why cats are the best pets ~ echo "~ Why cats are the best pets ~
(I still need to write this.)" >> essay1.txt (I still need to write this.)" >> essay.txt
echo "~ Why cats are the best pets ~ echo "~ Why cats are the best pets ~
@ -31,11 +36,11 @@ echo "~ Why cats are the best pets ~
echo "~ Why cats are the best pets ~ echo "~ Why cats are the best pets ~
- They live longer than goldfish. - They live longer than goldfish.
- Their little paws are super cute." >> essay3.txt - Their little paws are super cute." >> essay2_final.txt
cp essay3.txt essay4.txt cp essay2_final.txt essay2_really_final.txt
[win] [win]
# Add two more lines to essay4.txt! # Add another line to essay2_really_final.txt!
test "$(cat essay4.txt | wc -l )" -ge 6 test "$(cat essay2_really_final.txt | wc -l )" -ge 5

View file

@ -9,8 +9,6 @@ A friend has asked you to help with an essay about hobbies! She has already star
"Thanks, these are some really nice hobbies! Hope we can do that together soon!" "Thanks, these are some really nice hobbies! Hope we can do that together soon!"
You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school!
[setup] [setup]
rm -rf .git rm -rf .git

View file

@ -1,15 +1,15 @@
title = A normal day title = Living dangerously
cards = cards =
[description] [description]
You're working on an essay about goldfish! Your current version is already quite nice, but needs a bit more work. So you're working on an essay about goldfish! Your current version is already quite nice, but needs a bit more work.
[congrats] [congrats]
Suddenly, your cat jumps on your keyboard, deletes what you've written, and runs away! Oh no. :( Just look at it now! All your hard work, destroyed! Suddenly, your cat jumps on your keyboard, deletes what you've written, and runs away! Oh no. Just look at it now! All your hard work, destroyed!
You decide to be more careful in the future. You clearly need a better solution.
(Click "Next Level" as soon as you're ready!) (Click "Next Level" as soon as you're ready!)
@ -17,7 +17,7 @@ You decide to be more careful in the future.
rm -rf .git rm -rf .git
echo "~ Why are the best pets ~ echo "~ Why goldfish are the best pets ~
- They are pretty. - They are pretty.
- They don't pee on the carpet. - They don't pee on the carpet.
@ -29,7 +29,7 @@ It's small, black, and very cute!" > cat
[actions] [actions]
test "$(cat essay.txt | wc -l )" -ge 7 && echo "~ Why goldfish are the best pets ~ test "$(cat essay.txt | wc -l )" -ge 6 && echo "~ Why goldfish are the best pets ~
- asdijwrlj - asdijwrlj
- they - they
@ -40,5 +40,5 @@ test "$(cat essay.txt | wc -l )" -ge 7 && echo "~ Why goldfish are the best pets
[win] [win]
# Add two more lines to essay.txt! # Add another line to essay.txt!
test "$(cat essay.txt | wc -l )" -ge 7 test "$(cat essay.txt | wc -l )" -ge 6

View file

@ -3,6 +3,8 @@ cards = config-name commit-auto checkout
[description] [description]
You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school!
Your time travel teacher welcomes you: "Hello there! Wanna tell us your name?" Your time travel teacher welcomes you: "Hello there! Wanna tell us your name?"
[setup] [setup]
@ -18,7 +20,8 @@ echo "~ Why do you want to learn how to use time machines? ~
[actions] [actions]
test "$(git config user.name)" != "You" && hint "Hey $(git config user.name), welcome to time travel school!" test "$(git config user.name)" != "You" && cat form | grep -v Signature && echo "
Signature: $(git config user.name)" >> form
[win] [win]
@ -30,6 +33,6 @@ git show main:form | grep '\[[xX]\]'
[congrats] [congrats]
"We're glad to have you! See how the commit now includes your name? "We're so glad to have you!
Git can help you fix problems in the past! It allows you to collaborate with other students of time travel! It's really powerful, and it's really popular! I'll see you for your first lesson tomorrow!" Git can help you fix problems in the past! It allows you to collaborate with other students of time travel! It's really powerful, and it's really popular! I'll see you for your first lesson tomorrow!"

View file

@ -7,15 +7,6 @@ Here's a trick so that you can sleep a bit longer: just do all your morning acti
[setup] [setup]
echo "A friendly old lady.
Sells delicious baguettes." > mary
echo "A rebellious teenager.
Sells good coffee." > larry
echo "A snail. Literally a snail.
Sells donuts with an unspecified, slimy filling." > gary
echo "You do not have a baguette. echo "You do not have a baguette.
You do not have coffee. You do not have coffee.

View file

@ -1,5 +1,5 @@
title = Fetching from remotes title = Fetching from remotes
cards = checkout cards = checkout fetch commit-auto
[description] [description]

View file

@ -1,3 +1,3 @@
add friend
rename-delete problems
fetch fetch

View file

@ -2,10 +2,7 @@ intro
files files
branches branches
merge merge
remotes
index index
tags remotes
changing-the-past changing-the-past
shit-happens bisect
stash
low-level

View file

@ -64,6 +64,11 @@
"command": "git pull", "command": "git pull",
"description": "Get timelines from a friend." "description": "Get timelines from a friend."
}, },
{
"id": "fetch",
"command": "git fetch [remote]",
"description": "Get timelines from a friend."
},
{ {
"id": "push", "id": "push",
"command": "git push", "command": "git push",
@ -154,6 +159,11 @@
"command": "git reflog [ref, head]", "command": "git reflog [ref, head]",
"description": "Display a log of there the ref pointed to in the past." "description": "Display a log of there the ref pointed to in the past."
}, },
{
"id": "remote-add",
"command": "mv [file] [string]",
"description": "Rename a file."
},
{ {
"id": "file-new", "id": "file-new",
"command": "touch [string]", "command": "touch [string]",

View file

@ -36,7 +36,7 @@ func reload():
chapter_names.erase(chapter) chapter_names.erase(chapter)
final_chapter_sequence.push_back(chapter) final_chapter_sequence.push_back(chapter)
final_chapter_sequence += chapter_names #final_chapter_sequence += chapter_names
for c in final_chapter_sequence: for c in final_chapter_sequence:
var chapter = Chapter.new() var chapter = Chapter.new()