diff --git a/cat.yarn b/cat.yarn new file mode 100644 index 0000000..a143221 --- /dev/null +++ b/cat.yarn @@ -0,0 +1 @@ +{"protected":false,"mode":"f","metadata":{"name":"cat","author":"Luna Magdalena :3","version":[1],"dependencies":[],"runner":[],"paths":{"cat.js":"%B/cat.js"}},"content":"{\"cat.js\":{\"protected\":true,\"metadata\":{},\"mode\":\"f\",\"content\":\"program.autoOutput = false\\n\\nfor (let a of args) {\\n let file\\n try {\\n file = io.open(a)\\n } catch (e) {\\n display.print(\\\"Cannot open file\\\", 0x9000)\\n }\\n if (file) {\\n const lines = file.lines()\\n for (let line of lines) {\\n io.output(\\\"%n\\\" + line)\\n display.print(line, itty.baseStyle, false)\\n }\\n }\\n}\\n \\nquit()\"}}"} \ No newline at end of file diff --git a/clear.yarn b/clear.yarn new file mode 100644 index 0000000..15b1d6f --- /dev/null +++ b/clear.yarn @@ -0,0 +1 @@ +{"protected":false,"mode":"f","metadata":{"name":"clear","author":"Luna Magdalena :3","version":[1],"dependencies":[],"runner":[],"paths":{"clear.js":"%B/clear.js"}},"content":"{\"clear.js\":{\"protected\":true,\"metadata\":{},\"mode\":\"f\",\"content\":\"display.clear(); quit()\"}}"} \ No newline at end of file diff --git a/info.yarn b/info.yarn deleted file mode 100644 index 47910e3..0000000 --- a/info.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"info","version":[1],"author":"Luna Magdalena :3","dependencies":[],"paths":{"info.js":"%C/info.js"}},"content":"{\"info.js\":{\"protected\":false,\"metadata\":{},\"mode\":\"f\",\"content\":\"display.buffer(`Itty version: v${itty.version[0]}.${itty.version[1]}${itty.version[2] ? \\\".\\\" + itty.version[2] : \\\"\\\"} ${itty.version[3] || \\\"\\\"}%nRoot FS: ${itty.disk.version}`, 0x4000)\\ndisplay.buffer(\\\"%n%nDisplay dimensions: \\\", 0x7000)\\ndisplay.buffer(itty.width + \\\"x\\\" + itty.height + \\\"%n%n\\\", 0x6000)\\nfor (let i=0; i < 8; i++) {\\n display.buffer(\\\" \\\", 0x0100 * i)\\n}\\nitty.cursorY++\\nitty.cursorX = 0\\nfor (let i=8; i < 16; i++) {\\n display.buffer(\\\" \\\", 0x0100 * i)\\n}\\n\\ndisplay.buffer(\\\"%n%nITTY: Incredibly Tiny Terminal, Yay!\\\", 0x4041)\\ndisplay.buffer(\\\" by \\\", 0x7041)\\ndisplay.buffer(\\\"Magdalunaa\\\", 0x6051)\\nstyle.setAttribute(1, {_link: \\\"https://codeberg.org/Magdalunaa/itty\\\", style: \\\"cursor: pointer; text-decoration-color: var(--itty-c-4)\\\"})\\ndisplay.render()\\nquit()\"}}"} diff --git a/meta.json b/meta.json deleted file mode 100644 index d3c3e8a..0000000 --- a/meta.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "programs", - "author": "Luna Magdalena :3", - "version": [1], - "dependencies": ["info"], - "paths": { - "programs.js": "%B/programs.js" - } -} diff --git a/programs.js b/programs.js deleted file mode 100644 index 2a66b7a..0000000 --- a/programs.js +++ /dev/null @@ -1,19 +0,0 @@ -for (let path of itty.env.path) { - path = fs.listDir(path) - for (let p in path) { - p = path[p] - if (p.ext === "js") { - const name = p.name.slice(0, -3) - if (itty.cursorX + name.length >= itty.width) { - itty.cursorX = 0 - itty.cursorY++ - } - while (itty.cursorY >= itty.height) - display.lift() - display.buffer(name + " ") - } - } -} - -display.render() -quit() \ No newline at end of file diff --git a/programs.yarn b/programs.yarn deleted file mode 100644 index fb969b6..0000000 --- a/programs.yarn +++ /dev/null @@ -1 +0,0 @@ -{"protected":false,"mode":"f","metadata":{"name":"programs","author":"Luna Magdalena :3","version":[1],"dependencies":["info"],"paths":{"programs.js":"%B/programs.js"}},"content":"{\"programs.js\":{\"protected\":false,\"metadata\":{},\"mode\":\"f\",\"content\":\"for (let path of itty.env.path) {\\n path = fs.listDir(path)\\n for (let p in path) {\\n p = path[p]\\n if (p.ext === \\\"js\\\") {\\n const name = p.name.slice(0, -3)\\n if (itty.cursorX + name.length >= itty.width) {\\n itty.cursorX = 0\\n itty.cursorY++\\n }\\n while (itty.cursorY >= itty.height)\\n display.lift()\\n display.buffer(name + \\\" \\\")\\n }\\n }\\n}\\n \\ndisplay.render()\\nquit()\"}}"} \ No newline at end of file diff --git a/repo.json b/repo.json index 43fec2a..e2ad775 100644 --- a/repo.json +++ b/repo.json @@ -1,7 +1,7 @@ { "name": "itty", "packages": { - "info": {"url": "~info.yarn", "version": [1]}, - "programs": {"url": "~programs.yarn", "version": [1]} + "cat": {"url": "~cat.yarn", "version": [1]}, + "clear": {"url": "~clear.yarn", "version": [1]} } }