Skip to content

Instantly share code, notes, and snippets.

View yoniLavi's full-sized avatar
:octocat:
Figuring things out

Yoni Lavi yoniLavi

:octocat:
Figuring things out
View GitHub Profile
"""Hyperoperations implementation (https://en.wikipedia.org/wiki/Hyperoperation)"""
from functools import reduce
zeration = lambda a, b: b+1
addition = lambda a, b: reduce(lambda x, _: zeration(0, x), [None]*b, a)
multiplication = lambda a, b: reduce(lambda x, _: addition(a, x), [None]*b, 0)
exponentiation = lambda a, b: reduce(lambda x, _: multiplication(a, x), [None]*b, 1)
tetration = lambda a, b: reduce(lambda x, _: exponentiation(a, x), [None]*b, 1)
pentation = lambda a, b: reduce(lambda x, _: tetration(a, x), [None]*b, 1)
@ccharles
ccharles / stack-overflow.md
Last active May 21, 2025 19:50
Common Stack Overflow comments

Please read [Why should I not upload images of code/data/errors?](https://meta.stackoverflow.com/q/285551/354577) You can [edit] your question and replace the images with [code block]s. The easiest way to do this is to paste the code as text directly into your question, then select it and click the code block button.

Welcome to Stack Overflow. Please take the [tour] and read [our policy forbidding AI-generated content](https://stackoverflow.com/help/gen-ai-policy)

USER, [please don't translate posts for other users](https://meta.stackoverflow.com/a/297680/354577): _"**Non-English questions should not be translated into English** by anyone other than the original poster (OP). Translating a question for a non-English speaker sets them and all participants up for a poor experience, due to the OP not being able to follow and respond to feedback from comments, understand answers, or get assistance from the Help Center."_ I'm rolling this back.

``Please read [Why should I not upload images of code/da

#!/usr/bin/python
#
# Usage:
#
# $ ./conception.py 1969-12-25
# searching for most recent event before 1969-04-03
# <li><a href="/wiki/April_1" title="April 1">April 1</a>
# &#226;&#8364;&#8220; The <a href="/wiki/Hawker_Siddeley_Harrier" title="Hawker Siddeley Harrier">Hawker Siddeley Harrier</a> enters
# service with the <a href="/wiki/Royal_Air_Force" title="Royal Air Force">Royal Air Force</a>.</li>
#