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