-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b581be6
commit 5807039
Showing
26 changed files
with
197 additions
and
196 deletions.
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
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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
# Description | ||
# Instructions | ||
|
||
Bob is a lackadaisical teenager. In conversation, his responses are very limited. | ||
Your task is to determine what Bob will reply to someone when they say something to him or ask him a question. | ||
|
||
Bob answers 'Sure.' if you ask him a question, such as "How are you?". | ||
Bob only ever answers one of five things: | ||
|
||
He answers 'Whoa, chill out!' if you YELL AT HIM (in all capitals). | ||
|
||
He answers 'Calm down, I know what I'm doing!' if you yell a question at him. | ||
|
||
He says 'Fine. Be that way!' if you address him without actually saying | ||
anything. | ||
|
||
He answers 'Whatever.' to anything else. | ||
|
||
Bob's conversational partner is a purist when it comes to written communication and always follows normal rules regarding sentence punctuation in English. | ||
- **"Sure."** | ||
This is his response if you ask him a question, such as "How are you?" | ||
The convention used for questions is that it ends with a question mark. | ||
- **"Whoa, chill out!"** | ||
This is his answer if you YELL AT HIM. | ||
The convention used for yelling is ALL CAPITAL LETTERS. | ||
- **"Calm down, I know what I'm doing!"** | ||
This is what he says if you yell a question at him. | ||
- **"Fine. Be that way!"** | ||
This is how he responds to silence. | ||
The convention used for silence is nothing, or various combinations of whitespace characters. | ||
- **"Whatever."** | ||
This is what he answers to anything else. |
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,10 @@ | ||
# Introduction | ||
|
||
Bob is a [lackadaisical][] teenager. | ||
He likes to think that he's very cool. | ||
And he definitely doesn't get excited about things. | ||
That wouldn't be cool. | ||
|
||
When people talk to him, his responses are pretty limited. | ||
|
||
[lackadaisical]: https://www.collinsdictionary.com/dictionary/english/lackadaisical |
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
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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# Description | ||
# Instructions | ||
|
||
Write a function that returns the earned points in a single toss of a Darts game. | ||
|
||
[Darts](https://en.wikipedia.org/wiki/Darts) is a game where players | ||
throw darts at a [target](https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg). | ||
[Darts][darts] is a game where players throw darts at a [target][darts-target]. | ||
|
||
In our particular instance of the game, the target rewards 4 different amounts of points, depending on where the dart lands: | ||
|
||
* If the dart lands outside the target, player earns no points (0 points). | ||
* If the dart lands in the outer circle of the target, player earns 1 point. | ||
* If the dart lands in the middle circle of the target, player earns 5 points. | ||
* If the dart lands in the inner circle of the target, player earns 10 points. | ||
- If the dart lands outside the target, player earns no points (0 points). | ||
- If the dart lands in the outer circle of the target, player earns 1 point. | ||
- If the dart lands in the middle circle of the target, player earns 5 points. | ||
- If the dart lands in the inner circle of the target, player earns 10 points. | ||
|
||
The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. Of course, they are all centered at the same point (that is, the circles are [concentric](http://mathworld.wolfram.com/ConcentricCircles.html)) defined by the coordinates (0, 0). | ||
The outer circle has a radius of 10 units (this is equivalent to the total radius for the entire target), the middle circle a radius of 5 units, and the inner circle a radius of 1. | ||
Of course, they are all centered at the same point — that is, the circles are [concentric][] defined by the coordinates (0, 0). | ||
|
||
Write a function that given a point in the target (defined by its [Cartesian coordinates](https://www.mathsisfun.com/data/cartesian-coordinates.html) `x` and `y`, where `x` and `y` are [real](https://www.mathsisfun.com/numbers/real-numbers.html)), returns the correct amount earned by a dart landing at that point. | ||
Write a function that given a point in the target (defined by its [Cartesian coordinates][cartesian-coordinates] `x` and `y`, where `x` and `y` are [real][real-numbers]), returns the correct amount earned by a dart landing at that point. | ||
|
||
[darts]: https://en.wikipedia.org/wiki/Darts | ||
[darts-target]: https://en.wikipedia.org/wiki/Darts#/media/File:Darts_in_a_dartboard.jpg | ||
[concentric]: https://mathworld.wolfram.com/ConcentricCircles.html | ||
[cartesian-coordinates]: https://www.mathsisfun.com/data/cartesian-coordinates.html | ||
[real-numbers]: https://www.mathsisfun.com/numbers/real-numbers.html |
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Description | ||
# Instructions | ||
|
||
Determine if a word or phrase is an isogram. | ||
|
||
|
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
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
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
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
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
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# Description | ||
# Instructions | ||
|
||
Given the position of two queens on a chess board, indicate whether or not they are positioned so that they can attack each other. | ||
|
||
In the game of chess, a queen can attack pieces which are on the same row, column, or diagonal. | ||
|
||
A chessboard can be represented by an 8 by 8 array. | ||
|
||
So if you are told the white queen is at (zero-indexed) row 4, column 2 and the black queen at (zero-indexed) row 1, column 5 then you know that the set-up is like so: | ||
So if you are told the white queen is at `c5` (zero-indexed at column 2, row 3) and the black queen at `f2` (zero-indexed at column 5, row 6), then you know that the set-up is like so: | ||
|
||
```text | ||
0 1 2 3 4 5 6 7 | ||
a b c d e f g h | ||
8 _ _ _ _ _ _ _ _ 8 | ||
7 _ _ _ _ _ _ _ _ 7 | ||
6 _ _ _ _ _ _ _ _ 6 | ||
5 _ _ _ _ _ _ _ _ 5 | ||
4 _ _ W _ _ _ _ _ 4 | ||
5 _ _ W _ _ _ _ _ 5 | ||
4 _ _ _ _ _ _ _ _ 4 | ||
3 _ _ _ _ _ _ _ _ 3 | ||
2 _ _ _ _ _ _ _ _ 2 | ||
1 _ _ _ _ _ B _ _ 1 | ||
0 _ _ _ _ _ _ _ _ 0 | ||
0 1 2 3 4 5 6 7 | ||
2 _ _ _ _ _ B _ _ 2 | ||
1 _ _ _ _ _ _ _ _ 1 | ||
a b c d e f g h | ||
``` | ||
|
||
You are also be able to answer whether the queens can attack each other. | ||
You are also able to answer whether the queens can attack each other. | ||
In this case, that answer would be yes, they can, because both pieces share a diagonal. |
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
Oops, something went wrong.