Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- da = peripheral.wrap( "bottom" )
- function board( line, text )
- da.setLine( line )
- da.print( text )
- end
- local function split( str, delimiter )
- local returnTable = {}
- for k, v in string.gmatch(str, "([^" .. delimiter .. "]+)" )
- do
- returnTable[#returnTable+1] = k
- end
- return returnTable
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- clear()
- while ( true )
- do
- local input = io.read()
- local words = split( input, " " )
- local n = table.getn(words)
- if( n >= 1 ) then
- local line = tonumber( words[1], 10 )
- local str = ""
- if ( line ~= nill ) then
- table.remove( words, 1 )
- else
- line = 1
- end
- for k, v in pairs( words ) do
- str = str .. v .. " "
- end
- board( line, str )
- clear()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement