JeViCo Posted January 27, 2018 Share Posted January 27, 2018 Доброго времени суток! Я столкнулся с такой проблемой, как длинное условие: if (press) and button=="0" or (press) and button=="1" or (press) and button=="2" or (press) and button=="3" or (press) and button=="4" or (press) and button=="5" or (press) and button=="6" or (press) and button=="7" or (press) and button=="8" or (press) and button=="9" then как это можно сократить? числа в диапазоне от 0 до 9 нужно буквально в 1-2 строки записать\\ Link to comment
LoveFist Posted January 27, 2018 Share Posted January 27, 2018 button = tonumber(button) if (button >= 0 and button <= 9) then ... end Link to comment
JeViCo Posted January 28, 2018 Author Share Posted January 28, 2018 17 hours ago, LoveFist said: button = tonumber(button) if (button >= 0 and button <= 9) then ... end спасибо, помогло Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now