.
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
#!/usr/bin/env python3 | |
""" | |
Parses Swedish ordinals from right to left and | |
determines if they are grammatically correct. | |
It kind of works! :P | |
Stephanie Björk (Katt) <katt16777216@gmail.com> <3 | |
""" |
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
#!/usr/bin/env python3 | |
""" | |
A module-less python code that prints a line if it matches a certain regular | |
expression. | |
""" | |
# Our regular expression collections. These regular expressions have been | |
# hand-compiled into their finite state machine representations. | |
regex = { | |
r'[abc]+': ( |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Cryptanalysis for any shifts of the Caesar ciphers in English. | |
Stephanie Björk (Katt) <katt16777216@gmail.com> | |
""" | |
import re | |
def freq(s: str) -> dict: |
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
#!/usr/bin/env python3 | |
""" | |
pythagorean.py Generate Pythagorean triples | |
Other people: sqrt(a**2 + b**2) == c | |
Me, an I N T E L L E C T U A L: abs(complex(a, b)) == c | |
""" | |
from math import sqrt, floor | |
def triples(n: int) -> list: |
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
#!/usr/bin/env python3 | |
def pn(tokens: (list, tuple)) -> (int, float): | |
"""Parses a Polish Notation expression using a different algorithm.""" | |
operators = [] | |
operands = [] | |
pendingop = None | |
for token in tokens: |
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
#!/usr/bin/env python3 | |
# -*- coding: utf8 -*- | |
""" | |
pracpass Password practice | |
Old woman yells at cloud | |
------------------------ | |
The following paragraph explains why we need *Password practice*. | |
See, my memory is super horrible and my passwords aren't even that long. |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
pn.py Interactive Polish Notation calculator | |
So, I’ve realized that while there were many Reverse Polish cal‐ | |
culators, there were not very many Polish Notation calculators. | |
That’s probably because Reverse Polish calculators are a bit eas‐ | |
ier and more useful to make in the domains of computer science. | |
In the spirit of making weird fancy calculators, here goes a Pol‐ |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
calc.py Simple calculator in Python. | |
S. Björk (Katt) <katt16777216@gmail.com> | |
""" | |
def rpn(tokens: (list, tuple)) -> (int, float): | |
"""Evaluates a reverse-polish notation expression given as a list of tokens. |
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
.ig | |
friends.tmac I have no friends. | |
Stephanie B. (Katt) <katt16777216@gmail.com> | |
You are freely allowed to do whatever you want with this macro package and | |
the code in it, as long as you don't have friends. | |
Copyright \(co \n[year] a desolate gurl, no friends in reserves. | |
.. |
NewerOlder