1.2
BIN
garbage/(((((((9) * x) + y) + 10) | x) ^ 8) ^ x) & 255.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 210 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 1.1 KiB |
BIN
garbage/((((((7) log? base y) + 15) << x) & 10) - y) & 1.png
Normal file
After Width: | Height: | Size: 661 B |
BIN
garbage/(((((16) + 13) ÷? 15) << y) ^ x) & 1.png
Normal file
After Width: | Height: | Size: 595 B |
BIN
garbage/(((((16) + 13) ÷? 15) << y) ^ x) & 128.png
Normal file
After Width: | Height: | Size: 605 B |
BIN
garbage/(((((x) %? 12) << y) + y) * y) & 1.png
Normal file
After Width: | Height: | Size: 661 B |
BIN
garbage/(((((x) %? 12) << y) + y) * y) & 255.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
garbage/(((((x) >> y) - 4) ** 12) ^ 15) & 1.png
Normal file
After Width: | Height: | Size: 644 B |
BIN
garbage/(((((x) >> y) - 4) ** 12) ^ 15) & 128.png
Normal file
After Width: | Height: | Size: 341 B |
BIN
garbage/((((x) << x) | x) & y) & 128.png
Normal file
After Width: | Height: | Size: 459 B |
@ -8,7 +8,7 @@ operations = {
|
||||
"*": lambda x, y: x * y,
|
||||
"+": lambda x, y: x + y,
|
||||
"-": lambda x, y: x - y,
|
||||
"%": lambda x, y: x % y,
|
||||
"%?": lambda x, y: x if y == 0 else x % y,
|
||||
"÷?": lambda x, y: x if y == 0 else x / y, # don't want division by zero errors, and filenames can't have / in them.
|
||||
"log? base": lambda x, y: x if abs(x) <= 1 or abs(y) <= 1 else math.log(abs(x), abs(y)),
|
||||
#"~": lambda x, y: ~(getop()(x, y)), # todo
|
||||
@ -111,6 +111,13 @@ def generate(arg = "default", ops = False, syms = False):
|
||||
ops = [random.choice([x for x, y in operations.items()]) for k in range(random.randint(2, 6))]
|
||||
if not syms:
|
||||
syms = [gensym() for i in range(len(ops) + 1)]
|
||||
|
||||
literals = [f("x", "y") for f in syms]
|
||||
if "y" not in literals or "x" not in literals:
|
||||
print("DEBUG! " + sbuilder(syms, 1, False, ops) + " does not contain both x and y. Trying another")
|
||||
generate(arg)
|
||||
return
|
||||
|
||||
# uncomment to use the sample data. I used this to test the builder function.
|
||||
# ops = [">>", "*", "-", "^"]
|
||||
# ops.reverse()
|
||||
|
BIN
interesting/(((((((9) * x) + y) + 10) | x) ^ 8) ^ x) % 255.png
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
interesting/(((((((9) * x) + y) + 10) | x) ^ 8) ^ x) & 128.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
interesting/((((x) << x) | x) & y) % 255.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
interesting/((((x) << x) | x) & y) & 255.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
mildly interesting/(((((x) %? 12) << y) + y) * y) % 255.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
mildly interesting/(((((x) %? 12) << y) + y) * y) & 128.png
Normal file
After Width: | Height: | Size: 959 B |
13
readme.md
@ -52,9 +52,20 @@ and for ((((x) & y) - x) + y) + 11
|
||||
|
||||
Support for unary operators, like bitwise not (~)
|
||||
|
||||
Support for detecting if the generated function only depends on one or zero of the position expressions
|
||||
Support for detecting if the generated function only depends on one or zero of the position expressions - added in 1.2
|
||||
|
||||
#### Optimization
|
||||
|
||||
Right now, if it generates an expression that starts with a bunch of constants (like ((12) log base? 3) ** 5) it will run those potentially-expensive calculations for each pixel, even though that part of the expression never changes.
|
||||
That could be optimized
|
||||
|
||||
### Changelog
|
||||
|
||||
#### 1.2
|
||||
|
||||
- Added the % operator and the `modulo` argument.
|
||||
- Added detection of some useless patterns
|
||||
|
||||
#### 1.1
|
||||
|
||||
- Added `greyscale` argument
|
||||
|
After Width: | Height: | Size: 662 B |
BIN
very small patterns/((((x) << x) | x) & y) & 1.png
Normal file
After Width: | Height: | Size: 662 B |