Skip to content

Instantly share code, notes, and snippets.

@nddrylliog
nddrylliog / sdl-ooc-portable-howto.md
Created November 15, 2012 02:03
Notes on getting SDL ooc stuff to compile on all three platforms

What is this?

These are notes on how to get ooc-sdl samples to compile & run on all three platforms.

Linux

Smooth sailing. You can bootstrap rock easily, just clone the git repository then run make rescue:

cd ~/Dev/
@nddrylliog
nddrylliog / pa-sine.c
Created November 14, 2012 19:55
Generating two sines using PortAudio
#include "portaudio.h"
#include <stdio.h>
#include <stdlib.h>
typedef int PaStreamCallback( const void *input,
void *output,
unsigned long frameCount,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData ) ;
@nddrylliog
nddrylliog / gpo-000.md
Created November 13, 2012 21:31
Game Programming in ooc

Game Programming in ooc

Getting started

The first thing you need to know about ooc is that it compiles down to C. Sure, in theory you could compile it to JavaScript or whatever, but it was really designed to spit out C under the hood.

Why bother then?

Couldn't we just write code like this?

- Why 440Hz matter / How frequencies work
- The logic behind Quines
- Recording at home: a primer
- Stack-based programming languages
- Proxies and reverse proxies
- Building compilers
- How to blog often: a few tips
- Vision: a collaborative recording solution
- The principle of abstraction
- Universality vs configuration
@nddrylliog
nddrylliog / quine.ooc
Created October 8, 2012 16:52
An ooc quine
q := 34 as Char
l := [
"q := 34 as Char"
"l := ["
"]"
"for (i in 0..2) {"
" l[i] println()"
"}"
"for (i in 0..12) {"
" q print(); l[i] print(); q println()"
- Why are exact match queries faster in the Netherlands?
- Because hash is legal.
#include <./list.h>
#include <sdk/lang/Exception.h>
#include <sdk/lang/BufferIterator.h>
#include <sdk/lang/System.h>
#include <sdk/lang/Character.h>
#include <sdk/lang/VarArgs.h>
#include <sdk/lang/string.h>
#include <sdk/lang/Iterators.h>
#include <sdk/lang/Memory.h>
#include <sdk/lang/Buffer.h>
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
30.61 0.86 0.86 133935 0.00 0.00 physics_boxBoxCH__boxBoxCH
7.12 1.06 0.20 GC_mark_from
4.98 1.20 0.14 7655320 0.00 0.00 lang_Buffer__Buffer_get
4.80 1.34 0.14 7655320 0.00 0.00 lang_Buffer__Buffer_get_impl
3.91 1.45 0.11 4 0.03 0.03 gfx_Texture__flipSurface
======= Bad positions: Unpositioned tree [318]
== Unpositioned tree [318] of type This at [NoPosition]
immutable.this
=== While validating
package <empty> {
final object List123Sample extends java.lang.Object with ScalaObject {
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Send a pull request to &lt;span class=&quot;user&quot;&gt;officialfm&lt;/span&gt;:master from &lt;span class=&quot;user&quot;&gt;nddrylliog&lt;/span&gt;:master · nddrylliog/valid8ors</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />