Post History
Python 3 + PYTHONHASHSEED=764, 193+18=211 bytes This doesn't work with Python's default settings, because for security reasons hash gives different results for the same input on different runs. It...
#2: Post edited
## Python 3, 193+18=211 bytes- This doesn't work with Python's default settings, because for security reasons `hash` gives different results for the same input on different runs. It needs 18 extra bytes to define an environment variable to make Python give consistent output, to allow hardcoding the long string:
- ```bash
- PYTHONHASHSEED=764
- ```
- The code is then a lambda (anonymous) function which converts the input string to the last 3 characters of the hexadecimal form of its hash, and then checks if this is present in the concatenation of 3 character strings for all of the nets (which is stored as base 36 and converted to hex for the check).
- ```python
- lambda s:hex(hash(s))[-3:]in hex(int("5h9fh4xkwqqqgfqz410wog4mjsotxldb6dyfalqrcukexb2b8dni5xoyy19urmbgn8pgfjkqk42clxpgmbtlods6i25sbbw5lxn8fij4zpi0wpp7kzvylxeogi2i0wmg83pxjm57dm0igt4j5b057",36))
- ```
- I initially tried with the environment variable set to 1, and this required the last 4 characters of the hex hash in order to avoid getting false positives for the non-net hexominoes. I wondered if changing the seed might give a collection of hashes where just the last 3 characters would be sufficient to avoid false positives.
- To find out, I wrote the following Python file to give no output unless all test cases pass, in which case it would output the value of the environment variable:
- ### `a.py`
- ```python
- nets="""#.....
- ####..
- #.....
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ###...
- ......
- ......
- ...#..
- ####..
- ...#..
- ......
- ......
- ......
- ###...
- .#....
- .#....
- .#....
- ......
- ......
- .##...
- .#....
- .#....
- ##....
- ......
- ......
- ...#..
- ####..
- #.....
- ......
- ......
- ......
- ##....
- .#....
- .#....
- .##...
- ......
- ......
- #.....
- ####..
- ...#..
- ......
- ......
- ......
- ##....
- .###..
- .#....
- ......
- ......
- ......
- #.....
- ###...
- .#....
- .#....
- ......
- ......
- ..#...
- ###...
- .#....
- .#....
- ......
- ......
- .#....
- .###..
- ##....
- ......
- ......
- ......
- .#....
- .#....
- ###...
- #.....
- ......
- ......
- ..##..
- ###...
- ..#...
- ......
- ......
- ......
- .#....
- .#....
- ###...
- ..#...
- ......
- ......
- ..#...
- ###...
- ..##..
- ......
- ......
- ......
- ##....
- .##...
- ..##..
- ......
- ......
- ......
- #.....
- ##....
- .##...
- ..#...
- ......
- ......
- ..##..
- .##...
- ##....
- ......
- ......
- ......
- ..#...
- .##...
- ##....
- #.....
- ......
- ......
- ###...
- ..###.
- ......
- ......
- ......
- ......
- ..###.
- ###...
- ......
- ......
- ......
- ......
- #.....
- #.....
- ##....
- .#....
- .#....
- ......
- .#....
- .#....
- ##....
- #.....
- #.....
- ......
- .#....
- ###...
- .#....
- .#....
- ......
- ......
- .#....
- .#....
- ###...
- .#....
- ......
- ......
- ..#...
- ####..
- ..#...
- ......
- ......
- ......
- .#....
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ###...
- ..##..
- ......
- ......
- ......
- ..#...
- .##...
- ##....
- .#....
- ......
- ......
- ##....
- .###..
- ..#...
- ......
- ......
- ......
- .#....
- .##...
- ##....
- #.....
- ......
- ......
- #.....
- ##....
- .##...
- .#....
- ......
- ......
- ..##..
- ###...
- .#....
- ......
- ......
- ......
- ..#...
- .###..
- ##....
- ......
- ......
- ......
- .#....
- ##....
- .##...
- ..#...
- ......
- ......
- #.....
- ##....
- .#....
- .##...
- ......
- ......
- ..##..
- ###...
- #.....
- ......
- ......
- ......
- ##....
- .#....
- .##...
- ..#...
- ......
- ......
- .##...
- .#....
- ##....
- #.....
- ......
- ......
- ##....
- .###..
- ...#..
- ......
- ......
- ......
- #.....
- ###...
- ..##..
- ......
- ......
- ......
- ..#...
- .##...
- .#....
- ##....
- ......
- ......
- ...#..
- .###..
- ##....
- ......
- ......
- ......
- ...#..
- ####..
- ..#...
- ......
- ......
- ......
- .##...
- ##....
- .#....
- .#....
- ......
- ......
- ##....
- .##...
- .#....
- .#....
- ......
- ......
- .#....
- ####..
- #.....
- ......
- ......
- ......
- #.....
- ####..
- .#....
- ......
- ......
- ......
- .#....
- .#....
- ##....
- .##...
- ......
- ......
- .#....
- .#....
- .##...
- ##....
- ......
- ......
- ..#...
- ####..
- ...#..
- ......
- ......
- ......
- .#....
- .##...
- ##....
- .#....
- ......
- ......
- .#....
- ####..
- ..#...
- ......
- ......
- ......
- ..#...
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ##....
- .##...
- .#....
- ......
- ......
- .#....
- .##...
- .#....
- ##....
- ......
- ......
- .#....
- ##....
- .#....
- .##...
- ......
- ......
- .##...
- .#....
- ##....
- .#....
- ......
- ......
- ##....
- .#....
- .##...
- .#....
- ......
- ......
- #.....
- ####..
- ..#...
- ......
- ......
- ......
- ..#...
- ####..
- #.....
- ......
- ......
- ......
- ...#..
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ####..
- ...#..
- ......
- ......
- ......"""
- not_nets="""..#...
- #####.
- ......
- ......
- ......
- ......
- #####.
- ..#...
- ......
- ......
- ......
- ......
- .#....
- .#....
- ##....
- .#....
- .#....
- ......
- #.....
- #.....
- ##....
- #.....
- #.....
- ......
- .##...
- ###...
- .#....
- ......
- ......
- ......
- ##....
- ###...
- .#....
- ......
- ......
- ......
- .#....
- ###...
- ##....
- ......
- ......
- ......
- .#....
- ###...
- .##...
- ......
- ......
- ......
- ##....
- .####.
- ......
- ......
- ......
- ......
- ####..
- ...##.
- ......
- ......
- ......
- ......
- #.....
- ##....
- .#....
- .#....
- .#....
- ......
- ...##.
- ####..
- ......
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ##....
- #.....
- ......
- #.....
- #.....
- #.....
- ##....
- .#....
- ......
- .#....
- ##....
- #.....
- #.....
- #.....
- ......
- .####.
- ##....
- ......
- ......
- ......
- ......
- .#....
- ##....
- ###...
- ......
- ......
- ......
- #.....
- ###...
- ##....
- ......
- ......
- ......
- ###...
- ##....
- .#....
- ......
- ......
- ......
- ##....
- ###...
- #.....
- ......
- ......
- ......
- ###...
- .##...
- .#....
- ......
- ......
- ......
- .##...
- ###...
- ..#...
- ......
- ......
- ......
- ..#...
- ###...
- .##...
- ......
- ......
- ......
- .#....
- .##...
- ###...
- ......
- ......
- ......
- ###...
- ..#...
- ..##..
- ......
- ......
- ......
- ..#...
- ..#...
- ###...
- #.....
- ......
- ......
- ..#...
- ###...
- #.....
- #.....
- ......
- ......
- #.....
- ###...
- ..#...
- ..#...
- ......
- ......
- .###..
- .#....
- ##....
- ......
- ......
- ......
- #.....
- #.....
- ###...
- ..#...
- ......
- ......
- ..##..
- ..#...
- ###...
- ......
- ......
- ......
- ##....
- .#....
- .###..
- ......
- ......
- ......
- ####..
- ##....
- ......
- ......
- ......
- ......
- .#....
- .#....
- ##....
- ##....
- ......
- ......
- ..##..
- ####..
- ......
- ......
- ......
- ......
- #.....
- #.....
- ##....
- ##....
- ......
- ......
- ##....
- ##....
- .#....
- .#....
- ......
- ......
- ##....
- ####..
- ......
- ......
- ......
- ......
- ##....
- ##....
- #.....
- #.....
- ......
- ......
- ####..
- ..##..
- ......
- ......
- ......
- ......
- ####..
- .#....
- .#....
- ......
- ......
- ......
- ..#...
- ..#...
- ####..
- ......
- ......
- ......
- ..#...
- ..#...
- ###...
- ..#...
- ......
- ......
- #.....
- #.....
- ###...
- #.....
- ......
- ......
- #.....
- ###...
- #.....
- #.....
- ......
- ......
- ####..
- ..#...
- ..#...
- ......
- ......
- ......
- .#....
- .#....
- ####..
- ......
- ......
- ......
- ..#...
- ###...
- ..#...
- ..#...
- ......
- ......
- ####..
- #.#...
- ......
- ......
- ......
- ......
- .#....
- ##....
- .#....
- ##....
- ......
- ......
- #.#...
- ####..
- ......
- ......
- ......
- ......
- #.....
- ##....
- #.....
- ##....
- ......
- ......
- ##....
- .#....
- ##....
- .#....
- ......
- ......
- .#.#..
- ####..
- ......
- ......
- ......
- ......
- ####..
- .#.#..
- ......
- ......
- ......
- ......
- ##....
- #.....
- ##....
- #.....
- ......
- ......
- ...#..
- ...#..
- ####..
- ......
- ......
- ......
- ####..
- ...#..
- ...#..
- ......
- ......
- ......
- ..#...
- ..#...
- ..#...
- ###...
- ......
- ......
- ###...
- ..#...
- ..#...
- ..#...
- ......
- ......
- ###...
- #.....
- #.....
- #.....
- ......
- ......
- #.....
- #.....
- #.....
- ###...
- ......
- ......
- #.....
- #.....
- ####..
- ......
- ......
- ......
- ####..
- #.....
- #.....
- ......
- ......
- ......
- .##...
- ##....
- .##...
- ......
- ......
- ......
- #.#...
- ###...
- .#....
- ......
- ......
- ......
- ##....
- .##...
- ##....
- ......
- ......
- ......
- .#....
- ###...
- #.#...
- ......
- ......
- ......
- ##....
- ##....
- .##...
- ......
- ......
- ......
- #.....
- ###...
- .##...
- ......
- ......
- ......
- ..#...
- ###...
- ##....
- ......
- ......
- ......
- .##...
- ###...
- #.....
- ......
- ......
- ......
- .##...
- ##....
- ##....
- ......
- ......
- ......
- ##....
- .##...
- .##...
- ......
- ......
- ......
- ##....
- ###...
- ..#...
- ......
- ......
- ......
- .##...
- .##...
- ##....
- ......
- ......
- ......
- #.....
- ##....
- ###...
- ......
- ......
- ......
- ..#...
- .##...
- ###...
- ......
- ......
- ......
- ###...
- .##...
- ..#...
- ......
- ......
- ......
- ###...
- ##....
- #.....
- ......
- ......
- ......
- ######
- ......
- ......
- ......
- ......
- ......
- #.....
- #.....
- #.....
- #.....
- #.....
- #.....
- .###..
- ##....
- .#....
- ......
- ......
- ......
- .#....
- ###...
- #.....
- #.....
- ......
- ......
- .#....
- ###...
- ..#...
- ..#...
- ......
- ......
- ..#...
- ..#...
- ###...
- .#....
- ......
- ......
- ###...
- ..##..
- ..#...
- ......
- ......
- ......
- .#....
- ##....
- .###..
- ......
- ......
- ......
- ..#...
- ..##..
- ###...
- ......
- ......
- ......
- #.....
- #.....
- ###...
- .#....
- ......
- ......
- #.#...
- ###...
- #.....
- ......
- ......
- ......
- #.#...
- ###...
- ..#...
- ......
- ......
- ......
- #.....
- ###...
- #.#...
- ......
- ......
- ......
- ##....
- .#....
- ###...
- ......
- ......
- ......
- ..#...
- ###...
- #.#...
- ......
- ......
- ......
- ###...
- .#....
- ##....
- ......
- ......
- ......
- .##...
- .#....
- ###...
- ......
- ......
- ......
- ###...
- .#....
- .##...
- ......
- ......
- ......
- ###...
- ###...
- ......
- ......
- ......
- ......
- ##....
- ##....
- ##....
- ......
- ......
- ......
- #####.
- ....#.
- ......
- ......
- ......
- ......
- ....#.
- #####.
- ......
- ......
- ......
- ......
- #####.
- #.....
- ......
- ......
- ......
- ......
- ##....
- #.....
- #.....
- #.....
- #.....
- ......
- .#....
- .#....
- .#....
- .#....
- ##....
- ......
- #.....
- #.....
- #.....
- #.....
- ##....
- ......
- ##....
- .#....
- .#....
- .#....
- .#....
- ......
- #.....
- #####.
- ......
- ......
- ......
- ......
- #.....
- #.#...
- ###...
- ......
- ......
- ......
- ###...
- #.....
- ##....
- ......
- ......
- ......
- ###...
- #.#...
- #.....
- ......
- ......
- ......
- ###...
- ..#...
- .##...
- ......
- ......
- ......
- ##....
- #.....
- ###...
- ......
- ......
- ......
- ###...
- #.#...
- ..#...
- ......
- ......
- ......
- ..#...
- #.#...
- ###...
- ......
- ......
- ......
- .##...
- ..#...
- ###...
- ......
- ......
- ......
- ###...
- .###..
- ......
- ......
- ......
- ......
- .#....
- ##....
- ##....
- #.....
- ......
- ......
- #.....
- ##....
- ##....
- .#....
- ......
- ......
- .###..
- ###...
- ......
- ......
- ......
- ......
- ##....
- .##...
- ..#...
- ..#...
- ......
- ......
- ###...
- ..##..
- ...#..
- ......
- ......
- ......
- ..#...
- ..#...
- .##...
- ##....
- ......
- ......
- .##...
- ##....
- #.....
- #.....
- ......
- ......
- .###..
- ##....
- #.....
- ......
- ......
- ......
- #.....
- ##....
- .###..
- ......
- ......
- ......
- #.....
- #.....
- ##....
- .##...
- ......
- ......
- ...#..
- ..##..
- ###...
- ......
- ......
- ......
- .##...
- ####..
- ......
- ......
- ......
- ......
- #.....
- ##....
- ##....
- #.....
- ......
- ......
- .#....
- ##....
- ##....
- .#....
- ......
- ......
- ####..
- .##...
- ......
- ......
- ......
- ......
- ##....
- .#....
- ##....
- #.....
- ......
- ......
- ##....
- #.....
- ##....
- .#....
- ......
- ......
- ##.#..
- .###..
- ......
- ......
- ......
- ......
- .###..
- ##.#..
- ......
- ......
- ......
- ......
- #.##..
- ###...
- ......
- ......
- ......
- ......
- .#....
- ##....
- #.....
- ##....
- ......
- ......
- ###...
- #.##..
- ......
- ......
- ......
- ......
- #.....
- ##....
- .#....
- ##....
- ......
- ......
- .#....
- ##....
- .#....
- .#....
- .#....
- ......
- ...#..
- #####.
- ......
- ......
- ......
- ......
- #.....
- #.....
- #.....
- ##....
- #.....
- ......
- .#....
- #####.
- ......
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ##....
- .#....
- ......
- #####.
- ...#..
- ......
- ......
- ......
- ......
- #.....
- ##....
- #.....
- #.....
- #.....
- ......
- #####.
- .#....
- ......
- ......
- ......
- ......
- #..#..
- ####..
- ......
- ......
- ......
- ......
- ##....
- .#....
- .#....
- ##....
- ......
- ......
- ####..
- #..#..
- ......
- ......
- ......
- ......
- ##....
- #.....
- #.....
- ##....
- ......
- ......"""
- pattern="".join(hex(hash(x))[-3:] for x in nets.split("\n\n"))
- f=lambda s:hex(hash(s))[-3:]in pattern
- for net in nets.split("\n\n"):
- if not f(net):
- exit()
- for not_net in not_nets.split("\n\n"):
- if f(not_net):
- exit()
- import os
- print(os.environ['PYTHONHASHSEED'])
- ```
- I then ran this with ascending values for the environment variable using Bash:
- ```bash
- for ((i=0;i<1000;i++));do PYTHONHASHSEED=$i python a.py;done
- ```
- The smallest working value this found was 764.
- ### Testing
- Testing this online is difficult because it only works with the environment variable set.
- Locally, you can save the `a.py` file and then run it with:
- ```bash
- PYTHONHASHSEED=764 python a.py
- ```
- If this outputs `764` then all of the test cases have passed. If any fail it will output nothing.
- ## Python 3 + PYTHONHASHSEED=764, 193+18=211 bytes
- This doesn't work with Python's default settings, because for security reasons `hash` gives different results for the same input on different runs. It needs 18 extra bytes to define an environment variable to make Python give consistent output, to allow hardcoding the long string:
- ```bash
- PYTHONHASHSEED=764
- ```
- The code is then a lambda (anonymous) function which converts the input string to the last 3 characters of the hexadecimal form of its hash, and then checks if this is present in the concatenation of 3 character strings for all of the nets (which is stored as base 36 and converted to hex for the check).
- ```python
- lambda s:hex(hash(s))[-3:]in hex(int("5h9fh4xkwqqqgfqz410wog4mjsotxldb6dyfalqrcukexb2b8dni5xoyy19urmbgn8pgfjkqk42clxpgmbtlods6i25sbbw5lxn8fij4zpi0wpp7kzvylxeogi2i0wmg83pxjm57dm0igt4j5b057",36))
- ```
- I initially tried with the environment variable set to 1, and this required the last 4 characters of the hex hash in order to avoid getting false positives for the non-net hexominoes. I wondered if changing the seed might give a collection of hashes where just the last 3 characters would be sufficient to avoid false positives.
- To find out, I wrote the following Python file to give no output unless all test cases pass, in which case it would output the value of the environment variable:
- ### `a.py`
- ```python
- nets="""#.....
- ####..
- #.....
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ###...
- ......
- ......
- ...#..
- ####..
- ...#..
- ......
- ......
- ......
- ###...
- .#....
- .#....
- .#....
- ......
- ......
- .##...
- .#....
- .#....
- ##....
- ......
- ......
- ...#..
- ####..
- #.....
- ......
- ......
- ......
- ##....
- .#....
- .#....
- .##...
- ......
- ......
- #.....
- ####..
- ...#..
- ......
- ......
- ......
- ##....
- .###..
- .#....
- ......
- ......
- ......
- #.....
- ###...
- .#....
- .#....
- ......
- ......
- ..#...
- ###...
- .#....
- .#....
- ......
- ......
- .#....
- .###..
- ##....
- ......
- ......
- ......
- .#....
- .#....
- ###...
- #.....
- ......
- ......
- ..##..
- ###...
- ..#...
- ......
- ......
- ......
- .#....
- .#....
- ###...
- ..#...
- ......
- ......
- ..#...
- ###...
- ..##..
- ......
- ......
- ......
- ##....
- .##...
- ..##..
- ......
- ......
- ......
- #.....
- ##....
- .##...
- ..#...
- ......
- ......
- ..##..
- .##...
- ##....
- ......
- ......
- ......
- ..#...
- .##...
- ##....
- #.....
- ......
- ......
- ###...
- ..###.
- ......
- ......
- ......
- ......
- ..###.
- ###...
- ......
- ......
- ......
- ......
- #.....
- #.....
- ##....
- .#....
- .#....
- ......
- .#....
- .#....
- ##....
- #.....
- #.....
- ......
- .#....
- ###...
- .#....
- .#....
- ......
- ......
- .#....
- .#....
- ###...
- .#....
- ......
- ......
- ..#...
- ####..
- ..#...
- ......
- ......
- ......
- .#....
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ###...
- ..##..
- ......
- ......
- ......
- ..#...
- .##...
- ##....
- .#....
- ......
- ......
- ##....
- .###..
- ..#...
- ......
- ......
- ......
- .#....
- .##...
- ##....
- #.....
- ......
- ......
- #.....
- ##....
- .##...
- .#....
- ......
- ......
- ..##..
- ###...
- .#....
- ......
- ......
- ......
- ..#...
- .###..
- ##....
- ......
- ......
- ......
- .#....
- ##....
- .##...
- ..#...
- ......
- ......
- #.....
- ##....
- .#....
- .##...
- ......
- ......
- ..##..
- ###...
- #.....
- ......
- ......
- ......
- ##....
- .#....
- .##...
- ..#...
- ......
- ......
- .##...
- .#....
- ##....
- #.....
- ......
- ......
- ##....
- .###..
- ...#..
- ......
- ......
- ......
- #.....
- ###...
- ..##..
- ......
- ......
- ......
- ..#...
- .##...
- .#....
- ##....
- ......
- ......
- ...#..
- .###..
- ##....
- ......
- ......
- ......
- ...#..
- ####..
- ..#...
- ......
- ......
- ......
- .##...
- ##....
- .#....
- .#....
- ......
- ......
- ##....
- .##...
- .#....
- .#....
- ......
- ......
- .#....
- ####..
- #.....
- ......
- ......
- ......
- #.....
- ####..
- .#....
- ......
- ......
- ......
- .#....
- .#....
- ##....
- .##...
- ......
- ......
- .#....
- .#....
- .##...
- ##....
- ......
- ......
- ..#...
- ####..
- ...#..
- ......
- ......
- ......
- .#....
- .##...
- ##....
- .#....
- ......
- ......
- .#....
- ####..
- ..#...
- ......
- ......
- ......
- ..#...
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ##....
- .##...
- .#....
- ......
- ......
- .#....
- .##...
- .#....
- ##....
- ......
- ......
- .#....
- ##....
- .#....
- .##...
- ......
- ......
- .##...
- .#....
- ##....
- .#....
- ......
- ......
- ##....
- .#....
- .##...
- .#....
- ......
- ......
- #.....
- ####..
- ..#...
- ......
- ......
- ......
- ..#...
- ####..
- #.....
- ......
- ......
- ......
- ...#..
- ####..
- .#....
- ......
- ......
- ......
- .#....
- ####..
- ...#..
- ......
- ......
- ......"""
- not_nets="""..#...
- #####.
- ......
- ......
- ......
- ......
- #####.
- ..#...
- ......
- ......
- ......
- ......
- .#....
- .#....
- ##....
- .#....
- .#....
- ......
- #.....
- #.....
- ##....
- #.....
- #.....
- ......
- .##...
- ###...
- .#....
- ......
- ......
- ......
- ##....
- ###...
- .#....
- ......
- ......
- ......
- .#....
- ###...
- ##....
- ......
- ......
- ......
- .#....
- ###...
- .##...
- ......
- ......
- ......
- ##....
- .####.
- ......
- ......
- ......
- ......
- ####..
- ...##.
- ......
- ......
- ......
- ......
- #.....
- ##....
- .#....
- .#....
- .#....
- ......
- ...##.
- ####..
- ......
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ##....
- #.....
- ......
- #.....
- #.....
- #.....
- ##....
- .#....
- ......
- .#....
- ##....
- #.....
- #.....
- #.....
- ......
- .####.
- ##....
- ......
- ......
- ......
- ......
- .#....
- ##....
- ###...
- ......
- ......
- ......
- #.....
- ###...
- ##....
- ......
- ......
- ......
- ###...
- ##....
- .#....
- ......
- ......
- ......
- ##....
- ###...
- #.....
- ......
- ......
- ......
- ###...
- .##...
- .#....
- ......
- ......
- ......
- .##...
- ###...
- ..#...
- ......
- ......
- ......
- ..#...
- ###...
- .##...
- ......
- ......
- ......
- .#....
- .##...
- ###...
- ......
- ......
- ......
- ###...
- ..#...
- ..##..
- ......
- ......
- ......
- ..#...
- ..#...
- ###...
- #.....
- ......
- ......
- ..#...
- ###...
- #.....
- #.....
- ......
- ......
- #.....
- ###...
- ..#...
- ..#...
- ......
- ......
- .###..
- .#....
- ##....
- ......
- ......
- ......
- #.....
- #.....
- ###...
- ..#...
- ......
- ......
- ..##..
- ..#...
- ###...
- ......
- ......
- ......
- ##....
- .#....
- .###..
- ......
- ......
- ......
- ####..
- ##....
- ......
- ......
- ......
- ......
- .#....
- .#....
- ##....
- ##....
- ......
- ......
- ..##..
- ####..
- ......
- ......
- ......
- ......
- #.....
- #.....
- ##....
- ##....
- ......
- ......
- ##....
- ##....
- .#....
- .#....
- ......
- ......
- ##....
- ####..
- ......
- ......
- ......
- ......
- ##....
- ##....
- #.....
- #.....
- ......
- ......
- ####..
- ..##..
- ......
- ......
- ......
- ......
- ####..
- .#....
- .#....
- ......
- ......
- ......
- ..#...
- ..#...
- ####..
- ......
- ......
- ......
- ..#...
- ..#...
- ###...
- ..#...
- ......
- ......
- #.....
- #.....
- ###...
- #.....
- ......
- ......
- #.....
- ###...
- #.....
- #.....
- ......
- ......
- ####..
- ..#...
- ..#...
- ......
- ......
- ......
- .#....
- .#....
- ####..
- ......
- ......
- ......
- ..#...
- ###...
- ..#...
- ..#...
- ......
- ......
- ####..
- #.#...
- ......
- ......
- ......
- ......
- .#....
- ##....
- .#....
- ##....
- ......
- ......
- #.#...
- ####..
- ......
- ......
- ......
- ......
- #.....
- ##....
- #.....
- ##....
- ......
- ......
- ##....
- .#....
- ##....
- .#....
- ......
- ......
- .#.#..
- ####..
- ......
- ......
- ......
- ......
- ####..
- .#.#..
- ......
- ......
- ......
- ......
- ##....
- #.....
- ##....
- #.....
- ......
- ......
- ...#..
- ...#..
- ####..
- ......
- ......
- ......
- ####..
- ...#..
- ...#..
- ......
- ......
- ......
- ..#...
- ..#...
- ..#...
- ###...
- ......
- ......
- ###...
- ..#...
- ..#...
- ..#...
- ......
- ......
- ###...
- #.....
- #.....
- #.....
- ......
- ......
- #.....
- #.....
- #.....
- ###...
- ......
- ......
- #.....
- #.....
- ####..
- ......
- ......
- ......
- ####..
- #.....
- #.....
- ......
- ......
- ......
- .##...
- ##....
- .##...
- ......
- ......
- ......
- #.#...
- ###...
- .#....
- ......
- ......
- ......
- ##....
- .##...
- ##....
- ......
- ......
- ......
- .#....
- ###...
- #.#...
- ......
- ......
- ......
- ##....
- ##....
- .##...
- ......
- ......
- ......
- #.....
- ###...
- .##...
- ......
- ......
- ......
- ..#...
- ###...
- ##....
- ......
- ......
- ......
- .##...
- ###...
- #.....
- ......
- ......
- ......
- .##...
- ##....
- ##....
- ......
- ......
- ......
- ##....
- .##...
- .##...
- ......
- ......
- ......
- ##....
- ###...
- ..#...
- ......
- ......
- ......
- .##...
- .##...
- ##....
- ......
- ......
- ......
- #.....
- ##....
- ###...
- ......
- ......
- ......
- ..#...
- .##...
- ###...
- ......
- ......
- ......
- ###...
- .##...
- ..#...
- ......
- ......
- ......
- ###...
- ##....
- #.....
- ......
- ......
- ......
- ######
- ......
- ......
- ......
- ......
- ......
- #.....
- #.....
- #.....
- #.....
- #.....
- #.....
- .###..
- ##....
- .#....
- ......
- ......
- ......
- .#....
- ###...
- #.....
- #.....
- ......
- ......
- .#....
- ###...
- ..#...
- ..#...
- ......
- ......
- ..#...
- ..#...
- ###...
- .#....
- ......
- ......
- ###...
- ..##..
- ..#...
- ......
- ......
- ......
- .#....
- ##....
- .###..
- ......
- ......
- ......
- ..#...
- ..##..
- ###...
- ......
- ......
- ......
- #.....
- #.....
- ###...
- .#....
- ......
- ......
- #.#...
- ###...
- #.....
- ......
- ......
- ......
- #.#...
- ###...
- ..#...
- ......
- ......
- ......
- #.....
- ###...
- #.#...
- ......
- ......
- ......
- ##....
- .#....
- ###...
- ......
- ......
- ......
- ..#...
- ###...
- #.#...
- ......
- ......
- ......
- ###...
- .#....
- ##....
- ......
- ......
- ......
- .##...
- .#....
- ###...
- ......
- ......
- ......
- ###...
- .#....
- .##...
- ......
- ......
- ......
- ###...
- ###...
- ......
- ......
- ......
- ......
- ##....
- ##....
- ##....
- ......
- ......
- ......
- #####.
- ....#.
- ......
- ......
- ......
- ......
- ....#.
- #####.
- ......
- ......
- ......
- ......
- #####.
- #.....
- ......
- ......
- ......
- ......
- ##....
- #.....
- #.....
- #.....
- #.....
- ......
- .#....
- .#....
- .#....
- .#....
- ##....
- ......
- #.....
- #.....
- #.....
- #.....
- ##....
- ......
- ##....
- .#....
- .#....
- .#....
- .#....
- ......
- #.....
- #####.
- ......
- ......
- ......
- ......
- #.....
- #.#...
- ###...
- ......
- ......
- ......
- ###...
- #.....
- ##....
- ......
- ......
- ......
- ###...
- #.#...
- #.....
- ......
- ......
- ......
- ###...
- ..#...
- .##...
- ......
- ......
- ......
- ##....
- #.....
- ###...
- ......
- ......
- ......
- ###...
- #.#...
- ..#...
- ......
- ......
- ......
- ..#...
- #.#...
- ###...
- ......
- ......
- ......
- .##...
- ..#...
- ###...
- ......
- ......
- ......
- ###...
- .###..
- ......
- ......
- ......
- ......
- .#....
- ##....
- ##....
- #.....
- ......
- ......
- #.....
- ##....
- ##....
- .#....
- ......
- ......
- .###..
- ###...
- ......
- ......
- ......
- ......
- ##....
- .##...
- ..#...
- ..#...
- ......
- ......
- ###...
- ..##..
- ...#..
- ......
- ......
- ......
- ..#...
- ..#...
- .##...
- ##....
- ......
- ......
- .##...
- ##....
- #.....
- #.....
- ......
- ......
- .###..
- ##....
- #.....
- ......
- ......
- ......
- #.....
- ##....
- .###..
- ......
- ......
- ......
- #.....
- #.....
- ##....
- .##...
- ......
- ......
- ...#..
- ..##..
- ###...
- ......
- ......
- ......
- .##...
- ####..
- ......
- ......
- ......
- ......
- #.....
- ##....
- ##....
- #.....
- ......
- ......
- .#....
- ##....
- ##....
- .#....
- ......
- ......
- ####..
- .##...
- ......
- ......
- ......
- ......
- ##....
- .#....
- ##....
- #.....
- ......
- ......
- ##....
- #.....
- ##....
- .#....
- ......
- ......
- ##.#..
- .###..
- ......
- ......
- ......
- ......
- .###..
- ##.#..
- ......
- ......
- ......
- ......
- #.##..
- ###...
- ......
- ......
- ......
- ......
- .#....
- ##....
- #.....
- ##....
- ......
- ......
- ###...
- #.##..
- ......
- ......
- ......
- ......
- #.....
- ##....
- .#....
- ##....
- ......
- ......
- .#....
- ##....
- .#....
- .#....
- .#....
- ......
- ...#..
- #####.
- ......
- ......
- ......
- ......
- #.....
- #.....
- #.....
- ##....
- #.....
- ......
- .#....
- #####.
- ......
- ......
- ......
- ......
- .#....
- .#....
- .#....
- ##....
- .#....
- ......
- #####.
- ...#..
- ......
- ......
- ......
- ......
- #.....
- ##....
- #.....
- #.....
- #.....
- ......
- #####.
- .#....
- ......
- ......
- ......
- ......
- #..#..
- ####..
- ......
- ......
- ......
- ......
- ##....
- .#....
- .#....
- ##....
- ......
- ......
- ####..
- #..#..
- ......
- ......
- ......
- ......
- ##....
- #.....
- #.....
- ##....
- ......
- ......"""
- pattern="".join(hex(hash(x))[-3:] for x in nets.split("\n\n"))
- f=lambda s:hex(hash(s))[-3:]in pattern
- for net in nets.split("\n\n"):
- if not f(net):
- exit()
- for not_net in not_nets.split("\n\n"):
- if f(not_net):
- exit()
- import os
- print(os.environ['PYTHONHASHSEED'])
- ```
- I then ran this with ascending values for the environment variable using Bash:
- ```bash
- for ((i=0;i<1000;i++));do PYTHONHASHSEED=$i python a.py;done
- ```
- The smallest working value this found was 764.
- ### Testing
- Testing this online is difficult because it only works with the environment variable set.
- Locally, you can save the `a.py` file and then run it with:
- ```bash
- PYTHONHASHSEED=764 python a.py
- ```
- If this outputs `764` then all of the test cases have passed. If any fail it will output nothing.
#1: Initial revision
## Python 3, 193+18=211 bytes This doesn't work with Python's default settings, because for security reasons `hash` gives different results for the same input on different runs. It needs 18 extra bytes to define an environment variable to make Python give consistent output, to allow hardcoding the long string: ```bash PYTHONHASHSEED=764 ``` The code is then a lambda (anonymous) function which converts the input string to the last 3 characters of the hexadecimal form of its hash, and then checks if this is present in the concatenation of 3 character strings for all of the nets (which is stored as base 36 and converted to hex for the check). ```python lambda s:hex(hash(s))[-3:]in hex(int("5h9fh4xkwqqqgfqz410wog4mjsotxldb6dyfalqrcukexb2b8dni5xoyy19urmbgn8pgfjkqk42clxpgmbtlods6i25sbbw5lxn8fij4zpi0wpp7kzvylxeogi2i0wmg83pxjm57dm0igt4j5b057",36)) ``` I initially tried with the environment variable set to 1, and this required the last 4 characters of the hex hash in order to avoid getting false positives for the non-net hexominoes. I wondered if changing the seed might give a collection of hashes where just the last 3 characters would be sufficient to avoid false positives. To find out, I wrote the following Python file to give no output unless all test cases pass, in which case it would output the value of the environment variable: ### `a.py` ```python nets="""#..... ####.. #..... ...... ...... ...... .#.... .#.... .#.... ###... ...... ...... ...#.. ####.. ...#.. ...... ...... ...... ###... .#.... .#.... .#.... ...... ...... .##... .#.... .#.... ##.... ...... ...... ...#.. ####.. #..... ...... ...... ...... ##.... .#.... .#.... .##... ...... ...... #..... ####.. ...#.. ...... ...... ...... ##.... .###.. .#.... ...... ...... ...... #..... ###... .#.... .#.... ...... ...... ..#... ###... .#.... .#.... ...... ...... .#.... .###.. ##.... ...... ...... ...... .#.... .#.... ###... #..... ...... ...... ..##.. ###... ..#... ...... ...... ...... .#.... .#.... ###... ..#... ...... ...... ..#... ###... ..##.. ...... ...... ...... ##.... .##... ..##.. ...... ...... ...... #..... ##.... .##... ..#... ...... ...... ..##.. .##... ##.... ...... ...... ...... ..#... .##... ##.... #..... ...... ...... ###... ..###. ...... ...... ...... ...... ..###. ###... ...... ...... ...... ...... #..... #..... ##.... .#.... .#.... ...... .#.... .#.... ##.... #..... #..... ...... .#.... ###... .#.... .#.... ...... ...... .#.... .#.... ###... .#.... ...... ...... ..#... ####.. ..#... ...... ...... ...... .#.... ####.. .#.... ...... ...... ...... .#.... ###... ..##.. ...... ...... ...... ..#... .##... ##.... .#.... ...... ...... ##.... .###.. ..#... ...... ...... ...... .#.... .##... ##.... #..... ...... ...... #..... ##.... .##... .#.... ...... ...... ..##.. ###... .#.... ...... ...... ...... ..#... .###.. ##.... ...... ...... ...... .#.... ##.... .##... ..#... ...... ...... #..... ##.... .#.... .##... ...... ...... ..##.. ###... #..... ...... ...... ...... ##.... .#.... .##... ..#... ...... ...... .##... .#.... ##.... #..... ...... ...... ##.... .###.. ...#.. ...... ...... ...... #..... ###... ..##.. ...... ...... ...... ..#... .##... .#.... ##.... ...... ...... ...#.. .###.. ##.... ...... ...... ...... ...#.. ####.. ..#... ...... ...... ...... .##... ##.... .#.... .#.... ...... ...... ##.... .##... .#.... .#.... ...... ...... .#.... ####.. #..... ...... ...... ...... #..... ####.. .#.... ...... ...... ...... .#.... .#.... ##.... .##... ...... ...... .#.... .#.... .##... ##.... ...... ...... ..#... ####.. ...#.. ...... ...... ...... .#.... .##... ##.... .#.... ...... ...... .#.... ####.. ..#... ...... ...... ...... ..#... ####.. .#.... ...... ...... ...... .#.... ##.... .##... .#.... ...... ...... .#.... .##... .#.... ##.... ...... ...... .#.... ##.... .#.... .##... ...... ...... .##... .#.... ##.... .#.... ...... ...... ##.... .#.... .##... .#.... ...... ...... #..... ####.. ..#... ...... ...... ...... ..#... ####.. #..... ...... ...... ...... ...#.. ####.. .#.... ...... ...... ...... .#.... ####.. ...#.. ...... ...... ......""" not_nets="""..#... #####. ...... ...... ...... ...... #####. ..#... ...... ...... ...... ...... .#.... .#.... ##.... .#.... .#.... ...... #..... #..... ##.... #..... #..... ...... .##... ###... .#.... ...... ...... ...... ##.... ###... .#.... ...... ...... ...... .#.... ###... ##.... ...... ...... ...... .#.... ###... .##... ...... ...... ...... ##.... .####. ...... ...... ...... ...... ####.. ...##. ...... ...... ...... ...... #..... ##.... .#.... .#.... .#.... ...... ...##. ####.. ...... ...... ...... ...... .#.... .#.... .#.... ##.... #..... ...... #..... #..... #..... ##.... .#.... ...... .#.... ##.... #..... #..... #..... ...... .####. ##.... ...... ...... ...... ...... .#.... ##.... ###... ...... ...... ...... #..... ###... ##.... ...... ...... ...... ###... ##.... .#.... ...... ...... ...... ##.... ###... #..... ...... ...... ...... ###... .##... .#.... ...... ...... ...... .##... ###... ..#... ...... ...... ...... ..#... ###... .##... ...... ...... ...... .#.... .##... ###... ...... ...... ...... ###... ..#... ..##.. ...... ...... ...... ..#... ..#... ###... #..... ...... ...... ..#... ###... #..... #..... ...... ...... #..... ###... ..#... ..#... ...... ...... .###.. .#.... ##.... ...... ...... ...... #..... #..... ###... ..#... ...... ...... ..##.. ..#... ###... ...... ...... ...... ##.... .#.... .###.. ...... ...... ...... ####.. ##.... ...... ...... ...... ...... .#.... .#.... ##.... ##.... ...... ...... ..##.. ####.. ...... ...... ...... ...... #..... #..... ##.... ##.... ...... ...... ##.... ##.... .#.... .#.... ...... ...... ##.... ####.. ...... ...... ...... ...... ##.... ##.... #..... #..... ...... ...... ####.. ..##.. ...... ...... ...... ...... ####.. .#.... .#.... ...... ...... ...... ..#... ..#... ####.. ...... ...... ...... ..#... ..#... ###... ..#... ...... ...... #..... #..... ###... #..... ...... ...... #..... ###... #..... #..... ...... ...... ####.. ..#... ..#... ...... ...... ...... .#.... .#.... ####.. ...... ...... ...... ..#... ###... ..#... ..#... ...... ...... ####.. #.#... ...... ...... ...... ...... .#.... ##.... .#.... ##.... ...... ...... #.#... ####.. ...... ...... ...... ...... #..... ##.... #..... ##.... ...... ...... ##.... .#.... ##.... .#.... ...... ...... .#.#.. ####.. ...... ...... ...... ...... ####.. .#.#.. ...... ...... ...... ...... ##.... #..... ##.... #..... ...... ...... ...#.. ...#.. ####.. ...... ...... ...... ####.. ...#.. ...#.. ...... ...... ...... ..#... ..#... ..#... ###... ...... ...... ###... ..#... ..#... ..#... ...... ...... ###... #..... #..... #..... ...... ...... #..... #..... #..... ###... ...... ...... #..... #..... ####.. ...... ...... ...... ####.. #..... #..... ...... ...... ...... .##... ##.... .##... ...... ...... ...... #.#... ###... .#.... ...... ...... ...... ##.... .##... ##.... ...... ...... ...... .#.... ###... #.#... ...... ...... ...... ##.... ##.... .##... ...... ...... ...... #..... ###... .##... ...... ...... ...... ..#... ###... ##.... ...... ...... ...... .##... ###... #..... ...... ...... ...... .##... ##.... ##.... ...... ...... ...... ##.... .##... .##... ...... ...... ...... ##.... ###... ..#... ...... ...... ...... .##... .##... ##.... ...... ...... ...... #..... ##.... ###... ...... ...... ...... ..#... .##... ###... ...... ...... ...... ###... .##... ..#... ...... ...... ...... ###... ##.... #..... ...... ...... ...... ###### ...... ...... ...... ...... ...... #..... #..... #..... #..... #..... #..... .###.. ##.... .#.... ...... ...... ...... .#.... ###... #..... #..... ...... ...... .#.... ###... ..#... ..#... ...... ...... ..#... ..#... ###... .#.... ...... ...... ###... ..##.. ..#... ...... ...... ...... .#.... ##.... .###.. ...... ...... ...... ..#... ..##.. ###... ...... ...... ...... #..... #..... ###... .#.... ...... ...... #.#... ###... #..... ...... ...... ...... #.#... ###... ..#... ...... ...... ...... #..... ###... #.#... ...... ...... ...... ##.... .#.... ###... ...... ...... ...... ..#... ###... #.#... ...... ...... ...... ###... .#.... ##.... ...... ...... ...... .##... .#.... ###... ...... ...... ...... ###... .#.... .##... ...... ...... ...... ###... ###... ...... ...... ...... ...... ##.... ##.... ##.... ...... ...... ...... #####. ....#. ...... ...... ...... ...... ....#. #####. ...... ...... ...... ...... #####. #..... ...... ...... ...... ...... ##.... #..... #..... #..... #..... ...... .#.... .#.... .#.... .#.... ##.... ...... #..... #..... #..... #..... ##.... ...... ##.... .#.... .#.... .#.... .#.... ...... #..... #####. ...... ...... ...... ...... #..... #.#... ###... ...... ...... ...... ###... #..... ##.... ...... ...... ...... ###... #.#... #..... ...... ...... ...... ###... ..#... .##... ...... ...... ...... ##.... #..... ###... ...... ...... ...... ###... #.#... ..#... ...... ...... ...... ..#... #.#... ###... ...... ...... ...... .##... ..#... ###... ...... ...... ...... ###... .###.. ...... ...... ...... ...... .#.... ##.... ##.... #..... ...... ...... #..... ##.... ##.... .#.... ...... ...... .###.. ###... ...... ...... ...... ...... ##.... .##... ..#... ..#... ...... ...... ###... ..##.. ...#.. ...... ...... ...... ..#... ..#... .##... ##.... ...... ...... .##... ##.... #..... #..... ...... ...... .###.. ##.... #..... ...... ...... ...... #..... ##.... .###.. ...... ...... ...... #..... #..... ##.... .##... ...... ...... ...#.. ..##.. ###... ...... ...... ...... .##... ####.. ...... ...... ...... ...... #..... ##.... ##.... #..... ...... ...... .#.... ##.... ##.... .#.... ...... ...... ####.. .##... ...... ...... ...... ...... ##.... .#.... ##.... #..... ...... ...... ##.... #..... ##.... .#.... ...... ...... ##.#.. .###.. ...... ...... ...... ...... .###.. ##.#.. ...... ...... ...... ...... #.##.. ###... ...... ...... ...... ...... .#.... ##.... #..... ##.... ...... ...... ###... #.##.. ...... ...... ...... ...... #..... ##.... .#.... ##.... ...... ...... .#.... ##.... .#.... .#.... .#.... ...... ...#.. #####. ...... ...... ...... ...... #..... #..... #..... ##.... #..... ...... .#.... #####. ...... ...... ...... ...... .#.... .#.... .#.... ##.... .#.... ...... #####. ...#.. ...... ...... ...... ...... #..... ##.... #..... #..... #..... ...... #####. .#.... ...... ...... ...... ...... #..#.. ####.. ...... ...... ...... ...... ##.... .#.... .#.... ##.... ...... ...... ####.. #..#.. ...... ...... ...... ...... ##.... #..... #..... ##.... ...... ......""" pattern="".join(hex(hash(x))[-3:] for x in nets.split("\n\n")) f=lambda s:hex(hash(s))[-3:]in pattern for net in nets.split("\n\n"): if not f(net): exit() for not_net in not_nets.split("\n\n"): if f(not_net): exit() import os print(os.environ['PYTHONHASHSEED']) ``` I then ran this with ascending values for the environment variable using Bash: ```bash for ((i=0;i<1000;i++));do PYTHONHASHSEED=$i python a.py;done ``` The smallest working value this found was 764. ### Testing Testing this online is difficult because it only works with the environment variable set. Locally, you can save the `a.py` file and then run it with: ```bash PYTHONHASHSEED=764 python a.py ``` If this outputs `764` then all of the test cases have passed. If any fail it will output nothing.