Files
picoGraph/scripts/nodes/library/subtractNumber.js
Max Litruv Boonzaayer f917cf6ad5 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.
2026-03-21 18:38:43 +11:00

42 lines
949 B
JavaScript

import { createNodeModule } from "../nodeTypes.js";
/**
* Subtracts one numeric value from another.
*/
export const subtractNumberNode = createNodeModule(
{
id: "subtract_number",
title: "Subtract",
category: "Math",
description: "Subtract one number from another.",
searchTags: ["subtract", "math", "minus", "difference", "number"],
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})`;
},
}
);