From 5df4932ad5046d52ca1322d72e642e6d28ba9730 Mon Sep 17 00:00:00 2001 From: blinry Date: Wed, 13 Jan 2021 17:30:32 +0100 Subject: [PATCH] More polish, hide unfinished chapters/levels --- levels/branches/branch-remove | 2 +- levels/branches/checkout-commit | 2 +- levels/branches/grow | 8 +++---- levels/changing-the-past/rebase | 9 -------- levels/intro/copies | 23 +++++++++++-------- levels/intro/remote | 2 -- levels/intro/risky | 16 ++++++------- levels/intro/who-are-you | 7 ++++-- levels/merge/merge | 9 -------- levels/remotes/fetch | 2 +- levels/remotes/sequence | 4 ++-- levels/sequence | 7 ++---- levels/{remotes => unused}/pull-push | 0 levels/{remotes/add => unused/remotes-add} | 0 .../rename-delete => unused/remotes-delete} | 0 levels/{changing-the-past => unused}/split | 0 levels/{changing-the-past => unused}/steps | 0 resources/cards.json | 10 ++++++++ scenes/levels.gd | 2 +- 19 files changed, 48 insertions(+), 55 deletions(-) rename levels/{remotes => unused}/pull-push (100%) rename levels/{remotes/add => unused/remotes-add} (100%) rename levels/{remotes/rename-delete => unused/remotes-delete} (100%) rename levels/{changing-the-past => unused}/split (100%) rename levels/{changing-the-past => unused}/steps (100%) diff --git a/levels/branches/branch-remove b/levels/branches/branch-remove index 2a9f806..3b576e0 100644 --- a/levels/branches/branch-remove +++ b/levels/branches/branch-remove @@ -39,7 +39,7 @@ git checkout leap^^ [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)" [congrats] diff --git a/levels/branches/checkout-commit b/levels/branches/checkout-commit index f878d5d..0651267 100644 --- a/levels/branches/checkout-commit +++ b/levels/branches/checkout-commit @@ -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! -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] diff --git a/levels/branches/grow b/levels/branches/grow index f4079d7..82990bd 100644 --- a/levels/branches/grow +++ b/levels/branches/grow @@ -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. -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! - -Let's try both of these! +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! [setup] @@ -33,7 +31,7 @@ git branch -D main [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 if test $(git rev-parse $commit^) = $(git rev-parse birthday); then return 0 @@ -41,5 +39,5 @@ for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch done 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" diff --git a/levels/changing-the-past/rebase b/levels/changing-the-past/rebase index c755962..748bdb3 100644 --- a/levels/changing-the-past/rebase +++ b/levels/changing-the-past/rebase @@ -11,15 +11,6 @@ Again, we want to make that our base reality - the "main" branch should point to [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. You do not have coffee. diff --git a/levels/intro/copies b/levels/intro/copies index bdbbbcb..c36c2e2 100644 --- a/levels/intro/copies +++ b/levels/intro/copies @@ -1,18 +1,23 @@ -title = Making copies +title = Making backups cards = [description] 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! -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] -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] @@ -20,7 +25,7 @@ rm -rf .git 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 ~ @@ -31,11 +36,11 @@ echo "~ Why cats are the best pets ~ echo "~ Why cats are the best pets ~ - 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] -# Add two more lines to essay4.txt! -test "$(cat essay4.txt | wc -l )" -ge 6 +# Add another line to essay2_really_final.txt! +test "$(cat essay2_really_final.txt | wc -l )" -ge 5 diff --git a/levels/intro/remote b/levels/intro/remote index 6fc3d64..63c4870 100644 --- a/levels/intro/remote +++ b/levels/intro/remote @@ -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!" -You're still pretty confused by everything that's going on. The next day, you decide to enroll in time travel school! - [setup] rm -rf .git diff --git a/levels/intro/risky b/levels/intro/risky index 67085af..039a58a 100644 --- a/levels/intro/risky +++ b/levels/intro/risky @@ -1,15 +1,15 @@ -title = A normal day +title = Living dangerously cards = [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] -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!) @@ -17,7 +17,7 @@ You decide to be more careful in the future. rm -rf .git -echo "~ Why are the best pets ~ +echo "~ Why goldfish are the best pets ~ - They are pretty. - They don't pee on the carpet. @@ -29,7 +29,7 @@ It's small, black, and very cute!" > cat [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 - they @@ -40,5 +40,5 @@ test "$(cat essay.txt | wc -l )" -ge 7 && echo "~ Why goldfish are the best pets [win] -# Add two more lines to essay.txt! -test "$(cat essay.txt | wc -l )" -ge 7 +# Add another line to essay.txt! +test "$(cat essay.txt | wc -l )" -ge 6 diff --git a/levels/intro/who-are-you b/levels/intro/who-are-you index 6ca1d08..9fb907a 100644 --- a/levels/intro/who-are-you +++ b/levels/intro/who-are-you @@ -3,6 +3,8 @@ cards = config-name commit-auto checkout [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?" [setup] @@ -18,7 +20,8 @@ echo "~ Why do you want to learn how to use time machines? ~ [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] @@ -30,6 +33,6 @@ git show main:form | grep '\[[xX]\]' [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!" diff --git a/levels/merge/merge b/levels/merge/merge index c1de34a..6be2eda 100644 --- a/levels/merge/merge +++ b/levels/merge/merge @@ -7,15 +7,6 @@ Here's a trick so that you can sleep a bit longer: just do all your morning acti [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. You do not have coffee. diff --git a/levels/remotes/fetch b/levels/remotes/fetch index 77f1c17..377355a 100644 --- a/levels/remotes/fetch +++ b/levels/remotes/fetch @@ -1,5 +1,5 @@ title = Fetching from remotes -cards = checkout +cards = checkout fetch commit-auto [description] diff --git a/levels/remotes/sequence b/levels/remotes/sequence index 258c089..450c58e 100644 --- a/levels/remotes/sequence +++ b/levels/remotes/sequence @@ -1,3 +1,3 @@ -add -rename-delete +friend +problems fetch diff --git a/levels/sequence b/levels/sequence index 0138870..fd32b24 100644 --- a/levels/sequence +++ b/levels/sequence @@ -2,10 +2,7 @@ intro files branches merge -remotes index -tags +remotes changing-the-past -shit-happens -stash -low-level +bisect diff --git a/levels/remotes/pull-push b/levels/unused/pull-push similarity index 100% rename from levels/remotes/pull-push rename to levels/unused/pull-push diff --git a/levels/remotes/add b/levels/unused/remotes-add similarity index 100% rename from levels/remotes/add rename to levels/unused/remotes-add diff --git a/levels/remotes/rename-delete b/levels/unused/remotes-delete similarity index 100% rename from levels/remotes/rename-delete rename to levels/unused/remotes-delete diff --git a/levels/changing-the-past/split b/levels/unused/split similarity index 100% rename from levels/changing-the-past/split rename to levels/unused/split diff --git a/levels/changing-the-past/steps b/levels/unused/steps similarity index 100% rename from levels/changing-the-past/steps rename to levels/unused/steps diff --git a/resources/cards.json b/resources/cards.json index 54294f6..54173bf 100644 --- a/resources/cards.json +++ b/resources/cards.json @@ -64,6 +64,11 @@ "command": "git pull", "description": "Get timelines from a friend." }, + { + "id": "fetch", + "command": "git fetch [remote]", + "description": "Get timelines from a friend." + }, { "id": "push", "command": "git push", @@ -154,6 +159,11 @@ "command": "git reflog [ref, head]", "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", "command": "touch [string]", diff --git a/scenes/levels.gd b/scenes/levels.gd index 87b020d..593b728 100644 --- a/scenes/levels.gd +++ b/scenes/levels.gd @@ -36,7 +36,7 @@ func reload(): chapter_names.erase(chapter) final_chapter_sequence.push_back(chapter) - final_chapter_sequence += chapter_names + #final_chapter_sequence += chapter_names for c in final_chapter_sequence: var chapter = Chapter.new()