This file contains hidden or 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
// a hub world corresponds to a partial order on levels | |
// | |
// an example play sequence is: | |
// 1. the player starts in the hub world, | |
// - which several open (or unlocked) doors and several closed (or locked) doors | |
// 2. the player chooses an open door, and plays through a level, and fails | |
// 3. the player is returned to the hub world | |
// 4. the player chooses the same open door, plays through the same level, and succeeds | |
// 5. the player is returned to the hub world, but there is a change: |
This file contains hidden or 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
// This is using the "Bayesian" formula taken from | |
// http://en.wikipedia.org/wiki/Mark_and_recapture | |
// to provide a crude estimate of "how many" outputs the grammar might generate. | |
// | |
// As I understand it, it is quite easy to technically have infinite outputs, | |
// and this technique "wrongly" will always give a finite answer. | |
// However, informally, we want a lot of visible variety, | |
// and technically-infinite doesn't provide guidance towards | |
// more visible variety, but abundance will. | |
// |
This file contains hidden or 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
-- procedural quest generation | |
math.randomseed(os.time()) | |
local DEPTH = 3 | |
actions = { | |
goto = { | |
{ description = 'Just wander around and look', | |
sequence = { '>explore' } | |
}, |
This file contains hidden or 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
// Based on validity.py which is copyright (c) Feb 2000, by Denys | |
// Duchier, Universitaet des Saarlandes | |
// | |
// Transliterated (badly) from Python to C++ by Johnicholas Hines, | |
// but with the two-continuation model changed to the one-continuation model. | |
// (The failure continuation is the C++ stack.) | |
#include <string> | |
#include <tr1/memory> | |
using std::tr1::shared_ptr; |
This file contains hidden or 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
# This is a lambda-calculus interpreter with shift and reset, | |
# an implementation of BRICS-RS-3-41 "An Operational Foundation for Delimited Continuations", | |
# by Biernacka, Biernacki, and Danvy. | |
# | |
# Mistakes, misunderstandings and terrible un-idiomatic Soar style by Johnicholas | |
# | |
# | |
# This is the grammar: | |
# | |
# A term can have a single outgoing ^reset leading to a reset. |
This file contains hidden or 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
// This is an example of a possible large-scale design idiom. | |
// (Basically the idea is to imitate cascading stylesheets). | |
// | |
// It's hard to give a small, comprehensible example of an | |
// idea intended to be useful at (medium to) large scale. | |
// No matter what you do, it's definitely overengineered. | |
// Sigh. | |
// | |
// Often, at the top of an app, or a big component, | |
// there is a wiring-things-together entity; it might be |
NewerOlder