Skip to content

Harrison Young Recursive Art - #7

Open
hthomas60 wants to merge 4 commits into
sd17fall:masterfrom
hthomas60:master
Open

Harrison Young Recursive Art#7
hthomas60 wants to merge 4 commits into
sd17fall:masterfrom
hthomas60:master

Conversation

@hthomas60

Copy link
Copy Markdown

Turning in my project.

Harrison Young and others added 4 commits October 1, 2017 21:44
Fear the all-mighty gummy bear!!!
Intro to circuit design
My Reflection

@SeunginLyu SeunginLyu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! I've made some comments that might help you stylize your code a little better.

Comment thread recursive_art.py
import random
from PIL import Image
import math
pi = 3.14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a stylistic convention to use all caps for constants. PI=3.14

Comment thread recursive_art.py
from PIL import Image
import math
pi = 3.14
def prod(a,b): #Returns the product of two values

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice inline comments! 👍

Comment thread recursive_art.py



# prod = ['prod',build_random_function(depth-1, depth-1),build_random_function(depth-1, depth-1)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove comments for final code submission.

Comment thread recursive_art.py
# return "Error"
#TODO: implement this
#print (f)
e = evaluate_random_function #dummy function to make the code take up less room

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's actually more readable to use the full function name in this case.

Comment thread recursive_art.py
"""

difference = val-input_interval_start
difference = difference/ (input_interval_end - input_interval_start)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple syntax : difference += input_interval_end - input_interval_start)

Comment thread recursive_art.py
red_function = build_random_function(9, 15)
green_function = build_random_function(9, 15)
blue_function = build_random_function(9, 15)
x = random.uniform(0, 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this line of code doing? Perhaps add an inline comment explaining why you added this line of code.

Comment thread recursive_art.py
@@ -43,7 +110,47 @@ def evaluate_random_function(f, x, y):
>>> evaluate_random_function(["y"],0.1,0.02)
0.02

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend that you add more unit tests of your own in future projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants