TAKE 2: code refactored for beginners, with extensive comments and docstrings#5
Open
gw666 wants to merge 15 commits intoSICPDistilled:masterfrom
Open
TAKE 2: code refactored for beginners, with extensive comments and docstrings#5gw666 wants to merge 15 commits intoSICPDistilled:masterfrom
gw666 wants to merge 15 commits intoSICPDistilled:masterfrom
Conversation
also added comments to help orient new users
shapes: box, x, diamond, george segment-lists allow compound shapes to be drawn using concat; see diamond-x fcns: flip-horiz, flip-vert; rotate, rotate180, rotate270; below
Abstracted split-up, split-right into higher-level split function.
Source code refactored, with comments and docstrings added, to make it easy for beginners to get up to speed quickly. Does not implement image-painter. To give yourself a chance to complete the exercise as ‘thattommyhall’ intended, delete the bodies of the following functions: add-vec sub-vec scale-vec flip-horiz rotate below path right-split (uncomment by removing “#_”) up-split (uncomment by removing “#_”) split Just evaluate this file to see the “goal” function, square-limit, draw itself. This version uses the “higher-level” versions of right-split and up-split. If you decide to write the code for up-split and derive the higher-level function ‘split’, you will need to comment out or remove the versions of right-split and up-split that follow split in the source code and un-comment the versions that precede split in the source code. Enjoy, and please give me feedback if you find my version helpful!
This reverts commit f8dc53523901f84b162294b3ba8f2bd7a6a3ac6f. Conflicts: src/escher/core.clj
This reverts commit f8dc53523901f84b162294b3ba8f2bd7a6a3ac6f. Conflicts: src/escher/core.clj
This file is functionally equivalent to the version in the SICPDistilled/master repository. The following has been done to make the file more useful to Clojure programmers who are starting from scratch: * reordered code to group related code together * added useful info in comments * added docstrings to major functions * added formatting to increase readability
Member
Author
|
see below On Mar 25, 2015, at 7:18 AM, thattommyhall notifications@github.com wrote:
Gregg |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Now I've cut out everything that you didn't have in your version of escher.clj. I also added support for clj-tuple. Feel free to use as much/as little as you wish.
Cheers,
Gregg