24 game: Difference between revisions
→{{header|FutureBasic}}
Line 5,840:
24 Game
May
Rich Love
Thanks to Ken and Bernie
Line 6,057 ⟶ 6,055:
//check expr for validity
short j
bool GotAllNumbers : GotAllNumbers = _false
Line 6,062 ⟶ 6,061:
short GotaNumber : GotaNumber = 0
short TotalNumbers : TotalNumbers = 0
short ExtraNumbers:ExtraNumbers = 0
for i = 1 to len$(fn stringpascalstring(expr))
if asc(mid$(fn stringpascalstring(expr),i,1)) > 48 && asc(mid$(fn stringpascalstring(expr),i,1)) < 58
ExtraNumbers ++
end if
next i
if ExtraNumbers > 4
fn EraseErrorText
text ,,fn colorRed
TryAgain = _true
print %(10,200);"Error! Extra numbers not allowed": goto "InputExpression"
text ,,fn colorWhite
end if
for i = 1 to 4
|