mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-25 03:06:05 +10:00
Add initial Pico-8 cartridges for testing
- Created test_cart.p8 with basic drawing functionality and a print statement. - Created test_unix.p8 with a simple initialization function.
This commit is contained in:
41
scripts/nodes/library/math/subtract.js
Normal file
41
scripts/nodes/library/math/subtract.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Subtracts one numeric value from another.
|
||||
*/
|
||||
export const mathSubtractNode = createNodeModule(
|
||||
{
|
||||
id: "math_subtract",
|
||||
title: "Subtract",
|
||||
category: "Math",
|
||||
description: "Subtract one number from another.",
|
||||
searchTags: ["subtract", "math", "minus", "difference", "-"],
|
||||
inputs: [
|
||||
{
|
||||
id: "a",
|
||||
name: "A",
|
||||
direction: "input",
|
||||
kind: "number",
|
||||
defaultValue: 0,
|
||||
},
|
||||
{
|
||||
id: "b",
|
||||
name: "B",
|
||||
direction: "input",
|
||||
kind: "number",
|
||||
defaultValue: 0,
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{ id: "res", name: "Result", direction: "output", kind: "number" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ resolveValueInput }) => {
|
||||
const a = resolveValueInput("a", "0");
|
||||
const b = resolveValueInput("b", "0");
|
||||
return `(${a}) - (${b})`;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user