Skip to content

Instantly share code, notes, and snippets.

0:qstate(rand)
1:qstate(bell)
2:superposition(Q0, Q1)
3:cnot(Q2, 1, 2)
4:hadamard(Q3, 1)
5:partialmeasure(Q4, 1, 2)
6:choose1(Q5, B5, identity(), not(1), pauliz(1), not(1) |> pauliz(1))
a + b * (d + e) * f
add(a, multiply(b, multiply(add(d, e), f)))
// Code which is run at the top most level, or the render method
//'lightsource' interchangable with 'point in which the rays come out of'
float jitter = 0.02f;
//Arraylist for multiple 'lightsources'; The 360/45 is so I can have 8 lightsources in a circle around the center lightsource
ArrayList<ArrayList<Vec2f>> raycasts = new ArrayList<>(360/45 + 1);
//Arraylist of the points for all the lightsources
ArrayList<Vec2f> castPoints = new ArrayList<>();
//Loop to make the 8 surrounding lightsources
for(int i = 0; i < 8; ++i){
@zsparal
zsparal / preprocessor_fun.h
Last active August 29, 2015 14:27 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,