diff --git a/meta.json b/meta.json new file mode 100644 index 0000000..d3c3e8a --- /dev/null +++ b/meta.json @@ -0,0 +1,9 @@ +{ + "name": "programs", + "author": "Luna Magdalena :3", + "version": [1], + "dependencies": ["info"], + "paths": { + "programs.js": "%B/programs.js" + } +} diff --git a/programs.js b/programs.js new file mode 100644 index 0000000..2a66b7a --- /dev/null +++ b/programs.js @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000..fb969b6 --- /dev/null +++ b/programs.yarn @@ -0,0 +1 @@ +{"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 68476b5..43fec2a 100644 --- a/repo.json +++ b/repo.json @@ -1,6 +1,7 @@ { "name": "itty", "packages": { - "info": {"url": "~info.yarn", "version": [1]} + "info": {"url": "~info.yarn", "version": [1]}, + "programs": {"url": "~programs.yarn", "version": [1]} } }