This commit is contained in:
Ole Morud
2022-08-25 19:33:11 +02:00
parent 75029d0fde
commit 1bd5085b91

View File

@@ -1,7 +1,7 @@
export interface Instruction { export interface Instruction {
symbol: string emoji: string
name: string name: string
ascii: string bytecode: string
description: string description: string
searchtags: string searchtags: string
} }
@@ -9,264 +9,264 @@ export interface Instruction {
// first element should be the NOOP instruction // first element should be the NOOP instruction
const instructions: Instruction[] = [ const instructions: Instruction[] = [
{ {
symbol: " ", emoji: " ",
name: "NOOP", name: "NOOP",
ascii: " ", bytecode: " ",
description: "do nothing and move program counter further", description: "do nothing and move program counter further",
searchtags: "nothing blank empty noop" searchtags: "nothing blank empty noop"
}, },
{ {
symbol: "0⃣", emoji: "0⃣",
name: "0", name: "0",
ascii: "0", bytecode: "0",
description: "Push 0 to the stack", description: "Push 0 to the stack",
searchtags: "zero 0 number value" searchtags: "zero 0 number value"
}, },
{ {
symbol: "1⃣", emoji: "1⃣",
name: "1", name: "1",
ascii: "1", bytecode: "1",
description: "Push 1 to the stack", description: "Push 1 to the stack",
searchtags: "one 1 number value" searchtags: "one 1 number value"
}, },
{ {
symbol: "2⃣", emoji: "2⃣",
name: "2", name: "2",
ascii: "2", bytecode: "2",
description: "Push 2 to the stack", description: "Push 2 to the stack",
searchtags: "two 2 number value" searchtags: "two 2 number value"
}, },
{ {
symbol: "3⃣", emoji: "3⃣",
name: "3", name: "3",
ascii: "3", bytecode: "3",
description: "Push 3 to the stack", description: "Push 3 to the stack",
searchtags: "three 3 number value" searchtags: "three 3 number value"
}, },
{ {
symbol: "4⃣", emoji: "4⃣",
name: "4", name: "4",
ascii: "4", bytecode: "4",
description: "Push 4 to the stack", description: "Push 4 to the stack",
searchtags: "four 4 number value" searchtags: "four 4 number value"
}, },
{ {
symbol: "5⃣", emoji: "5⃣",
name: "5", name: "5",
ascii: "5", bytecode: "5",
description: "Push 5 to the stack", description: "Push 5 to the stack",
searchtags: "five 5 number value" searchtags: "five 5 number value"
}, },
{ {
symbol: "6⃣", emoji: "6⃣",
name: "6", name: "6",
ascii: "6", bytecode: "6",
description: "Push 6 to the stack", description: "Push 6 to the stack",
searchtags: "six 6 number value" searchtags: "six 6 number value"
}, },
{ {
symbol: "7⃣", emoji: "7⃣",
name: "7", name: "7",
ascii: "7", bytecode: "7",
description: "Push 7 to the stack", description: "Push 7 to the stack",
searchtags: "seven 7 number value" searchtags: "seven 7 number value"
}, },
{ {
symbol: "8⃣", emoji: "8⃣",
name: "8", name: "8",
ascii: "8", bytecode: "8",
description: "Push 8 to the stack", description: "Push 8 to the stack",
searchtags: "eight 8 number value" searchtags: "eight 8 number value"
}, },
{ {
symbol: "9⃣", emoji: "9⃣",
name: "9", name: "9",
ascii: "9", bytecode: "9",
description: "Push 9 to the stack", description: "Push 9 to the stack",
searchtags: "nine 9 number value" searchtags: "nine 9 number value"
}, },
{ {
symbol: "👈", emoji: "👈",
name: "left", name: "left direction",
ascii: "<", bytecode: "<",
description: "Make program counter point left", description: "Make program counter point left",
searchtags: "hand left direction" searchtags: "hand left direction"
}, },
{ {
symbol: "👉", emoji: "👉",
name: "right", name: "right direction",
ascii: ">", bytecode: ">",
description: "Make program counter point right", description: "Make program counter point right",
searchtags: "hand right direction" searchtags: "hand right direction"
}, },
{ {
symbol: "👇", emoji: "👇",
name: "down", name: "down direction",
ascii: "v", bytecode: "v",
description: "Make program counter point down", description: "Make program counter point down",
searchtags: "hand down direction" searchtags: "hand down direction"
}, },
{ {
symbol: "👆", emoji: "👆",
name: "up", name: "up direction",
ascii: "^", bytecode: "^",
description: "Make program counter point up", description: "Make program counter point up",
searchtags: "hand up direction" searchtags: "hand up direction"
}, },
{ {
symbol: "", emoji: "",
name: "add", name: "add",
ascii: "+", bytecode: "+",
description: "Pop two values a and b, then push the result of a+b", description: "Pop two values a and b, then push the result of a+b",
searchtags: "add plus +" searchtags: "add plus +"
}, },
{ {
symbol: "", emoji: "",
name: "subtract", name: "subtract",
ascii: "-", bytecode: "-",
description: "Pop two values a and b, then push the result of a-b", description: "Pop two values a and b, then push the result of a-b",
searchtags: "subtract minus -" searchtags: "subtract minus -"
}, },
{ {
symbol: "✖️", emoji: "✖️",
name: "multiply", name: "multiply",
ascii: "*", bytecode: "*",
description: "Pop two values a and b, then push the result of a*b", description: "Pop two values a and b, then push the result of a*b",
searchtags: "multiply multiplication x *" searchtags: "multiply multiplication x *"
}, },
{ {
symbol: "➗", emoji: "➗",
name: "divide", name: "divide",
ascii: "/", bytecode: "/",
description: "Pop two values a and b, then push the result of a/b", description: "Pop two values a and b, then push the result of a/b",
searchtags: "divide division /" searchtags: "divide division /"
}, },
{ {
symbol: "🚮", emoji: "🚮",
name: "modulo", name: "modulo",
ascii: "%", bytecode: "%",
description: "Pop two values a and b, then push the result of a mod b", description: "Pop two values a and b, then push the result of a mod b",
searchtags: "modulo remainder" searchtags: "modulo remainder"
}, },
{ {
symbol: "🚫", emoji: "🚫",
name: "logical not", name: "logical not",
ascii: "!", bytecode: "!",
description: "Pop a value. If the value is zero, push 1; otherwise, push zero.", description: "Pop a value. If the value is zero, push 1; otherwise, push zero.",
searchtags: "logical not" searchtags: "logical not"
}, },
{ {
symbol: "📏", emoji: "📏",
name: "greater than", name: "greater than",
ascii: "`", bytecode: "`",
description: "Pop two values a and b, then push 1 if b>a, otherwise zero.", description: "Pop two values a and b, then push 1 if b>a, otherwise zero.",
searchtags: "greater than > < ruler" searchtags: "greater than > < ruler"
}, },
{ {
symbol: "🎲", emoji: "🎲",
name: "random direction", name: "random direction",
ascii: "?", bytecode: "?",
description: "Change direction randomly", description: "Change direction randomly",
searchtags: "random direction dice" searchtags: "random direction dice"
}, },
{ {
symbol: "🔛", emoji: "🔛",
name: "horizontal if", name: "horizontal if",
ascii: "_", bytecode: "_",
description: "Pop a value; set direction to right if value=0, set to left otherwise", description: "Pop a value; set direction to right if value=0, set to left otherwise",
searchtags: "left right conditional if leftright" searchtags: "left right conditional if leftright"
}, },
{ {
symbol: "🪜", emoji: "🪜",
name: "vertical if", name: "vertical if",
ascii: "|", bytecode: "|",
description: "pop a value; set direction to down if value=0, set to up otherwise", description: "pop a value; set direction to down if value=0, set to up otherwise",
searchtags: "up down conditional if ladder" searchtags: "up down conditional if ladder"
}, },
{ {
symbol: "📜", emoji: "📜",
name: "string mode", name: "string mode",
ascii: "''", bytecode: '"',
description: description:
"Toggle stringmode (push each character's ASCII value all the way up to the next \")", "Toggle stringmode (push each character's ASCII value all the way up to the next \")",
searchtags: "string stringmode char scroll" searchtags: "string stringmode char scroll"
}, },
{ {
symbol: "🧬", emoji: "🧬",
name: "duplicate", name: "duplicate",
ascii: ":", bytecode: ":",
description: "Duplicate top stack value", description: "Duplicate top stack value",
searchtags: "duplicate dna" searchtags: "duplicate dna"
}, },
{ {
symbol: "💱", emoji: "💱",
name: "swap", name: "swap",
ascii: "\\", bytecode: "\\",
description: "Swap top stack values", description: "Swap top stack values",
searchtags: "swap" searchtags: "swap"
}, },
{ {
symbol: "🗑️", emoji: "🗑️",
name: "discard", name: "discard",
ascii: "$", bytecode: "$",
description: "Pop top of stack and discard", description: "Pop top of stack and discard",
searchtags: "pop discard trash delete" searchtags: "pop discard trash delete"
}, },
{ {
symbol: "🔢", emoji: "🔢",
name: "print number", name: "print number",
ascii: ".", bytecode: ".",
description: "Pop top of stack and output as integer", description: "Pop top of stack and output as integer",
searchtags: "pop print write integer number" searchtags: "pop print write integer number"
}, },
{ {
symbol: "✍", emoji: "✍",
name: "print character", name: "print character",
ascii: ",", bytecode: ",",
description: "Pop top of stack and output as ASCII character", description: "Pop top of stack and output as ASCII character",
searchtags: "pop print write char" searchtags: "pop print write char"
}, },
{ {
symbol: "🦘", emoji: "🦘",
name: "jump", name: "jump",
ascii: "#", bytecode: "#",
description: "Jump over next command", description: "Jump over next command",
searchtags: "bridge jump skip kangaroo" searchtags: "bridge jump skip kangaroo"
}, },
{ {
symbol: "📥", emoji: "📥",
name: "get", name: "get",
ascii: "g", bytecode: "g",
description: description:
'A "get" call (a way to retrieve data in storage). Pop two values y and x, then push the ASCII value of the character at that position in the program. If (x,y) is out of bounds, push 0', 'A "get" call (a way to retrieve data in storage). Pop two values y and x, then push the ASCII value of the character at that position in the program. If (x,y) is out of bounds, push 0',
searchtags: "get" searchtags: "get"
}, },
{ {
symbol: "📤", emoji: "📤",
name: "put", name: "put",
ascii: "p", bytecode: "p",
description: description:
'A "put" call (a way to store a value for later use). Pop three values y, x and v, then change the character at the position (x,y) in the program to the character with ASCII value v', 'A "put" call (a way to store a value for later use). Pop three values y, x and v, then change the character at the position (x,y) in the program to the character with ASCII value v',
searchtags: "put" searchtags: "put"
}, },
{ {
symbol: "📲", emoji: "📲",
name: "number input", name: "number input",
ascii: "&", bytecode: "&",
description: "Get number from user input and push it", description: "Get number from user input and push it",
searchtags: "input integer" searchtags: "input integer"
}, },
{ {
symbol: "🔤", emoji: "🔤",
name: "character input", name: "character input",
ascii: "~", bytecode: "~",
description: "Get character from user and push it", description: "Get character from user and push it",
searchtags: "input character" searchtags: "input character"
}, },
{ {
symbol: "🏁", emoji: "🏁",
name: "end", name: "end",
ascii: "@", bytecode: "@",
description: "End program", description: "End program",
searchtags: "end return finish done exit" searchtags: "end return finish done exit"
} }