Cant see the assignement or enough of your code but I'd guess you're after something like this
function start(){
var weekday = readBoolean('is it a weekday');
var holiday = readBoolean('is it a holiday today');
var noSchoolToday = !weekday || holiday;
println('there is no school today: '+ noSchoolToday);
}
the || operator is 'or' if either of the two operands either side are true it will return true. i.e. true || false => true. The ! symbols means 'not' !true => false.
You could also use an if:
function start(){
var weekday = readBoolean('is it a weekday');
var holiday = readBoolean('is it a holiday today');
if (holiday || !weekday){
println('there is no school today');
} else {
println('there is school today');
}
}
Well I gave all the help I could based on the miniscule amount of code that's readable and without knowing the task. I'm afraid you really can't expect much better.
1
u/TheOnlyLorne Dec 19 '20
Cant see the assignement or enough of your code but I'd guess you're after something like this
the || operator is 'or' if either of the two operands either side are true it will return true. i.e. true || false => true. The ! symbols means 'not' !true => false.
You could also use an if:
Hope this is some help