-
-
Notifications
You must be signed in to change notification settings - Fork 554
pascals-triangle: split into instructions and introduction #2449
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
Changes from 1 commit
890b363
daa6470
e8bb50d
409f601
e5b2dce
568ea25
1746fe3
3193643
56e0b16
8ff07c3
80d7132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Instructions | ||
|
||
Your task is to output the first N rows of Pascal's Triangle. | ||
ErikSchierboom marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't come up with a story here. I'm open to suggestions :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uh, I didn't even know you could comment on files, TIL. Pascal's Triangle is a classic: here are some stuff you can do with it, maybe inspiration will strike:
It's all a bit nerdy, but that can be a good thing :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the third one is most suitable for a story. Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had no idea there were so many things you could do with it! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, there's more, there are so many patterns in these numbers. Fibonacci numbers are also hiding in there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much more!
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Introduction | ||
|
||
[Pascal's triangle][wikipedia] is a triangular array of positive integers. | ||
The first (topmost) row contains a single number: one. | ||
The numbers in subsequent rows are computed by adding the numbers to the right and left of the current position in the previous row. | ||
|
||
```text | ||
1 | ||
1 1 | ||
1 2 1 | ||
1 3 3 1 | ||
1 4 6 4 1 | ||
# ... etc | ||
``` | ||
|
||
[wikipedia]: https://en.wikipedia.org/wiki/Pascal%27s_triangle |
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.
Do we need more here? Some examples?
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.
An example explicitly showing the addition process like in https://en.wikipedia.org/wiki/Pascal%27s_triangle#/media/File:PascalTriangleAnimated2.gif might be handy. I think that's where students might get stuck. Once you've got over that, I don't think additional examples provide a lot of extra insight. The modeled triangle doesn't change, just the number of rows exported.