Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ItsSpecialRelativity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Got a bit more practice with lamdas, I enjoyed this project.
# Random Art

## Description
Expand Down
Binary file added __pycache__/random_art.cpython-34.pyc
Binary file not shown.
Binary file added color-1031119073200144494-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1213444346702248303-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1249478641880242223-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1298689709037959123-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1435488575250313642-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1475238070523080563-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1714281983672849932-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1749255014515609453-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1802172039665495461-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-1946100634687877999-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-2081541521017398589-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-2786922462988556840-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-2902026167508585365-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-302640008381820604-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3177453901497002514-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3309766383194321094-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-347763768067566006-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3595213747247415039-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-365922155415912472-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3708175580506573523-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3728539407936793982-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3872827585747759991-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-3879674315140170331-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-4062360497548581895-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added color-4128535628735731028-0.png
Binary file added color-4263560867797489395-0.png
Binary file added color-4294572802335535045-0.png
Binary file added color-4406872941427629553-0.png
Binary file added color-4519562840973687649-0.png
Binary file added color-4536411483725882935-0.png
Binary file added color-4578862286315382485-0.png
Binary file added color-4641566064769055246-0.png
Binary file added color-4663989274233042553-0.png
Binary file added color-4793487335564345325-0.png
Binary file added color-4854357164516254892-0.png
Binary file added color-5414314194833404542-0.png
Binary file added color-5597906272938945935-0.png
Binary file added color-5634238398577681645-0.png
Binary file added color-5878640098423439442-0.png
Binary file added color-5884756777376665912-0.png
Binary file added color-6229272125301861709-0.png
Binary file added color-6407710747248143048-0.png
Binary file added color-6464521797830514234-0.png
Binary file added color-6510603944064124942-0.png
Binary file added color-6515353525636204296-0.png
Binary file added color-6557788086202629127-0.png
Binary file added color-6680790422494451366-0.png
Binary file added color-6761920874929517134-0.png
Binary file added color-7375568152174973105-0.png
Binary file added color-7768876801770881732-0.png
Binary file added color-7992360422903780094-0.png
Binary file added color-8085649172186047216-0.png
Binary file added color-8271619161900457834-0.png
Binary file added color-8373450865750546164-0.png
Binary file added color-8444869188189773755-0.png
Binary file added color-8449727847107394764-0.png
Binary file added color-8590383531229500193-0.png
Binary file added color-8632371822804819536-0.png
Binary file added color-8654186420304998664-0.png
Binary file added color-8827804812837424368-0.png
Binary file added color-8859336454323465677-0.png
2 changes: 2 additions & 0 deletions create_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def make_gray(seed, num_pics=1, width=300):
gray_exp = create_expression()
print("{}: {}".format(filename, gray_exp))
image = generate_monochrome_image(gray_exp, width)
image.show(filename, "PNG")
image.save(filename, "PNG")


Expand All @@ -71,6 +72,7 @@ def make_color(seed, num_pics=1, width=300):
green_exp,
blue_exp))
image = generate_rgb_image(red_exp, green_exp, blue_exp, width)
image.show(filename, "PNG")
image.save(filename, "PNG")


Expand Down
31 changes: 29 additions & 2 deletions random_art.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random

import math as m
import numpy as np
# Your job is to create better version of create_expression and
# run_expression to create random art.
# Your expression should have a __str__() function defined for it.
Expand All @@ -8,7 +9,33 @@
def create_expression():
"""This function takes no arguments and returns an expression that
generates a number between -1.0 and 1.0, given x and y coordinates."""
expr = lambda x, y: (random.random() * 2) - 1
i = random.random()
w = random.randint(1, 30)
s = random.randint(1, 5)
choice = random.randint(1, 3)

def expr(x, y):
for item in range(3):
x = x * i
y = y * i
x += m.factorial(s)

op1 = (lambda x, y: x*i*y/m.sin(299792458)/3.14345353)(y, x)
op2 = (lambda x, y: (x*w/3.14) % s + i)(x, y)
op3 = (lambda x, y: (m.cos(y**2) * m.gamma(x)))(x, y)
if choice == 1:
op = op1
ops = op2
if choice == 2:
op = op2
ops = op3
if choice == 3:
op = op3
ops = op1
u = (lambda x, y: (x*2) * (y*2))(op, ops)
ans = u
return ans

return expr


Expand Down