unknown wips

This commit is contained in:
Tangent 2020-05-21 22:11:07 -07:00
parent bc143056e8
commit 330602f0fc
6 changed files with 74 additions and 0 deletions

24
patternsidea.lua Normal file
View File

@ -0,0 +1,24 @@
-- PATTERN: table of patterns to be sent on initialization and/or
-- after "program" channel receives a pattern table
-- Patterns individually sent on "setsort"
-- Completion message sent on "status"
function send()
if mem.send > 0 then
digiline_send("setsort", PATTERN[mem.send])
mem.send = mem.send - 1
interrupt(1.2)
elseif mem.send == 0 then
digiline_send("status", "Programming complete.")
else
mem.send = #PATTERN
interrupt(1.2)
end
end
if (event.type == "program" and PATTERN) or event.type == "interrupt" then
send()
elseif event.type == "digiline" and event.channel == "program" then
PATTERN = event.msg
send()
end

2
src/Floor.moon Normal file
View File

@ -0,0 +1,2 @@
class Floor
new: =>

1
test.txt Normal file
View File

@ -0,0 +1 @@
The test worked!

BIN
test.zip Normal file

Binary file not shown.

1
unrelatred.txt Normal file
View File

@ -0,0 +1 @@
The RFC says that if there's no MX the mail client should fall back to the A record

46
wip.lua Normal file
View File

@ -0,0 +1,46 @@
-- assume that the engine will create these
local floor = {}
floor.entity = {}
fn = function(code)
-- TODO sandbox code appropriately
end
floor.get = function(self, x, y)
-- TODO whatever is returned by this can be compared with a string to see if its character matches
-- TODO this should return a second value, a table of entities! or empty table
end
-- below here is created by the user
floor.entity[1] = { x = 0, y = 0, character = "@" } -- entity drawing defaults: character="e",color={1,1,1,1},background={0,0,0,1}
floor.global_functions = {}
floor.global_functions.action = function(x, y)
local player = floor.entity[1]
local target, entities = floor:get(x, y)
if target == " " and #entities == 0 then
player.x = x
player.y = y
-- TODO elseif entities / other things
end
end
-- assumes engine will call it to initialize a floor before it is used
floor.init = function()
for name, code in pairs(floor.global_functions) do
_G[name] = fn(code)
end
if not floor.generated then
-- TODO generate this floor!
end
end
floor.update = function(key)
local player = floor.entity[1]
if key == "up" then
action(player.x, player.y - 1)
elseif key == "left" then
action(player.x - 1, player.y)
elseif key == "down" then
action(player.x, player.y + 1)
elseif key == "right" then
action(player.x + 1, player.y)
end
end