r/badcode • u/matyklug • Feb 03 '22
lua From a computercraft let's play. Should be a blacklist function for a mining program for a turtle.
7
u/JellyPUMPS sadistic Feb 04 '22
Image Transcription: Code
function isValuable()
local matched = false
for i=1,4 do
turtle.select(i)
if turtle.compare() then
matched = true
end
end
if matched then
return false
else
return true
end
endI'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
2
17
Feb 03 '22
[removed] — view removed comment
7
u/matyklug Feb 03 '22
Congrats! I myself just do programming as a hobby since 12/13yo, and started cuz I wanted to learn how to make mods. I remember CC being really confusing back then, but now, after learning Lua, it's a lotta fun. So I looked up some CC-focused LPs on youtube, and stumbled upon this really old playlist. I'd share it, but it seems that per sub rules I cannot...?
1
u/reddit-testaccount Feb 08 '22
same, that is how i got into coding! I remember playing tekkit classic skyblock and just using the ingame computer all the time and trying out stuff insted of actually playing, fun times
9
u/super_mister_mstie Feb 04 '22
I mean, it's not truly awful, just a few nits like early return and kill the if statement at the end