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
# -------------------------------------------------------------------- | |
# An implementation of Wilson's algorithm for generating mazes. | |
# Slightly smarter than Aldous-Broder, it is novel in its use of a | |
# "scout" to build each path before actually recording it. Like | |
# Aldous-Broder, though, it is not guaranteed to ever finish, if | |
# the RNG makes poor choices. | |
# | |
# As with Aldous-Broder, watching the animation of its progress can | |
# be an exercise in frustration as you find yourself urging the cursor | |
# to JUST GO OVER THERE! Try it and see for yourself. :) |
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
# -------------------------------------------------------------------- | |
# An implementation of Aldous-Broder's algorithm for generating mazes. | |
# This is an easy one to implement, but it is also one of the | |
# "dumbest" (meaning least intelligent) algorithms. It is not even | |
# guaranteed to finish, if you get really unlucky with the RNG. | |
# Watching the animation of its progress can be an exercise in | |
# frustration as you find yourself urging the cursor to JUST GO | |
# OVER THERE! Try and it see for yourself. :) | |
# -------------------------------------------------------------------- | |
# NOTE: the display routine used in this script requires a terminal |
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
# -------------------------------------------------------------------- | |
# An implementation of Prim's algorithm for generating mazes. | |
# This is a pretty fast algorithm, when implemented well, since it | |
# only needs random access to the list of frontier cells. It does | |
# require space proportional to the size of the maze, but even worse- | |
# case, it won't be but a fraction of the size of the maze itself. | |
# As with Kruskal's, this algorithm tends to generate mazes with many | |
# short cul-de-sacs. | |
# -------------------------------------------------------------------- | |
# NOTE: the display routine used in this script requires a terminal |
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
# -------------------------------------------------------------------- | |
# An implementation of Kruskal's algorithm for generating mazes. | |
# Fairly expensive, memory-wise, as it requires memory proportional | |
# to the size of the entire maze, and it's not the fastest of the | |
# algorithms (what with all the set and edge management is has to | |
# do). Also, the mazes it generates tend to have a lot of very short | |
# dead-ends, giving the maze a kind of "spiky" look. | |
# -------------------------------------------------------------------- | |
# NOTE: the display routine used in this script requires a terminal | |
# that supports ANSI escape sequences. Windows users, sorry. :( |
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
# -------------------------------------------------------------------- | |
# Recursive backtracking algorithm for maze generation. Requires that | |
# the entire maze be stored in memory, but is quite fast, easy to | |
# learn and implement, and (with a few tweaks) gives fairly good mazes. | |
# Can also be customized in a variety of ways. | |
# -------------------------------------------------------------------- | |
# -------------------------------------------------------------------- | |
# 1. Allow the maze to be customized via command-line parameters | |
# -------------------------------------------------------------------- |
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
# Recursive backtracking algorithm for maze generation. Requires that | |
# the entire maze be stored in memory, but is quite fast, easy to | |
# learn and implement, and (with a few tweaks) gives fairly good mazes. | |
# Can also be customized in a variety of ways. | |
DIRS = (N, S, E, W = 1, 2, 4, 8) | |
DX = { E => 1, W => -1, N => 0, S => 0 } | |
DY = { E => 0, W => 0, N => -1, S => 1 } | |
OPPOSITE = { E => W, W => E, N => S, S => N } |
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
# -------------------------------------------------------------------- | |
# Eller's algorithm for maze generation. Novel in that it only | |
# requires memory proportional to the size of a single row; this means | |
# you can generate "bottomless" mazes with it, that just keep going | |
# and going and going, using not only constant memory, but little | |
# memory in general. | |
# -------------------------------------------------------------------- | |
# -------------------------------------------------------------------- | |
# 1. Allow the maze to be customized via command-line parameters |
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
BASIC OI (CUCUMBER) KIMCHI | |
-------------------------------------------------------------------------- | |
Oi (cucumber) kimchi is a delicious, refreshing variation on the | |
traditional Korean kimchi recipe. | |
This particular recipe is a modified version of the recipe posted by Dr. | |
Ben Kim, at http://www.drbenkim.com/how-to-make-cucumber-kim-chi.htm. | |
-------------------------------------------------------------------------- |
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
BASIC BAECHU KIMCHI | |
-------------------------------------------------------------------------- | |
Baechu (Napa cabbage) kimchi is one of the staple foods in Korea. Spicy | |
and tangy, it is typically served as a side dish, with rice, but is also | |
found in various Korean soups and stews. | |
This basic version has just the fundamentals; once you're comfortable | |
with this version, you might try adding shredded carrots, Daikon radish, | |
pickled baby shrimp, or any number of other things. Search around online |
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
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just | |
// put a "data-behaviors" attribute on your view elements, and then assign callbacks | |
// for those named behaviors via Behaviors.add. | |
var Behaviors = { | |
add: function(trigger, behavior, handler) { | |
document.observe(trigger, function(event) { | |
var element = event.findElement("*[data-behaviors~=" + behavior + "]"); | |
if (element) handler(element, event); | |
}); |