Skip to content

Instantly share code, notes, and snippets.

View MarshalX's full-sized avatar
🦁

Ilya Siamionau MarshalX

🦁
View GitHub Profile
@MarshalX
MarshalX / quickSort.py
Created October 13, 2019 11:36
Quick Sort on Python
# coding=utf-8
import random
n = 10
A = [random.randint(0, 10) for i in range(0, n)]
def partition(array, start, end):
pivot = array[(start + end) // 2]
@MarshalX
MarshalX / mergeSort.py
Last active October 13, 2019 11:27
Merge Sort on Python
import random
def merge_sort(a):
n = len(a)
if n < 2:
return a
l = merge_sort(a[:n//2])
r = merge_sort(a[n//2:n])
@MarshalX
MarshalX / StatusPing.py
Last active May 6, 2024 19:14
Fix of https://gist.github.com/ewized/97814f57ac85af7128bf. Python3 class to ping a Minecraft server and get its response including ping in ms
#!/usr/bin/python3
import socket
import struct
import json
import time
class StatusPing:
""" Get the ping status for the Minecraft server """