Jump to content




Challange, 18 lines programs (entire program visible on the terminal at ones)


  • This topic is locked This topic is locked
1 reply to this topic

#1 Stekeblad

  • Members
  • 62 posts
  • LocationSweden

Posted 11 March 2016 - 06:14 PM

Welcome to this little challange!

Programs dont need to be over 1000 lines to do something useful, here we try to keep the code short and still get something that does something useful, all programs here needs to fit entirely on a computer screen, no scrolling left/right/up/down.
The code should do something useful, you should not just create a program that just does "something". Example on "something":
for i = 1, 100 do
   print i
  sleep(1)
end

Let me give an example, here is the program that gave me the idea, ofcourse what you see is the entire program!:
Posted Image

This is a program for turning on and off a power generating machine then the energy storage has above/below a certain percentage like the ender IO Power Monitor.
Over that, its also easy to configure, all variables you need to change is at the top except sleep that I now relize could be moved to directly after "while true do".

RS_eq_ON = true --> outputting redstone = generator on, no redstone = generator off
Rs_eq_ON = false -- > outputting redstone = generator off, no redstone = generator on

Give it a try!
Can you create a short program that fits entirely on one computer screen?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 11 March 2016 - 07:38 PM

Considering the way newlines work in Lua, this is more of a code golf game with a hard limit of 918 characters. We've already got a code golf topic, so let's stick with that.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users