Skip to main content

A collection of joke sorting algorithms implemented in C++ for Python.

Project description

kusosort

A collection of joke sorting algorithms implemented in C++ for Python. For educational and entertainment purposes only.

Installation

pip install kusosort

Usage

import kusosort
import random

# スターリンソート
unsorted_list = [1, 5, 2, 6, 3, 4, 0]
sorted_list = kusosort.stalin(unsorted_list)
print(f"Original: {unsorted_list}")
# Original: [1, 5, 2, 6, 3, 4, 0]
print(f"Stalin sorted: {sorted_list}")
# Stalin sorted: [1, 5, 6]

# ミラクルソート
data = [3, 1, 2]

def my_prayer():
    print("神よ...")

kusosort.miracle(data, max_attempts=3, prey=my_prayer)
# 神よ...
# 神よ...
# 神よ...
# 奇跡は起きず、ソートできませんでした

# ボゴソート (注意: 終わらない可能性があります)
# data = random.sample(range(10), 10)
# kusosort.bogo_sort(data)
# print(f"Bogo sorted: {data}")

Algorithms

  • bogo(data)
  • bozo(data)
  • stalin(data)
  • miracle(data, max_attempts=10, prey=None)
  • abe_(data)
  • quantum_bogo(data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kusosort-0.1.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kusosort-0.1.2-cp312-cp312-win_amd64.whl (83.0 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file kusosort-0.1.2.tar.gz.

File metadata

  • Download URL: kusosort-0.1.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for kusosort-0.1.2.tar.gz
Algorithm Hash digest
SHA256 974a475210c9082f7c63acf6404628bb9b02961bdbc6170cefa8e9cacb23cba1
MD5 13be4ca275cd59548ae79d17334178b0
BLAKE2b-256 52d2b9e7306a9b838ea0f9b37947ce4c8f8fb48cc7c516fc22536b5d6c7945e6

See more details on using hashes here.

File details

Details for the file kusosort-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: kusosort-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 83.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for kusosort-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 42cd5db70f7f7b59baaed797acfb20ee39cbea413a2fc6af918f02cc20a366ab
MD5 3798bc15a1538bcc9d66c695496af11e
BLAKE2b-256 4410f41bc3fd309119b26c2b6e69f6c3379b0e9cf3a4fafef2d6cd0522626884

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page