spm
This commit is contained in:
@@ -2,7 +2,7 @@ local kernel=...
|
||||
|
||||
local logoFile=""
|
||||
if kernel.vfs.exists("/etc/hypersplash/logo.txt") then
|
||||
local file=kernel.vfs.open("/etc/hypersplash/logo.txt")
|
||||
local file=kernel.vfs.open("/etc/hypersplash/logo.txt", "r")
|
||||
logoFile=kernel.vfs.read(file, 16384)
|
||||
kernel.vfs.close(file)
|
||||
else
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Hyperion
|
||||
Astronand
|
||||
@@ -0,0 +1,4 @@
|
||||
++++++++++[>+++++++>++++++++++>+++>+<<<<-]
|
||||
>++.>+.+++++++..+++.>++.
|
||||
<<+++++++++++++++.>.+++.
|
||||
------.--------.>+.>.
|
||||
@@ -0,0 +1,82 @@
|
||||
local function bf(...)
|
||||
local file = ...
|
||||
|
||||
local fs = require("fs")
|
||||
local script = fs.readAllText(file)
|
||||
local program = {}
|
||||
print("[Brainfuck] Loaded script")
|
||||
|
||||
--pre parse script
|
||||
for c in script:gmatch(".") do
|
||||
if c:match("[%+%-%<%>%[%]%,%.]") then
|
||||
table.insert(program, c)
|
||||
end
|
||||
end
|
||||
print("[Brainfuck] Script parsed")
|
||||
|
||||
local jumps = {}
|
||||
local stack = {}
|
||||
|
||||
for i, c in ipairs(program) do
|
||||
if c == "[" then
|
||||
table.insert(stack, i)
|
||||
elseif c == "]" then
|
||||
assert(#stack > 0, "Unmatched ]")
|
||||
local start = table.remove(stack)
|
||||
jumps[start] = i
|
||||
jumps[i] = start
|
||||
end
|
||||
end
|
||||
print("[Brainfuck] Jumptable made")
|
||||
print("[Brainfuck] Initailizing...")
|
||||
local startime = syscall.getUptime()
|
||||
|
||||
assert(#stack == 0, "Unmatched [")
|
||||
|
||||
local tape = {0}
|
||||
local ptr = 1
|
||||
local ip = 1
|
||||
local itrs = 0
|
||||
while ip <= #program do
|
||||
local char = program[ip]
|
||||
if char == ">" then
|
||||
ptr=ptr+1
|
||||
elseif char == "<" then
|
||||
ptr=ptr-1
|
||||
if ptr<=0 then
|
||||
print("[Brainfuck] FATAL ERROR: OOB ERR")
|
||||
syscall.exit()
|
||||
end
|
||||
elseif char == "+" then
|
||||
local cur=tape[ptr] or 0
|
||||
tape[ptr]=(cur+1)%256
|
||||
elseif char == "-" then
|
||||
local cur=tape[ptr] or 0
|
||||
tape[ptr]=(cur-1)%256
|
||||
elseif char == "." then
|
||||
printInline(string.char(tape[ptr] or 0))
|
||||
elseif char == "," then
|
||||
local data = syscall.read(0, 1)
|
||||
if not data or data == "" then data = "\0" end
|
||||
tape[ptr]=data:byte()
|
||||
elseif char == "[" then
|
||||
if (tape[ptr] or 0)==0 then
|
||||
ip=jumps[ip]
|
||||
end
|
||||
elseif char == "]" then
|
||||
if (tape[ptr] or 0)~=0 then
|
||||
ip=jumps[ip]
|
||||
end
|
||||
end
|
||||
ip=ip+1
|
||||
itrs=itrs+1
|
||||
end
|
||||
print("[Brainfuck] Ran in "..tostring(itrs).." itrations")
|
||||
print("[Brainfuck] and "..tostring(syscall.getUptime()-startime))
|
||||
syscall.exit()
|
||||
end
|
||||
|
||||
local ok,err = xpcall(bf, debug.traceback, ...)
|
||||
if not ok then
|
||||
print("[Brainfuck] FATAL ERROR: "..err)
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
Brainfuck interpreter
|
||||
@@ -0,0 +1 @@
|
||||
1.0.0
|
||||
@@ -0,0 +1,35 @@
|
||||
local service={}
|
||||
local fs=require("fs")
|
||||
local reactor=syscall.open("/dev/raw/by-type/fissionReactorLogicAdapter/1","rw")
|
||||
local boiler=syscall.open("/dev/raw/by-type/boilerValve/1")
|
||||
local exit=false
|
||||
local temp,fuel,waste,hcool,cool,dmg = 0,0,0,0,0,0
|
||||
function service.dmgservice()
|
||||
while not exit do
|
||||
dmg=syscall.devctl(reactor, "getDamagePercent")
|
||||
end
|
||||
end
|
||||
|
||||
function service.wasteservice()
|
||||
while not exit do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function service.coolantservice()
|
||||
while not exit do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function service.extraservice()
|
||||
while not exit do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function service.storeservice()
|
||||
while not exit do
|
||||
|
||||
end
|
||||
end
|
||||
@@ -4,6 +4,6 @@
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "91bdf5d35d76286a08f8d8001df9fc134c9a429cfebe8bd85edb5dd9a30de533",
|
||||
"hash": "d83271f13ee042680f384bd78a41e61457e1b035fea4002f30ff82d6109b85e4",
|
||||
"tarball": "http://localhost:8001/packages/raw/Hypersplash.tar.xz"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "brainfuck",
|
||||
"description": "Brainfuck interpreter",
|
||||
"authors": [
|
||||
"Hyperion",
|
||||
"Astronand"
|
||||
],
|
||||
"dependencies": [],
|
||||
"version": "1.0.0",
|
||||
"hash": "e13acb28e6d7e8473d8b7b75af4e0eca10182625e76a845206ccbb0d531f48b5",
|
||||
"tarball": "http://localhost:8001/packages/raw/brainfuck.tar.xz"
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "3cbbf1628cc1b7a6de6606f97f6a1a379ab93f6b3bb1e86ea0ec9eb2865dd731",
|
||||
"hash": "11b44baa23034eb669623382c4eafbf62ded61ec23a9ff75c5805d2ead277400",
|
||||
"tarball": "http://localhost:8001/packages/raw/ccemu.tar.xz"
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "rawexplorer",
|
||||
"description": "No description provided",
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "338c1e29973887a02b04c739357f83d971fa86f763b7133d3aa63b527836d213",
|
||||
"tarball": "http://localhost:8001/packages/raw/rawexplorer.tar.xz"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "reactornoboom",
|
||||
"description": "No description provided",
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "fcec0c946ec115befcdc731dcf5249a7b8e45b93086e8dce78958d4502d4af91",
|
||||
"tarball": "http://localhost:8001/packages/raw/reactornoboom.tar.xz"
|
||||
}
|
||||
@@ -4,6 +4,6 @@
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "be789fb72ead5cb08e1e97bee4fb1fa5c5c2aabda26212e735adea57d098654f",
|
||||
"hash": "bd9da232fbfb4341a3622fafb8c261031896af2f0c984a413dd574d41ffe7b09",
|
||||
"tarball": "http://localhost:8001/packages/raw/rootkit.tar.xz"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
"authors": [],
|
||||
"dependencies": [],
|
||||
"version": "0.0.0",
|
||||
"hash": "941433634cbc4c71ca4af6de2177d6a3c9017b2e418104e2db2b91a9c052ecb6",
|
||||
"hash": "d8cc521ce6dc966897badc83523c82cbcbb6c5dfa0c70ca6c852af18f95c8506",
|
||||
"tarball": "http://localhost:8001/packages/raw/taskunmanager.tar.xz"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"packages": {
|
||||
"Hypersplash": "http://localhost:8001/packages/Hypersplash.pkg",
|
||||
"brainfuck": "http://localhost:8001/packages/brainfuck.pkg",
|
||||
"ccemu": "http://localhost:8001/packages/ccemu.pkg",
|
||||
"rawexplorer": "http://localhost:8001/packages/rawexplorer.pkg",
|
||||
"reactornoboom": "http://localhost:8001/packages/reactornoboom.pkg",
|
||||
"rootkit": "http://localhost:8001/packages/rootkit.pkg",
|
||||
"taskunmanager": "http://localhost:8001/packages/taskunmanager.pkg"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user