我試圖爲自己的用途創建一個計算器。我不知道如何製作,以便當用戶輸入例如6爲提示讓用戶鍵入6個數字。所以,如果我寫了7,它會給我寫的7個號碼,然後給我答案的選項,如果我寫了8它將讓我寫8號...帶計算器腳本的Lua
if choice == "2" then
os.execute("cls")
print("How many numbers?")
amountNo = io.read("*n")
if amountNo <= 2 then print("You cant have less than 2 numbers.")
elseif amountNo >= 14 then print("Can't calculate more than 14 numbers.")
elseif amountNo <= 14 and amountNo >= 2 then
amountNmb = amountNo
if amountNmb = 3 then print(" Number 1")
print("Type in the numbers seperating by commas.")
local nmb
print("The answer is..")
順便說一句,有點搞砸了,因爲我沒有完成它,所以像amountNmb變量代碼甚至不需要那裏等 – user3654336
有沒有理由爲什麼沒有答案接受?這仍然是開放的嗎? – Schollii