diff --git a/code/gcd.txt b/code/gcd.txt new file mode 100644 index 0000000..8c0c910 --- /dev/null +++ b/code/gcd.txt @@ -0,0 +1,39 @@ +>main +gto +:gcd +=v +=u +$u +$v +>loop +gge +$u +=t +$v +=u +$t +=v +:loop +$v +0 +>ret +gle +$v +=t +$u +$v +mod +=v +$t +=u +>loop +gto +:ret +$u +ret +:main +4 +16 +>gcd +fun +end diff --git a/main.cpp b/main.cpp index ce21990..2ff9f2a 100644 --- a/main.cpp +++ b/main.cpp @@ -68,7 +68,7 @@ int main(int argc, const char * argv[]) { bool done {false}; std::string base_url {"https://www.swiftcoder.nl/cpp1/"}; - std::string next_url {"start.txt"}; + std::string next_url {"gcd.txt"}; std::string code; requester req; interpreter proc; @@ -77,7 +77,7 @@ int main(int argc, const char * argv[]) { // std::cerr << code << '\n'; std::istringstream in {code}; next_url = proc.eval(in, done); - std::cerr << next_url << '\n'; + SCInfo(logger, next_url); } std::cout << next_url << '\n';