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 <cstdio> | |
#define abs(a) ((a < 0) ? -(a) : (a)) | |
template <class T> | |
void print(T a) | |
{ | |
if(a == 0) | |
putchar_unlocked('0'); | |
if(a < 0) |
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
#!/bin/bash | |
DIR="tests" | |
PRG="./app" | |
DIFPRG=diff | |
# Colordiff jeśli jest, inaczej diff | |
if hash colordiff 2>/dev/null; then | |
DIFPRG=colordiff | |
fi |
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 <iostream> | |
#include <cmath> | |
// RGB color struct | |
struct Color { int r, g, b; }; | |
// Round float to int | |
int round(float f) { return (f - (int)f >= 0.5) ? (f + 1) : f; } | |
// Returns an RGB color from an HSV one |
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
// @Makefile | |
// all: | |
// mkdir -p sprites | |
// g++ -std=c++11 lodepng/lodepng.cpp sprites.cpp -Wall -pedantic -O3 -o squad | |
// | |
// The lib can be found at https://github.com/lvandeve/lodepng | |
// The output will be stored in ./sprites/ as *.png files | |
// sprites.cpp - sorbet, https://github.com/Sorebit | |
#include "lodepng/lodepng.h" | |
#include <iostream> |
NewerOlder