computercraft - 在 ComputerCraft 中使用 Lua 制作 API
问题描述
我正在尝试制作一个在 ComputerCraft 中加密字符串的 API。但是,我不确定如何让加密函数返回加密文本。我如何让函数返回一些东西?
解决方案
The syntax to make a function in lua is
function encrypt(text)
[you encrypting algorithm here]
return encrypteddata
end
Here are the documentation for the Strings in Lua (you'll need it to encrypt your text): https://www.tutorialspoint.com/lua/lua_strings.htm
推荐阅读
- ios - 以编程方式选择 UICollectionViewCell
- rust - 为什么程序在明显的生命周期不匹配的情况下仍能编译?
- javascript - 在 Chrome 扩展程序中运行 tensorflow
- python - 在 google colab 上运行 python 文件时无法连接到 X 服务器
- python - 如何从枚举的元组列表中删除项目
- c# - 错误 ORA-00907 缺少右括号
- c# - C# XslCompiledTransform - 以 POCO 形式而不是 Html 输出
- apache-spark - 使用 PySpark 屏蔽信用卡号
- c++ - vscode中无法识别包含路径
- postgresql - 如何在 PGAdmin 4.23 中授予用户对同一数据库中 2 个表的只读权限