Inspired by http://madebyevan.com/obscure-cpp-features/. Compile and run using g++
or clang++
.
$ g++ -std=c++11 -Wall -pedantic -Wextra wat.cpp
$ ./a.out
hello! I'm called ./a.out and 5 + 3 is 8
;; 99 bottles of beer on the wall | |
;; warning: alcohol destroys brain cells! (not as much as brainfuck) | |
;; written by Keymaker | |
++++[>+++++<-]>+++ | |
[ | |
[>+>+<<-] | |
>++++++[<+>-]+++++++++[<++++++++++>-] | |
>[<+>-]<- |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<body> | |
<style type="text/css"> | |
.special:after { | |
content: ""; | |
display: block; | |
width: 100px; | |
height: 0px; | |
} |
<html> | |
<body> | |
<style> | |
.scrollable { | |
height: 100%; | |
overflow: auto; | |
} | |
html, body { | |
min-height: 100%; | |
margin: 0px; |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<!-- kate: indent-width 1 --> | |
<!-- | |
State: | |
<!DOCTYPE html> | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
- FF, Webkit, Opera: OK | |
- IE8, IE9: takes height: 100% as 100% viewport height, thus enabling | |
unnecessary scrollbar. | |
(no doctype) |
#include "Bourne.h" | |
#define forever for(;;) | |
using namespace std; | |
namespace Bourne { | |
void AbstractValue::ignorespace(istream& in) { | |
while(isspace(in.peek())) |
#ifndef BigFoot_Big_h | |
#define BigFoot_Big_h | |
#include <string> | |
#include <algorithm> | |
#include "TypeTraits.h" | |
#include "BigPrivate.h" | |
/** @brief BigFoot, aribitrary length integer library */ |
queue<unsigned int> cache; | |
unordered_set<unsigned int> map; | |
size_t misses = 0; | |
size_t maxSize = 24; | |
for(unsigned int index: builder.indices()) { | |
if(map.find(index) != map.end()) continue; | |
/* Not in cache */ | |
++misses; |
#version 330 | |
uniform mat4 transformationMatrix; | |
uniform mat4 projectionMatrix; | |
out vec2 texCoord; | |
const vec2 data[4] = vec2[]( | |
vec2(-1.0, 1.0), | |
vec2(-1.0, -1.0), |
void RigidBodyGroup::physicsStep(GLfloat timeDelta) { | |
for(RigidBody* body: bodies) { | |
/* Compute force at current position */ | |
body->force = _gravity; | |
body->physicsStep(); | |
GLfloat accelerationHalfTimeDelta = (body->force/(body->_mass*2))*timeDelta; | |
/* New position */ | |
body->transformation()[3].setXyz(body->transformation()[3].xyz() + (body->velocity + accelerationHalfTimeDelta)*timeDelta); |
Inspired by http://madebyevan.com/obscure-cpp-features/. Compile and run using g++
or clang++
.
$ g++ -std=c++11 -Wall -pedantic -Wextra wat.cpp
$ ./a.out
hello! I'm called ./a.out and 5 + 3 is 8