From af0d7928efeb6916b13fd6ea590bac1c5b3ec036 Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Thu, 22 Oct 2020 17:27:54 +0200 Subject: [PATCH] Add more congrats, missing cards --- cardgame.gd | 6 ++++++ levels/time-machine/branches | 13 ++++++++++--- levels/time-machine/conflict | 18 +++++++++++++++--- levels/time-machine/merge | 23 ++++++++++++++++++++--- levels/time-machine/pull-push | 8 +++++++- levels/time-machine/rebase | 10 ++++++++-- levels/time-machine/welcome | 8 +++++--- main.tscn | 18 +++++++++--------- repository.tscn | 2 +- terminal.gd | 1 + 10 files changed, 82 insertions(+), 25 deletions(-) diff --git a/cardgame.gd b/cardgame.gd index c1bf5b9..68db0ee 100644 --- a/cardgame.gd +++ b/cardgame.gd @@ -45,6 +45,12 @@ var cards = [ "description": "Make a new commit!", "energy": 1 }, + { + "command": 'git branch new', + "arg_number": 1, + "description": "Create a new timeline.", + "energy": 1 + }, { "command": 'git merge', "arg_number": 1, diff --git a/levels/time-machine/branches b/levels/time-machine/branches index 88a6a80..2933e2e 100644 --- a/levels/time-machine/branches +++ b/levels/time-machine/branches @@ -1,10 +1,16 @@ -title = Parallel timelines +title = Parallelism [description] -In this zoo, we found a few parallel timelines. Feel free to travel between the commits to see what's going on! The ends of the timelines have little tags attached. +In this zoo, we found a some parallel timelines. What's going on here? The ends of the timelines have little tags attached. -But especially the `bad_ending` one needs our attention! Can you travel to the `good_ending` one, and make a new commit that makes everyone happy? +Especially the `bad_ending` one needs our attention! Can you travel to the `good_ending` timeline, and make a new commit where everyone involved is happy? + +[congrats] + +Whew, good job! This seems like a *much* better outcome. + +But our next mission is already waiting... [setup] @@ -27,6 +33,7 @@ git branch good_ending git rm cage/child echo "Looks happy. :)" > cage/lion +git add . git commit -m "Oh no" git checkout HEAD~2 diff --git a/levels/time-machine/conflict b/levels/time-machine/conflict index 748d55b..276f33e 100644 --- a/levels/time-machine/conflict +++ b/levels/time-machine/conflict @@ -2,7 +2,7 @@ title = Contradictions [description] -Sometimes, merging timelines will not be as simple, because they contradict each other. +Sometimes, timelines will contradict each other. For example, in this case, one of our clients wants these timelines merged, but they ate different things for breakfast in both timelines. @@ -21,14 +21,26 @@ echo "Had blueberry pancakes with maple syrup for breakfast." > tom git add . git commit -m "Pancakes!" +echo " +Is at work." >> tom +git commit -am "Go to work" + git checkout -b muesli main echo "Had muesli with oats and strawberries for breakfast." > tom git add . git commit -m "Muesli!" +echo " +Is at work." >> tom +git commit -am "Go to work" + git checkout main [win] -# main has a parent, and the parent of both its first and child parents are the same commit: -git rev-parse main^ && test "$(git rev-parse main^1~)" = "$(git rev-parse main^2~)" +# main has a parent, and the grandparent of both its first and child parents are the same commit: +git rev-parse main^ && test "$(git rev-parse main^1^^)" = "$(git rev-parse main^2^^)" + +[congrats] + +Yum, that sounds like a good breakfast! diff --git a/levels/time-machine/merge b/levels/time-machine/merge index 0e672c7..778770a 100644 --- a/levels/time-machine/merge +++ b/levels/time-machine/merge @@ -2,11 +2,11 @@ title = Merging timelines [description] -Didn't get enouth sleep last night? Here's a trick so that you can sleep a bit longer: just do all your morning activities in parallel universes, and then at the end, merge them together! +Here's a trick so that you can sleep a bit longer: just do all your morning activities in parallel universes, and then at the end, merge them together! -There are already timelines where you get a baguette and coffee. Can you make a third one where you get a donut? Drag the "branch" card to a commit to make a new branch there. +Here, you see three parallel timelines - can you build a reality in the "main" timeline where you have a baguette, a coffee, *and* a donut? -And then, use the "merge" card to join the specified timeline together with your current one. If you merge everything into "main" in the end, into a reality where you have a baguette, a coffee, and a dount, and are outside of all shops, you can still make it to work on time! +The "merge" card will help you - try it! [setup] @@ -56,8 +56,25 @@ git mv coffee_shop/you . git add . git commit -m "You leave the coffee_shop" +git checkout -b donut main +echo "You do not have a baguette. + +You do not have coffee. + +You have a donut." > you +git mv you donut_shop +git add . +git commit -m "You get a donut" +git mv donut_shop/you . +git add . +git commit -m "You leave the donut shop" + git checkout main [win] { git show main:you | grep "You have a baguette"; } && { git show main:you | grep "You have coffee"; } && { git show main:you | grep "You have a donut"; } + +[congrats] + +I wonder if you're more relaxed when you try to *sleep* in parallel timelines... diff --git a/levels/time-machine/pull-push b/levels/time-machine/pull-push index 626d9a6..6d1e599 100644 --- a/levels/time-machine/pull-push +++ b/levels/time-machine/pull-push @@ -4,10 +4,12 @@ title = Helping each other The events and timelines you see are always only what your own time machine knows about! -Of course, time agents don't have to work alone! Here, your sidekick has already prepared a merge for you! You can use the "pull" card to transfer it to your own machine. +Of course, time agents don't have to work alone! Here, your sidekick has already prepared a merge for you! You can use the "pull" card to transfer it to your own time machine. Then, add another event on top, and "push" the result, to transfer it back to your sidekick! +You can only ever manipulate things in your own time machine (the one on the right). + [setup yours] echo "Just woke up. Is hungry." > tom @@ -42,3 +44,7 @@ git commit -m "Let's make this breakfast compromise" --author="Sidekick