Skip to content

Instantly share code, notes, and snippets.

View selenologist's full-sized avatar

Luna Langton selenologist

  • New South Wales, Australia
View GitHub Profile
# 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
; 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
@selenologist
selenologist / main.lua
Last active February 11, 2016 11:05
Love2d Tutorial for Luke
-- 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.
{ 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";
$fa = 1;
$fs = 1;
module body_shape(height, diameter){
difference(){
hull(){
translate([0,height-diameter])
circle(d=diameter);
square([diameter, height],
center=true);
require "enet"
network = {
status = "[unloaded]",
last_msg = "[no msg]"
}
function server_init(self)
self.status = "[server]"
/* EVIL */
#include <iostream>
using namespace std;
typedef int Foo;
typedef unsigned int Bar;
class A{
{ 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 {
/* 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];
/*
Minimalist terminal PGM viewer
May have bugs
GPLv3
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <exception>