Skip to content

Instantly share code, notes, and snippets.

@capotej
Created August 31, 2011 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capotej/1184376 to your computer and use it in GitHub Desktop.
Save capotej/1184376 to your computer and use it in GitHub Desktop.
/* Copyright (c) 1983 University of Maryland Computer Science Department */
/* Ultra-hot screen management package
Original code copyright (c) James Gosling, January 1980 */
/* Severe munging and destruction by Chris Torek, 1982,1983 */
/****************************************************************
/-------------\
/ \
/ \
/ \
| XXXX XXXX |
| XXXX XXXX |
| XXX XXX |
\ X /
--\ XXX /--
| | XXX | |
| | | |
| I I I I I I I |
| I I I I I I |
\ /
-- --
\-------/
XXX XXX
XXXXX XXXXX
XXXXXXXXX XXXXXXXXXX
XXXXX XXXXX
XXXXXXX
XXXXX XXXXX
XXXXXXXXX XXXXXXXXXX
XXXXX XXXXX
XXX XXX
**************
* BEWARE!! *
**************
All ye who enter here:
Most of the code in this module
is twisted beyond belief!
Tread carefully.
If you think you understand it,
You Don't,
So Look Again.
****************************************************************/
/* 1 2 3 4 .... Each Mij represents the minumum cost of
+---+---+---+---+----- rearranging the first i lines to map onto
1 | | | | | the first j lines (the j direction
+---+---+---+---+----- represents the desired contents of a line,
2 | | \| ^ | | i the current contents). The algorithm
+---+---\-|-+---+----- used is a dynamic programming one, where
3 | |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment