This file contains hidden or 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
import math | |
import operator | |
import os | |
import secrets | |
import sys | |
import time | |
players = ('U', 'C', '0') | |
func = (min, max) |
This file contains hidden or 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
from ctypes import c_uint64, c_double | |
o = (c_uint64.from_buffer(c_double(1)).value >> 0x20) - 0xed81 | |
def exp(x: float) -> float: | |
x = int((0x171547 * x) + o) << 0x20 | |
return c_double.from_buffer(c_uint64(x)).value | |
def ln(x: float) -> float: | |
x = c_uint64.from_buffer(c_double(x)).value >> 0x20 |
This file contains hidden or 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
#include <time.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define clear_screen fputs("\x1b[2J\x1b[H", stdout); | |
int | |
main(void) | |
{ | |
const unsigned long long data[] = { |
This file contains hidden or 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
/* | |
* #59 XOR decryption - Project Euler [ https://projecteuler.net/problem=59 ] | |
* the numbers: https://projecteuler.net/project/resources/p059_cipher.txt | |
*/ | |
#include <stdio.h> | |
int isvalid(const char); | |
int |
This file contains hidden or 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
/* | |
* #89 Roman numerals - Project Euler [ https://projecteuler.net/problem=89 ] | |
* | |
* The fastest way to solve this problem is replacing (but we will not replace). | |
* When we look at the numbers in the file, we found many numbers that can be written shorter. | |
* Those numbers are: | |
* . IIII = IV = 4 | |
* . VIIII = IX = 9 | |
* . XXXX = XL = 40 | |
* . LXXXX = XC = 90 |
This file contains hidden or 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
#include <err.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MEMINFO "/proc/meminfo" | |
struct meminfo { |
This file contains hidden or 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
import sys | |
def bin_to_dec(b): | |
number = 0 | |
l = len(b) - 1 | |
for char in b: | |
number += int(char)*(2**l) | |
l -= 1 |
This file contains hidden or 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
/* | |
CUBE (x86-64) | |
Compile: cc -no-pie -nostartfiles cube.s -o cube | |
C code: | |
#include <stdio.h> | |
#include <stdlib.h> | |
long int | |
cube(int x) |
This file contains hidden or 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/python3 | |
import subprocess | |
import random | |
import os | |
cows = [ | |
"ghost", | |
"radio", | |
"pod", | |
"udder", |
This file contains hidden or 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
/* | |
Fibonacci sequence in assembly language (x86) | |
Compile: clang -m32 -no-pie -nostartfiles fib.s -o fib | |
C code: | |
#include <stdio.h> | |
int | |
main(void) |