Skip to content

Instantly share code, notes, and snippets.

View CtrlAltCuteness's full-sized avatar

Katie Heart CtrlAltCuteness

View GitHub Profile
@CtrlAltCuteness
CtrlAltCuteness / linked_liat.py
Created June 26, 2020 22:43
Sample 1-way LinkedList in Python as well as a way to make a copy that is reversed
#!/data/data/com.termux/files/usr/bin/python3
# vim: fileencoding=utf8:filetype=python:syntax=python:nu:ts=2:shiftwidth=2:softtabstop=2:expandtab
# linked_list.py sample program and reversal strategy w/ custom class
# Copyright (C) 2020 ~Katie Heart
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
import os
from pickle import unpack
class PyNBT:
root = []
TAG_END = 0
TAG_BYTE = 1
TAG_SHORT = 2
TAG_INT = 3
TAG_LONG = 4
#!/data/data/com.termux/files/usr/bin/python3
# vim: fileencoding=utf8:filetype=python:nu:ts=2:shiftwidth=2:softtabstop=2:expandtab
__all__ = []
from sys import argv
from time import monotonic, sleep
from math import floor, ceil
from re import compile as compile_, sub
@CtrlAltCuteness
CtrlAltCuteness / rps.py
Last active March 30, 2023 18:08
A stupidly intelligent-ish Rock Paper Scissors program
#!/usr/bin/python3
# vim: fileencoding=utf8:filetype=python:nu:expandtab
# Updated for 3.10 / 3.11
__all__ = ['getUserChocie', 'playForever']
from typing import Any, Literal, Optional
from collections.abc import Callable, Iterable