Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- LoadImage
- -- NuAoA
- local targ={...}
- os.loadAPI("wrap")
- mon = wrap.attach("monitor")
- mon.setTextScale(0.5)
- mon.clear()
- mon.setCursorPos(1,1)
- if #targ==0 then
- print("Type the filename of the image you would like to load:")
- local filename = io.read()
- else
- filename = targ[1]
- end
- local file = io.open(filename,"r")
- local i =1
- local j =0
- local conv = {}
- for line in file:lines() do
- for word in string.gmatch(line,"%d+") do
- if j == 0 and i<= 16 then
- conv[word] = i-1
- else
- mon.setCursorPos(i,j)
- mon.setBackgroundColor(2^conv[word])
- mon.write(" ")
- end
- i=i+1
- end
- i=1
- j=j+1
- end
- file:close()
Add Comment
Please, Sign In to add comment