This file contains 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
/* So how does this work? | |
I'm using ANSI escape sequences to control the behavior of the terminal while | |
cat is outputting the text. I deliberately place these control sequences inside | |
comments so the C++ compiler doesn't try to treat them as code.*/ | |
//[2K[2D[A[2K[A[2K[A[2K[A[2K[A | |
/*The commands in the fake code comment move the cursor to the left edge and | |
clear out the line, allowing the fake code to take the place of the real code. | |
And this explanation uses similar commands to wipe itself out too. */ | |
//[2K[2D[A[2K[A[2K[A[2K[A | |
#include <cstdio> |
This file contains 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 <random> | |
/* This implements the pseudo-code from http://graphics.pixar.com/library/ProgressiveMultiJitteredSampling/ | |
*/ | |
/* replace with your desired random number generator */ | |
static std::random_device rd; | |
static std::mt19937 rng(rd()); | |
static std::uniform_real_distribution<> dis(0, 1); |
This file contains 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
#ifndef ___KOS_UTILITY_INTEGER_SEQUENCE__82DDD139689B8D73C15C6165472A8E14_HPP__ | |
#define ___KOS_UTILITY_INTEGER_SEQUENCE__82DDD139689B8D73C15C6165472A8E14_HPP__ | |
#include <type_traits> | |
#include <kos/namespaces.hpp> | |
KOS_BEGIN_HEADER | |
KOS_BEGIN_NAMESPACE | |
// A C++11 implementation of std::integer_sequence from C++14 | |
template <typename T, T... N> |