From 0c476e92e1807928ffb30864126076ef4c6a0821 Mon Sep 17 00:00:00 2001
From: Elizabeth Hunt <elizabeth.hunt@simponic.xyz>
Date: Tue, 13 Feb 2024 20:00:02 -0700
Subject: add all the stuff

---
 src/scenes/boolean_algebra_lambda.tsx | 49 +++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 src/scenes/boolean_algebra_lambda.tsx

(limited to 'src/scenes/boolean_algebra_lambda.tsx')

diff --git a/src/scenes/boolean_algebra_lambda.tsx b/src/scenes/boolean_algebra_lambda.tsx
new file mode 100644
index 0000000..2639461
--- /dev/null
+++ b/src/scenes/boolean_algebra_lambda.tsx
@@ -0,0 +1,49 @@
+import { Layout, makeScene2D } from "@motion-canvas/2d";
+import {
+  Direction,
+  beginSlide,
+  createRef,
+  slideTransition,
+} from "@motion-canvas/core";
+import { LambdaReducer } from "../components/lambda_reducer";
+import { baseDefinitions } from "../utils/lambdas";
+
+export default makeScene2D(function* (view) {
+  const lambdaReducer = createRef<LambdaReducer>();
+  const layout = createRef<Layout>();
+
+  view.add(
+    <Layout
+      layout
+      ref={layout}
+      direction="column"
+      alignItems="center"
+      gap={50}
+    ></Layout>
+  );
+  yield* slideTransition(Direction.Right);
+  yield* beginSlide("Boolean Reductions");
+
+  for (const term of [
+    "((false one) zero)",
+    "((true one) zero)",
+    "(((if true) one) zero)",
+  ]) {
+    yield* layout().opacity(0, 0.5);
+    layout().add(
+      <LambdaReducer
+        ref={lambdaReducer}
+        lambdaTerm={term}
+        definitions={baseDefinitions}
+      ></LambdaReducer>
+    );
+    yield* layout().opacity(1, 0.5);
+
+    yield* beginSlide("Next Reduction " + term);
+    for (let i = 0; !lambdaReducer().isDone(); i++) {
+      yield* lambdaReducer().step(0.5);
+      yield* beginSlide(term + " Next Step " + i);
+    }
+    layout().removeChildren();
+  }
+});
-- 
cgit v1.2.3-70-g09d2

