Skip to content

Instantly share code, notes, and snippets.

View Fernando-A-Rocha's full-sized avatar
🖥️
Working from home

Fernando Rocha Fernando-A-Rocha

🖥️
Working from home
View GitHub Profile
@Noble-Mushtak
Noble-Mushtak / Calculator.lua
Last active April 8, 2024 16:56
Simple Calculator for Lua
function characterPresent(stringParam, character)
--[[
This function returns true if and only if character is in stringParam.
]]--
--Loop through stringParam:
for i=1, #stringParam do
--If the current character is character, return true.
if stringParam:sub(i, i) == character then return true end
end
--If we go through the whole string without returning true, we get to this point.