View gist:b6ab0bfe693ae13056d6
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
type Peg = String | |
type Move = (Peg, Peg) | |
move :: Integer -> Peg -> Peg -> Peg -> [Move] | |
move 0 _ _ _ = [] | |
move 1 from to _ = [(from,to)] | |
move n from to temp = move (n - 1) from temp to ++ [(from,to)] ++ move (n - 1) temp to from | |
hanoi :: Integer -> Peg -> Peg -> Peg -> [Move] | |
hanoi n a b c = move n a c b |
View moocode_toolkit.moo
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
;; while (read(player) != ".") endwhile | |
I M P O R T A N T | |
================= | |
The following code cannot be used as is. You will need to rewrite | |
functionality that is not present in your server/core. The most | |
straight-forward target (other than Stunt/Improvise) is a server/core | |
that provides a map datatype and anonymous objects. |
View gist:1616304
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
/* File Access | |
* see http://pleac.sourceforge.net/pleac_perl/fileaccess.html | |
* Scala 2.9.1 | |
*/ | |
import scripting.file._ | |
import scripting.file.Implicits._ | |
/* Introduction */ |
View gist:1613243
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
/* Process Management and Communication | |
* see http://pleac.sourceforge.net/pleac_perl/processmanagementetc.html | |
* Scala 2.9.1 | |
*/ | |
import scala.sys.process._ | |
import scala.io.Source | |
import java.io.File | |
/* Gathering Output From a Program */ |
View gist:1505615
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
import play.core._ | |
import play.api._ | |
import play.api.mvc._ | |
import java.io._ | |
import play.api.Play.current | |
val app = Application(new File("."), new ApplicationClassLoader(this.getClass.getClassLoader), None, Play.Mode.Dev) |
View composed.moo
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
; create($nothing) | |
@prop #102."packages" 0 "" | |
@prop #102."provides_cache" 0 "" | |
@prop #102."requires_cache" 0 "" | |
@prop #102."last_fetch_index" 0 "" | |
@prop #102."archived" 0 "" | |
@prop #102."cached" 0 "" | |
@prop #102."archive_host" "207.210.101.162" "" | |
@prop #102."archive_port" 80 "" |
View shapes.moo
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
; create($nothing) | |
@verb #101:"_log" this none this xd | |
@program #101:_log | |
notify(player, tostr(@args)); | |
. | |
@verb #101:"_suspend_if_necessary" this none this xd | |
@program #101:_suspend_if_necessary | |
ticks_left() < 10000 || seconds_left() < 2 && suspend(0); |
View gist:1398354
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
@create $nothing named Primitive Package: | |
@prop #34299."identifier" "primitive" r | |
@prop #34299."version" "0.0.1" r | |
@prop #34299."manifest" {} r | |
;;#34299.("manifest") = {{#34299, "package"}, {#34300, "dictionary"}, {#34303, "int_proto"}, {#34304, "float_proto"}, {#34306, "str_proto"}, {#34307, "err_proto"}, {#34308, "list_proto"}, {#34309, "map_proto"}, {#34310, "lambda_proto"}} | |
@prop #34299."relocate" {} r | |
;;#34299.("relocate") = {"dictionary.int_proto", "dictionary.float_proto", "dictionary.str_proto", "dictionary.err_proto", "dictionary.list_proto", "dictionary.map_proto", "dictionary.lambda_proto", "dictionary.frobs"} | |
@prop #34299."requires" {} r | |
;;#34299.("requires") = {{"kernel", ">= 1.0.4"}} | |
@prop #34299."instructions" {} r |
View base64.patch
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
diff --git a/Makefile.in b/Makefile.in | |
index 76a351f..48c58a1 100644 | |
--- a/Makefile.in | |
+++ b/Makefile.in | |
@@ -29,13 +29,15 @@ CFLAGS = -O | |
YFLAGS = -d | |
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c | |
-CSRCS = ast.c code_gen.c db_file.c db_io.c db_objects.c db_properties.c \ | |
- db_verbs.c decompile.c disassemble.c eval_env.c eval_vm.c \ |
View fileio-1.5p3.patch
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
diff --git a/ChangeLog-fileio.txt b/ChangeLog-fileio.txt | |
new file mode 100644 | |
index 0000000..9596740 | |
--- /dev/null | |
+++ b/ChangeLog-fileio.txt | |
@@ -0,0 +1,29 @@ | |
+Version 1.5p3 - Jul 11 | |
+---------------------- | |
+ - Added return value check on calls to binary_to_raw_bytes (via out_filter) | |
+ - Replaced use of fgets to better handle files with null bytes |
NewerOlder