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
# Draws Pokemon maps, from game data (using files from pret/pokered) | |
import os | |
import stat | |
import struct | |
from PIL import Image, ImageDraw | |
tilePixels = 8 | |
blockTiles = 4 | |
blockSize = blockTiles * blockTiles |
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
; Fills the screen at the end of the snake game demonstrated at https://skilldrick.github.io/easy6502/ | |
; I could have patched the MSB of the STA instruction's address but this works and there's no delay between blocks | |
gameOver: | |
ldx #0 | |
fillLoop1: | |
lda sysRandom | |
sta $0200, x | |
inx | |
bne fillLoop1 ; if Z=0 (inx did not wrap around), then keep filling |
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
-- Documentation on love's modules (which are just tables containing | |
-- other modules, and functions) and the functions within them is | |
-- https://love2d.org/wiki/love here | |
-- love2d calls functions called "callbacks" when certain events | |
-- (like a key being pressed, or the game being ready to draw to the screen, | |
-- etc) occur. These callbacks are normally set to a dummy function that | |
-- doesn't do anything in particular, but you can easily override them with | |
-- your own callbacks as you see below. |
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
{ stdenv, fetchurl, pkgconfig | |
, SDL2, mesa, openal, lua, luajit | |
, libdevil, freetype, physfs, libtheora | |
, libmodplug, mpg123, libvorbis, libogg | |
}: | |
stdenv.mkDerivation rec { | |
name = "love-0.10.0"; | |
src = fetchurl { | |
url = "https://bitbucket.org/rude/love/downloads/${name}-linux-src.tar.gz"; |
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
$fa = 1; | |
$fs = 1; | |
module body_shape(height, diameter){ | |
difference(){ | |
hull(){ | |
translate([0,height-diameter]) | |
circle(d=diameter); | |
square([diameter, height], | |
center=true); |
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
require "enet" | |
network = { | |
status = "[unloaded]", | |
last_msg = "[no msg]" | |
} | |
function server_init(self) | |
self.status = "[server]" |
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
/* EVIL */ | |
#include <iostream> | |
using namespace std; | |
typedef int Foo; | |
typedef unsigned int Bar; | |
class A{ |
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
{ stdenv, scons, pkgconfig, xlibs, alsaLib, fetchzip, xorg, x11 | |
, libpulseaudio, freetype, mesa, mesa_glu, openssl, fetchgit | |
, udev}: | |
let | |
pname = "godot"; | |
version = "2.0.3-stable-with-gdnet"; | |
in | |
stdenv.mkDerivation rec { |
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
/* shoves new samples onto a kernel-sized history buffer */ | |
float convolve(const float input, | |
const float* kernel, const size_t kernel_length, | |
float* history){ | |
int index = kernel_length -1; | |
/* XXX: replace with better data structure without data copying | |
this is really inefficient! It does work though. | |
*/ | |
for(; index > 0; index--){ | |
history[index] = history[index - 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
/* | |
Minimalist terminal PGM viewer | |
May have bugs | |
GPLv3 | |
*/ | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <exception> |
OlderNewer