-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boolean first edition #11
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## Boolean | ||
|
||
Boolean means True or False. Would it surprise you to find out that the fundamentals of computation are built entirely out of True and False? We often call this concept "binary" -- meaning two choices. You'll often here these two names, "binary" and "boolean" used to describe the same concept. | ||
|
||
One of the primary things a programmer does everyday is figuring out how to take a human concept and turn it into something that the computer can run. Being such a fundamental building block of programming means that really complex processes can be broken down into chunks of what we can call "boolean logic". | ||
|
||
Our REPL uses boolean logic. | ||
|
||
The Read phase is boolean: "has the user hit Enter/Return yet"? If the answer is yes/true, then it takes whatever text was input before and sends that input to the Evaluate phase. | ||
|
||
The Evaluation phase is boolean: the outcome of the evaluation can do two things: success or failure. This is a binary choice. It will send either a successful value or an error to the Print phase. | ||
|
||
The Print phase is boolean: either it prints an error message or the value that was passed to it from the evaluation phase. | ||
|
||
The Loop phase is also boolean: if the evaluation was successful it will remember the evaluated input so that it can be used during the next Read phase, otherwise it will forget what was input. | ||
|
||
Let's try a thinking exercise... | ||
|
||
How does sending a tweet work using boolean logic? | ||
|
||
How can you describe opening a door, drinking coffee, driving a car in terms of boolean logic? |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here => hear