This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This file contains isEven() alternives. | |
Just kidding, don't actually use these :) | |
(C) 2024 Joe Chau. Released under the MIT License. | |
""" | |
@(e := __import__('typing')).no_type_check | |
@e.final | |
@__import__('functools').cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
hexdump in python | |
`python hexdump.py -h` to see usage | |
""" | |
from typing import * | |
CONTROL_CHARACTERS_REPRESENTATION_IN_CONTROL_PICTURE: Final[dict[int, str]] = { | |
0: '\N{Symbol For Null}', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sudoku generator | |
Algorithm shamelessly borrowed from https://stackoverflow.com/a/56581709/16747758 (By Alain T., released under CC-BY-SA 4.0) | |
""" | |
from itertools import product, batched, chain | |
from typing import * | |
from random import sample | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import * | |
from operator import eq | |
def find_in_nd_array(array: Iterable, | |
value: Any, | |
function: Callable[[Any, Any], bool] = eq, | |
__prefix_indexes: tuple[int, ...] = tuple() | |
) -> tuple[int, ...]: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aahed | |
aalii | |
aapas | |
aargh | |
aarti | |
abaca | |
abaci | |
aback | |
abacs | |
abaft |