about summary refs log tree commit diff stats
path: root/cpp/022boolean
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/022boolean')
-rw-r--r--cpp/022boolean26
1 files changed, 13 insertions, 13 deletions
diff --git a/cpp/022boolean b/cpp/022boolean
index 1aef69d9..014774db 100644
--- a/cpp/022boolean
+++ b/cpp/022boolean
@@ -6,16 +6,16 @@ AND,
 Recipe_number["and"] = AND;
 :(before "End Primitive Recipe Implementations")
 case AND: {
-  trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  vector<int> arg0 = read_memory(instructions[pc].ingredients[0]);
+  trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name;
+  vector<int> arg0 = read_memory(current_instruction().ingredients[0]);
   assert(arg0.size() == 1);
-  trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
-  vector<int> arg1 = read_memory(instructions[pc].ingredients[1]);
+  trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name;
+  vector<int> arg1 = read_memory(current_instruction().ingredients[1]);
   assert(arg1.size() == 1);
   vector<int> result;
   result.push_back(arg0[0] && arg1[0]);
   trace("run") << "product 0 is " << result[0];
-  write_memory(instructions[pc].products[0], result);
+  write_memory(current_instruction().products[0], result);
   break;
 }
 
@@ -39,16 +39,16 @@ OR,
 Recipe_number["or"] = OR;
 :(before "End Primitive Recipe Implementations")
 case OR: {
-  trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  vector<int> arg0 = read_memory(instructions[pc].ingredients[0]);
+  trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name;
+  vector<int> arg0 = read_memory(current_instruction().ingredients[0]);
   assert(arg0.size() == 1);
-  trace("run") << "ingredient 1 is " << instructions[pc].ingredients[1].name;
-  vector<int> arg1 = read_memory(instructions[pc].ingredients[1]);
+  trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name;
+  vector<int> arg1 = read_memory(current_instruction().ingredients[1]);
   assert(arg1.size() == 1);
   vector<int> result;
   result.push_back(arg0[0] || arg1[0]);
   trace("run") << "product 0 is " << result[0];
-  write_memory(instructions[pc].products[0], result);
+  write_memory(current_instruction().products[0], result);
   break;
 }
 
@@ -72,13 +72,13 @@ NOT,
 Recipe_number["not"] = NOT;
 :(before "End Primitive Recipe Implementations")
 case NOT: {
-  trace("run") << "ingredient 0 is " << instructions[pc].ingredients[0].name;
-  vector<int> arg0 = read_memory(instructions[pc].ingredients[0]);
+  trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].name;
+  vector<int> arg0 = read_memory(current_instruction().ingredients[0]);
   assert(arg0.size() == 1);
   vector<int> result;
   result.push_back(!arg0[0]);
   trace("run") << "product 0 is " << result[0];
-  write_memory(instructions[pc].products[0], result);
+  write_memory(current_instruction().products[0], result);
   break;
 }