Skip to content

Instantly share code, notes, and snippets.

View c272's full-sized avatar

C272 c272

  • Tokyo, Japan
  • 11:49 (UTC +09:00)
View GitHub Profile
@c272
c272 / loadpng.cpp
Created June 28, 2018 09:54
Loading .PNG in SDL2 in 78 lines.
//Including SDL and standard headers.
//Note that you'll have to include all the libraries and include paths,
//and on Windows include a copy of SDL.dll and SDL_image.dll in the application directory.
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <string>
//Predefining functions/variables.
SDL_Surface* loadPNGSurface(std::string);
@c272
c272 / badsort.py
Created May 9, 2018 19:49
The worst sorting algorithm the world has ever seen.
# The shittiest sorting algorithm on planet earth.
# @Poltroon @C272
from random import shuffle
arr = [0,12,99,13,17,19,6]
#Searching.
done = "false"
pnum = 0
while (done=="false"):
@c272
c272 / quad.py
Last active May 8, 2018 08:35
Quadratic Formula in Python 3
#Quadratic formula import, Python 3.6
#C272, 2018
from math import *
def solveQuad(a,b,c):
a = float(a)
b = float(b)
c = float(c)
rootb = sqrt(b)
int i = 3;
if (i<001) {
console.log("My fifth gist.");
} else {
console.log("My first gist.");
}