-- Rank simulator X egg calculator
-- this caluclator determines how many eggs you can hatch with X currency
-- individual pets will be added later
-- put the currency you have and the egg price in the program input to the left
-- Example:
-- 1000000 (represents stars)
-- 1000 (represents egg price)
print("How many stars do you have?")
print("How expensive is the egg?")
print("")
-- if statements
local Currency = io.read("*line")
local Price = io.read("*line")
if Price == "1K" or Price == "1k" then
Price = 1000
elseif Price == "125K" or Price == "125k" then
Price = 125000
else
Price = Price
end
-- If statements
if Price > Currency then
print("You cannot afford this egg, try another egg you can afford!")
elseif Price <= Currency then
local T = (Currency / Price)
print("")
print("The total amount of eggs you can buy is" .. T)
print("")
print("Thanks for using this!")
else
print("please put in a proper value")
end
To embed this project on your website, copy the following code and paste it into your website's HTML: