Commit b52fae51 authored by Adam P. Goucher's avatar Adam P. Goucher

If input file is unspecified, just run the pattern

parent 009e3559
......@@ -25,17 +25,21 @@ void pplus(uint64_t maxmem, std::string targetfile, int64_t *bbox, std::vector<i
apg::lifetree<uint32_t, 1> lt(maxmem);
apg::pattern x(&lt, targetfile);
apg::pattern y = (bbox[3] == 0) ? (x & x[2] & x[4] & x[6] & x[8]) : (x.rmrect(bbox));
apg::pattern g = x - y;
if (g.empty()) {
std::cerr << "Pattern contains no glider." << std::endl;
exit(1);
if (gstream.size() == 0) {
z += x;
} else {
apg::pattern y = (bbox[3] == 0) ? (x & x[2] & x[4] & x[6] & x[8]) : (x.rmrect(bbox));
apg::pattern g = x - y;
if (g.empty()) {
std::cerr << "Pattern contains no glider." << std::endl;
exit(1);
}
g.getrect(bbox);
std::cout << "box=" << bbox[0] << "," << bbox[1] << "," << bbox[2] << "," << bbox[3] << std::endl;
y += g.stream(gstream);
z += y;
h += g;
}
g.getrect(bbox);
std::cout << "box=" << bbox[0] << "," << bbox[1] << "," << bbox[2] << "," << bbox[3] << std::endl;
y += g.stream(gstream);
z += y;
h += g;
}
......@@ -93,15 +97,17 @@ int main(int argc, char *argv[]) {
}
if ((infile == "") || (outfile == "")) {
if (outfile == "") {
std::cerr << "Usage: ./dd0e0p if=recipe.txt of=filename.mc" << std::endl;
exit(1);
}
if (targetfile == "") { targetfile = outfile; }
std::vector<int64_t> gstream;
std::ifstream in(infile);
apg::onlyints(gstream, in);
if (infile != "") {
std::ifstream in(infile);
apg::onlyints(gstream, in);
}
apg::streamtree<uint32_t, 1> st(maxmem);
apg::pattern y(&st, "", "b3s23");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment