996
|
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 }
|