diff --git a/README.md b/README.md
index 2b5f90bde..1b7476dd9 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
> A Wild Introduction to Computer Science
-
+[](https://ycombinator.chibicode.com/)
This is the repository for the website: **[Y Combinator for Non-programmers](https://ycombinator.chibicode.com/)** by Shu Uesugi.
@@ -18,9 +18,8 @@ yarn dev:en
## Stack
-- [TypeScript](https://www.typescriptlang.org/), [React](https://reactjs.org/), and [Next.js](https://nextjs.org/).
+- [TypeScript](https://www.typescriptlang.org/), [React](https://reactjs.org/), [Emotion](https://emotion.sh/) and [Next.js](https://nextjs.org/).
- [Netlify](https://netlify.com/) for deployment
-- No Google Analytics!
## License & Credits
diff --git a/public/static/images/og-image-en@2x.png b/public/static/images/og-image-en@2x.png
new file mode 100644
index 000000000..52df1a4c0
Binary files /dev/null and b/public/static/images/og-image-en@2x.png differ
diff --git a/scripts/lib/runnerConfigs.ts b/scripts/lib/runnerConfigs.ts
index 0ae62691e..eecc73915 100644
--- a/scripts/lib/runnerConfigs.ts
+++ b/scripts/lib/runnerConfigs.ts
@@ -17,6 +17,13 @@ export const qxob: ExpressionRunnerShorthandConfig = {
showPriorities: true
}
+export const bcgp: ExpressionRunnerShorthandConfig = {
+ runner: 'simple',
+ initialExpressionContainer: initialExpressionContainers.pisd,
+ initialState: 'showFuncUnbound',
+ showPriorities: true
+}
+
export const pbhg: ExpressionRunnerShorthandConfig = {
runner: 'simple',
initialExpressionContainer: initialExpressionContainers.pisd,
diff --git a/src/components/ContentTags/Inline.tsx b/src/components/ContentTags/Inline.tsx
index 754e987d6..ffb720dcd 100644
--- a/src/components/ContentTags/Inline.tsx
+++ b/src/components/ContentTags/Inline.tsx
@@ -27,7 +27,7 @@ const HighlightContext = React.createContext
+ To go to the next page, press this button:
+
+
@@ -1829,14 +1829,13 @@ const H = ({ args, highlightType, episodeNumberOverrides }: HProps) => {
Twitter:
More about me:
-
- your smartphone, tablet, or computer.
+ your smartphone, tablet, or computer
>
}
/>
@@ -242,8 +242,8 @@ export default () => (
That was what we wanted. We wanted hackers to notice us, @@ -425,9 +425,8 @@ export default () => ( } />
-
@@ -486,15 +485,14 @@ export default () => (
I had to pack a lot of materials so it can be read in under 3
hours, so
Also, sorry for not introducing myself earlier…
To go to the next page, press this button:
+
- Let me explain how mathbox works!
-
- Add
Subtracts
-
- Now you know how to add or subtract large numbers using a mathbox!{' '}
-
-
-
+
- However, for the villagers who all struggle with math,
- mathboxes' ability to do addition and subtraction was better
- than nothing.
+
-
- We’ll talk about this new feature on the next page!{' '}
+ We’ll talk about this third feature on the next page!{' '}
- I see - that’s why it becomes
- Right. That’s what happened in the earlier example - the
+ Right. That’s what happened in the earlier example—the
result was
- In this episode, I’ll show you the most complicated lunchbox - you’ve seen. + In this page, I’ll show you the most complicated lunchbox you’ve + seen.
Finally, we can use mathboxes to do additions and - subtractions - no matter how difficult they are! + subtractions!
> ) @@ -137,15 +139,50 @@ export default () => ( children: ( <>
-
Hmm…?
+ > + ) + }, + { + type: 'devil', + children: ( + <> +
+
- In the last episode, a villager from Lambda Village asked the + In the last page, a villager from Lambda Village asked the following question:
@@ -174,8 +174,7 @@ export default () => ( exactly the same as this lunchbox:
- If you
B.
- We had been talking about lunchboxes in this course.{' '}
+ We have been talking about lunchboxes in this course.{' '}
any calculations that can be
- done by today’s computers.
+ done by today’s computers
>
}
/>
@@ -374,7 +373,7 @@ export default () => (
any calculations that can be
- done by today’s computers.
+ done by today’s computers
>
}
/>
@@ -393,7 +392,7 @@ export default () => (
nodes={[
The python language has a feature called{' '}
-
@@ -431,7 +430,7 @@ export default () => (
So hopefully this course gave you an idea of what learning - computer science is like. As you learn it, you’ll be surprised how - many innovations in computer science are built on lots of simple - things! + computer science is like. As you learn it, you’ll be surprised + that most innovative ideas in computer science are based on lots + of simple ideas!
> ) @@ -691,14 +690,16 @@ export default () => (
+ That’s it for this course!
-
4 on the
+ 4 on the
bottom to 5, it will calculate the factorial of{' '}
120.
- Usually, to calculate the factorial of a number in JavaScript,
- you’d use loops like for, while, or{' '}
- reduce. Or you might use recursion.
+ To calculate the factorial of a number in JavaScript, you’d
+ usually use loops like for, while,
+ or reduce. Or you might use recursion.
This is why{' '}
@@ -159,17 +158,12 @@ export default () => (
nodes={[
- Let’s start with a{' '}
-
+
The villagers living in Lambda Village were all bad at math, so they had to rely on mathboxes to solve even the simplest problems.
- One day, a villager attempted to use a mathbox to calculate{' '}
-
So he came up with the following mathbox:
- So the result is
-
-
If you
+
-
-
-
+ Of course, you can use
So this is how{' '}
- Of course, you can use
-
-
- As we mentioned earlier,{' '}
+
- They were using
However, one day, We’ll talk about it on the next page! Don’t worry. I’m not here to take your lives away…
What? No way!
- What? No way! You can’t take our mathboxes! That’s too
- cruel!
- You can’t take our mathboxes! That’s too cruel!
-
- That’s exactly why I took away your mathboxes.{' '}
+
You see, your math skill hasn’t improved because you’re
- relying on mathboxes to do even simple additions and
- subtractions.
+ relying on mathboxes to do everything.
You should thank me for it!
+
- Since you all hadn’t spent much time studying, those
- puzzles might be too hard for you. Haha!
-
- But…we have to solve them to get our mathboxes back!
- But…we have to get our mathboxes back! We’ll accept your challenge, the devil!
+
- of a mathbox, you can do
-
- additions and subtractions accurately.
- >
- }
- />
As you can see,{' '}
-
It looks like a Japanese lunchbox!
-
+
Yeah, they’re similar.
- Actually,
- For now, let’s talk about how we can{' '}
+ Now, let’s talk about how we can{' '}
After running it,{' '}
-
- There is actually a{' '}
-
Sure, let’s look at more examples.
-
- Your task is to figure out what that is!
+
+
+ Your task is to figure out what that is!
+
- This one has
@@ -627,8 +647,10 @@ export default () => ( />
- Next, we’ll talk about the cases where there are{' '}
-
This one has
- They all follow
- Just for your reference, here are the four lunchboxes
- we’ve seen so far, and what happened when we ran them.
+
I’ll check if you’ve figured out the pattern correctly!
> diff --git a/src/contents/4.en.tsx b/src/contents/4.en.tsx index 5ad6bf55a..a561b5f04 100644 --- a/src/contents/4.en.tsx +++ b/src/contents/4.en.tsx @@ -11,6 +11,7 @@ import { } from 'src/components/ContentTags' import BottomRightBadge from 'src/components/BottomRightBadge' import TopLeftBadgeWrapper from 'src/components/TopLeftBadgeWrapper' +import TopLeftBadge from 'src/components/TopLeftBadge' import BubbleQuotes from 'src/components/BubbleQuotes' import EmojiSeparator from 'src/components/EmojiSeparator' import Emoji from 'src/components/Emoji' @@ -97,11 +98,13 @@ export const BasicRules = ({ export const Unmatched = () => ( <>
- If none of
- Let me explain. First,{' '}
+ Let me explain.
@@ -218,7 +221,7 @@ export default () => (
, then when you{' '}
-
- I thought you’ll do much worse on these quizzes because
- you haven’t been studying math seriously. Not too bad!
- Huh? Why? Huh? Why not?
- Before going to the next page, we still need to{' '}
-
-
- This is
-
Once you understand it, I’ll give you more complex
@@ -525,8 +542,8 @@ export default () => (
children: (
<>
- Okay… could you show me what the{' '}
-
-
- Then, the
- And therefore, both
- Finally,{' '}
+
Let’s recap what we’ve learned so far:
+Let’s review what we’ve learned so far:
I see, now I understand fully what was going on.
+I see, now I understand everything clearly!
> ) }, @@ -1009,10 +1028,10 @@ export default () => ( <>
Good. And{' '}
-
- But wait.{' '}
-
@@ -1129,16 +1148,18 @@ export default () => ( ) }, { - title: <>Let’s show all the steps>, + title: <>Let’s go through all the steps>, content: ( <>
-
Ok…
- Alright. I understood them,{' '}
+ I understood them,{' '}
+
Oh, that’s good to hear.
- Oh, that’s good to hear. (Maybe the devil isn’t so evil
- after all…
If you want your mathboxes back, you better solve all of them!
diff --git a/src/contents/5.en.tsx b/src/contents/5.en.tsx index 438872810..857db4710 100644 --- a/src/contents/5.en.tsx +++ b/src/contents/5.en.tsx @@ -32,17 +32,18 @@ import { InstructionTwo } from 'src/contents/4.en' -const WillReturnQuote = () => ( +const WillReturnQuote = ({ covered }: { covered?: true }) => ( <>@@ -82,13 +83,13 @@ export const ThreeRowRules = () => (
-
- From now on, you’ll be solving much harder puzzles like
- this one:
+
- But
Also,{' '}
-
Right. Also, did you realize that{' '}
-
-
-
I’ll show you!
+
-
-
@@ -411,23 +417,37 @@ export default () => ( type: 'devil', children: ( <> -
- Right. This means{' '}
-
Right. This means:
+
- Next,
-
-
- I see - that’s why we can ignore{' '}
+ I see—that’s why we can ignore{' '}
- This now looks like lunchboxes from the previous page!
- We now hae a simpler lunchbox! I think so? Hmm… I might need to look at it one more time.
-
Hmm… this is new.{' '}
-
This one looks new too.{' '}
-
- There are
After explaining them, I’ll give you more{' '} @@ -1216,7 +1244,7 @@ export default () => ( type: 'devil', children: ( <> -
Well:
+Well, here’s the deal…
-
- First, the top
- Next, the bottom-left
- Next, the right
- Yes - we can’t take any more steps, so that’s where we + Yes. We can’t take any more steps, so that’s where we stop.
> @@ -2023,17 +2055,32 @@ export default () => (Yay!
+ > + ) + }, + { + type: 'devil', + children: ( + <>
-
Hi Saya. Well, we have some bad news. The devil{' '}
-
@@ -560,7 +560,7 @@ export default () => (
description={
<>
Last time,
-
can be
can be
- then the results change.
+ then the results change
>
}
/>
@@ -787,7 +787,7 @@ export default () => (
- then the results change.
+ then the results change
>
}
/>
@@ -937,7 +937,7 @@ export default () => (
]}
description={
<>
-
If the same item appears in
@@ -948,7 +948,7 @@ export default () => (
/> and{' '}
- change one of them to something different.
+ change one of them to something different
>
}
/>
diff --git a/src/lib/date.tsx b/src/lib/date.tsx
index 4b3fa8317..ff4f7e40a 100644
--- a/src/lib/date.tsx
+++ b/src/lib/date.tsx
@@ -3,7 +3,7 @@ import { DateTime } from 'luxon'
export const date = {
jp: DateTime.fromISO('2019-09-09T00:00:00Z'),
- en: DateTime.fromISO('2019-10-31T12:00:00Z')
+ en: DateTime.fromISO('2019-10-30T12:00:00Z')
}[locale]
export const dateString = {
diff --git a/src/lib/runners/bcgp.json b/src/lib/runners/bcgp.json
new file mode 100644
index 000000000..599e73c72
--- /dev/null
+++ b/src/lib/runners/bcgp.json
@@ -0,0 +1,111 @@
+{
+ "expressionContainers": [
+ {
+ "expression": {
+ "arg": {
+ "name": "d",
+ "highlightType": "default",
+ "topLeftBadgeType": "none",
+ "bottomRightBadgeType": "none",
+ "type": "variable",
+ "argPriorityAgg": [
+ 2
+ ],
+ "funcPriorityAgg": [],
+ "emphasizePriority": false,
+ "bound": true,
+ "maxNestedFunctionDepth": 0
+ },
+ "func": {
+ "arg": {
+ "name": "c",
+ "highlightType": "active",
+ "topLeftBadgeType": "none",
+ "bottomRightBadgeType": "callArg",
+ "type": "variable",
+ "argPriorityAgg": [
+ 1
+ ],
+ "funcPriorityAgg": [],
+ "emphasizePriority": true,
+ "bound": true,
+ "maxNestedFunctionDepth": 0
+ },
+ "func": {
+ "arg": {
+ "name": "a",
+ "highlightType": "active",
+ "topLeftBadgeType": "none",
+ "bottomRightBadgeType": "funcArg",
+ "type": "variable",
+ "argPriorityAgg": [],
+ "funcPriorityAgg": [
+ 1,
+ 2
+ ],
+ "emphasizePriority": true,
+ "bound": false,
+ "maxNestedFunctionDepth": 0
+ },
+ "body": {
+ "arg": {
+ "name": "b",
+ "highlightType": "active",
+ "topLeftBadgeType": "none",
+ "bottomRightBadgeType": "funcUnbound",
+ "type": "variable",
+ "argPriorityAgg": [],
+ "funcPriorityAgg": [],
+ "emphasizePriority": false,
+ "bound": false,
+ "maxNestedFunctionDepth": 0
+ },
+ "body": {
+ "name": "a",
+ "highlightType": "active",
+ "topLeftBadgeType": "none",
+ "bottomRightBadgeType": "funcBound",
+ "type": "variable",
+ "argPriorityAgg": [],
+ "funcPriorityAgg": [],
+ "emphasizePriority": false,
+ "bound": true,
+ "maxNestedFunctionDepth": 0
+ },
+ "type": "function",
+ "maxNestedFunctionDepth": 1
+ },
+ "type": "function",
+ "maxNestedFunctionDepth": 2
+ },
+ "state": "showFuncUnbound",
+ "type": "call",
+ "priority": 1,
+ "maxNestedFunctionDepth": 2
+ },
+ "state": "default",
+ "type": "call",
+ "priority": 2,
+ "maxNestedFunctionDepth": 2
+ },
+ "numLeafNodes": 3,
+ "containerState": "stepped",
+ "previouslyChangedExpressionState": "showFuncUnbound",
+ "activePriority": 1
+ }
+ ],
+ "speed": 1,
+ "hideControls": true,
+ "explanationsVisibility": "hidden",
+ "hidePriorities": false,
+ "hideRunButton": false,
+ "hideBottomRightBadges": false,
+ "skipToTheEnd": false,
+ "hideFuncUnboundBadgeOnExplanation": false,
+ "highlightOverridesCallArgAndFuncUnboundOnly": false,
+ "bottomRightBadgeOverrides": {},
+ "highlightOverrides": {},
+ "highlightOverrideActiveAfterStart": false,
+ "highlightFunctions": false,
+ "showBottomProgressBar": false
+}
diff --git a/src/lib/theme/lineHeights.ts b/src/lib/theme/lineHeights.ts
index 665845c2a..e8ba12a47 100644
--- a/src/lib/theme/lineHeights.ts
+++ b/src/lib/theme/lineHeights.ts
@@ -4,7 +4,7 @@ export const allLineHeights = {
1: 1,
1.1: 1.1,
1.3: 1.3,
- 1.5: 1.5,
+ 1.55: 1.55,
2: 2
}