Skip to content

Instantly share code, notes, and snippets.

View pr0crustes's full-sized avatar

pr0crustes pr0crustes

View GitHub Profile
@pr0crustes
pr0crustes / Principal.py
Created December 23, 2017 21:05
Unnecessary Complex Snake Game
import pygame
from pygame.locals import *
#Colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
import numpy as np
from random import randrange
from PIL import Image
if __name__ == '__main__':
square_size = 50
@pr0crustes
pr0crustes / SwitchCharPointer.cpp
Created August 4, 2018 14:51
Made only to help :)
#include <iostream>
// THIS HASH FUNCTION IS A ADAPTATION FROM https://stackoverflow.com/questions/8317508/hash-function-for-a-string
// constexpr is C++11
constexpr unsigned hash_str(const char* s) {
unsigned h = 37;
while (*s) {
h = (h * 54059) ^ (s[0] * 76963);
s++;
}