2
저는 루아 랭귀지를 실험 해왔고 모든 변수가이 변수를 제외한 조건과 상호 작용하는 것처럼 보입니다. 좀 봐도 될까요?변수가 대체되지 않습니다
function Medicial()
local varName = "Marcy"
local varCondition = "Well"
local varSCondition = "1" -- 5 = Uncurable, 10 = Well, 15 = Unknown, 20 = Surgery, 25 = Post Surgery, 29 = Bar Surgery
local varDoctors = "DefultValue"
local varExStatus = "DefultValue"
local payment = "You can afford this."
local total = 400
if varCondition == "Well" then
varDoctors = "Dr. Pope, Dr.Roadmiller"
varStatus = "Yes"
end
if varCondition == "Sick" then
varDoctors = "Dr. Pope, Dr.Rosenhour, Surgeon Rossford"
varStatus = "No"
end
if total > 1000 then
payment = "You can not afford this."
elseif total >= 1000 then
payment = "You can affort this, but you will be broke."
end
if varSCondition == 1 then
varExStatus = "Well"
end
if varSCondition == 5 then
varExStatus = "Uncurable"
end
if varSCondition == 15 then
varExStatus = "Unknown"
end
if varSCondition == "20" then
varExStatus = "Surgery"
end
if varSCondition == "25" then
varExStatus = "Post Surgery"
end
if varSCondition == "29" then
varExStatus = "Bar Surgery"
end
print("-=Subject Reports=-\n");
print("Subject: "..varName.."\nCurrent Condition: "..varCondition.." ("..varExStatus..")\nCurrent Doctors: "..varDoctors.."\nCurrently Recovering? "..varStatus);
print(">> "..payment);
end
그것은 인쇄 : varSCondition에 대한
if total < 1000 then
payment = "You can not afford this."
elseif total == 1000 then
payment = "You can affort this, but you will be broke."
end
:
-=Subject Reports=-
Subject: Marcy
Current Condition: Well (DefultValue)
Current Doctors: Dr. Pope, Dr.Roadmiller
Currently Recovering? Yes
You can afford this.
좋아 ** 내가 무슨 생각을했다 ** 지금 난 그냥 "DefultValue"솔루션 – Potatofactory
또 다른 문제가 필요?!? – Neutrosider
현재 상태 : 음 (DefultValue) – Potatofactory