Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local examples = {
- ["helloworld"] = [[>0"!dlrow ,olleH" :v
- v:,_@
- > ^
- Notice the >, <, v, and ^ instructions changing
- the direction the pointer is moving
- <-- You can see the letters here]],
- ["random"] = [[v>>>>.
- s12345
- ^?^ In this program, the pointer goes to the
- > ? ?^ end of the program. When this happens, it
- v?v wraps back to the beginning
- v6789>
- It also uses the ? instruction, which
- changes the pointer to move in a random
- direction
- ]],
- ["add"] = [[> v
- v"a> "<
- >,,,& v Notice that the program waits for an
- v"b> "< input at the '&' symbol
- >,,,& v
- v"output> "<
- > ,,,,,,,, +.@
- ]],
- ["chars"] = [[v
- 1
- >1+:,v
- ^ s <
- ]],
- }
- print("Available Programs:")
- fs.makeDir("/examples")
- for i,v in pairs(examples) do
- file = io.open("/examples/"..i, "w")
- file:write(v)
- file:close()
- print(" - "..i)
- end
- print("Your example programs are in /examples/<programname>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement