Skip to content

Instantly share code, notes, and snippets.

@tnhung2011
Last active January 20, 2024 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnhung2011/3f6c2da9feb56070f3ace982ba7bd625 to your computer and use it in GitHub Desktop.
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.
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