Mercurial > repo
comparison 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 |
comparison
equal
deleted
inserted
replaced
995:6883f5911eb7 | 996:859f9b4339e6 |
---|---|
1 /* boolfuck.cpp -- an implementation of the Boolfuck programming | |
2 * language, invented by Sam Hughes (not that I'm the first). This | |
3 * implementation is by Sam Hughes. Not designed for hyperefficiency | |
4 * or anything :) -- boof@samuelhughes.com */ | |
5 | |
6 /* For the rest of this document, I recommend considering the word "fuck" to be | |
7 * non-profane. */ | |
8 | |
9 /* See also "smallfuck", which was apparently devised around 2002, and | |
10 * of course, "brainfuck", which has been around for a while. */ | |
11 | |
12 #include "boof.h" | |
13 | |
14 #include <iostream> | |
15 | |
16 #include <string> | |
17 using std::string; | |
18 | |
19 #include <fstream> | |
20 | |
21 | |
22 int main(int argc, char ** argv) | |
23 { | |
24 if (argc != 2) { | |
25 std::cerr << "Use one argument. Not wimping out, are you?\n"; | |
26 return 1; | |
27 } | |
28 | |
29 std::ifstream fin(argv[1]); | |
30 | |
31 if (! fin) { | |
32 std::cerr << "Error opening file. Did you even make a file?\n"; | |
33 return 1; | |
34 } | |
35 | |
36 boofer runner(fin); | |
37 runner.execute(std::cin, std::cout); | |
38 | |
39 /* These variable names are actually as descriptive as possible. */ | |
40 | |
41 return 0; | |
42 } |