diff interps/boof/main.cpp @ 996:859f9b4339e6

<Gregor> tar xf egobot.tar.xz
author HackBot
date Sun, 09 Dec 2012 19:30:08 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interps/boof/main.cpp	Sun Dec 09 19:30:08 2012 +0000
@@ -0,0 +1,42 @@
+/* boolfuck.cpp -- an implementation of the Boolfuck programming
+ * language, invented by Sam Hughes (not that I'm the first).  This
+ * implementation is by Sam Hughes.  Not designed for hyperefficiency
+ * or anything :) -- boof@samuelhughes.com */
+ 
+/* For the rest of this document, I recommend considering the word "fuck" to be
+ * non-profane. */
+
+/* See also "smallfuck", which was apparently devised around 2002, and
+ * of course, "brainfuck", which has been around for a while. */
+
+#include "boof.h"
+
+#include <iostream>
+
+#include <string>
+using std::string;
+
+#include <fstream>
+
+
+int main(int argc, char ** argv)
+{
+    if (argc != 2) {
+	std::cerr << "Use one argument.  Not wimping out, are you?\n";
+	return 1;
+    }
+
+    std::ifstream fin(argv[1]);
+
+    if (! fin) {
+	std::cerr << "Error opening file.  Did you even make a file?\n";
+	return 1;
+    }
+
+    boofer runner(fin);
+    runner.execute(std::cin, std::cout);
+
+    /* These variable names are actually as descriptive as possible. */
+
+    return 0;
+}