Skip to content

Conversation

@hthomas60
Copy link

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
Copy link

@SeunginLyu SeunginLyu left a comment

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.

import random
from PIL import Image
import math
pi = 3.14

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

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

Choose a reason for hiding this comment

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

nice inline comments! 👍




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

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.

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

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.

"""

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

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)

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)

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.

>>> evaluate_random_function(["x"],-0.5, 0.75)
-0.5
>>> evaluate_random_function(["y"],0.1,0.02)
0.02

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