Skip to content

Instantly share code, notes, and snippets.

@Yarillo4
Yarillo4 / feeding_the_paul.js
Last active June 30, 2023 15:25
Help script for the password game. Feeding Paul, extinguishing the fires, ... https://neal.fun/password-game/
{
let findDeepestChildren_rec = (pwdElem, acc) => {
if (pwdElem.children.length == 0) {
// No more children, deepest child
acc.push(pwdElem);
}
for (v of pwdElem.children) {
acc = findDeepestChildren_rec(v, acc);
}
@Yarillo4
Yarillo4 / fakeperipheral.lua
Created July 13, 2022 13:33
Computercraft mocks for the peripheral API
--[[
fakeperipheral, peripheral mocks github.com/Yarillo4.
--]]
local newFuncs = {}
local oldFuncs = {}
local fakeRegistry = {}
oldFuncs.wrap = peripheral.wrap
oldFuncs.find = peripheral.find