Last active
January 20, 2024 19:20
-
-
Save tnhung2011/3f6c2da9feb56070f3ace982ba7bd625 to your computer and use it in GitHub Desktop.
Simple implementation of the "A programming language is any set of rules that converts strings, or graphical program elements in the case of visual programming languages, to various kinds of machine code output." (abbreviated Programming Language or APLIAFCLDTCITAMPAC) programming language.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valid_string = 'A programming language is any set of rules that converts strings, or graphical program elements in the case of visual programming languages, to various kinds of machine code output.' | |
function file_exists(file) | |
local f = io.open(file, 'rb') | |
if f then f:close() end | |
return f ~= nil | |
end | |
function parse(command) | |
if command == valid_string then | |
print(valid_string) | |
else | |
print(arg[0] .. ": !: the only valid first 181 string is: " .. valid_string) | |
os.exit(1) | |
end | |
end | |
if file_exists(arg[2]) == true then | |
io.input(arg[2]) | |
file = io.read(181) | |
parse(file) | |
io.close() | |
else | |
print(arg[0] .. ": !: " .. arg[2] .. " refused to exist") | |
os.exit(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment