Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- print("ByteFawk Simulator")
- local tLines = {}
- if tArgs[1] then
- file = fs.open(tArgs[1], "r")
- if file then
- local line = file.readLine()
- while line do
- tLines[#tLines+1] = line
- line = file.readLine()
- end
- end
- else
- print("Workspace:")
- while true do
- local line = read()
- if line ~= "~ end" then
- tLines[#tLines+1] = line
- else
- break
- end
- end
- end
- for i=1,#tLines do
- local tWords = {}
- for match in string.gmatch(tLines[i], "[^ \t]+") do
- table.insert( tWords, match )
- end
- local lineType = tWords[1]
- local variableType = tWords[2]
- local bitez = tWords[3]
- if lineType == "-" then
- if variableType == ">" then
- write( string.char( tonumber(bitez) ) )
- elseif variableType == "<" then
- write( string.char( bitez ) )
- end
- elseif lineType == "=" then
- print()
- end
- end
- --Example--
- --[[
- = < 558
- - > 72
- - > 101
- - > 108
- - > 108
- - > 111
- - > 32
- - > 87
- - > 111
- - > 114
- - > 108
- - > 100
- = > 491
- --]]
Advertisement
Add Comment
Please, Sign In to add comment