Skip to content

Instantly share code, notes, and snippets.

View JoeOsborn's full-sized avatar

Joe Osborn JoeOsborn

View GitHub Profile
@JoeOsborn
JoeOsborn / dmogd5.lp
Created August 12, 2013 17:34
Example taken from Decision Modeling and Optimization in Game Design, Part 5, encoded in answer set programming. http://intelligenceengine.blogspot.com/2013/08/decision-modeling-and-optimization-in.html
% Example taken from Decision Modeling and Optimization in Game Design, Part 5.
% http://intelligenceengine.blogspot.com/2013/08/decision-modeling-and-optimization-in.html
% To run (assuming this text is a file on your computer somewhere!):
% 1. First, download clingo (http://sourceforge.net/projects/potassco/files/clingo/3.0.5/).
% 2. Next, put clingo in your PATH somewhere and...
% 3. clingo -n 0 dmogd5.lp
% You should get a list of has_spell and has_perk facts representing the (only possible) assignment!
% The -n 0 means "emit all of the possible models", rather than the default of 1 model;
% in this particular case, there's only one model anyway.
@JoeOsborn
JoeOsborn / UIImage_ImageHelper.h
Created July 21, 2011 16:08 — forked from PaulSolt/ImageHelper.h
A UIImage to BGRA8 conversion category
/*
* The MIT License
*
* Copyright (c) 2011 Paul Solt, PaulSolt@gmail.com
* Modifications Copyright (c) 2011 Joe Osborn, josborn@universalhappymaker.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@JoeOsborn
JoeOsborn / SpriteLayer.h
Created June 28, 2011 21:53
SpriteLayer, a CALayer subclass for spritesheet-based animation
//
// SpriteLayer.h
//
// Created by Joseph C Osborn on 2011.01.12.
// Copyright 2011 Universal Happy-Maker. All rights reserved.
// This code is made available under the 3-clause BSD license:
// http://www.opensource.org/licenses/BSD-3-Clause
//
#import <Foundation/Foundation.h>
#! /usr/bin/python
# flixel (the script) is based on Adam Atomic's 'flx.py' script for
# creating various flixel-related objects in a fresh Flex Builder project.
# flixel (the script) changes the python path to be appropriate for Mac OS,
# generates any needed directories on its own behalf,
# relies on an environment variable (FLIXEL_HOME/lib) to locate flixel's org/...
# directory, and generates a Makefile for use with mxmlc. this behavior can be
# turned off by flipping flexBuilder back to true. it assumes mxmlc is in PATH.
# flixel (the script) also supports a three-argument version like so: