Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Leap-year/LiveCode/leap-year.livecode
Normal file
18
Task/Leap-year/LiveCode/leap-year.livecode
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
function isLeapYear year
|
||||
return (year MOD 4 is 0) AND ((year MOD 400 is 0) OR (year MOD 100 is not 0))
|
||||
end isLeapYear
|
||||
|
||||
command testLeapYear
|
||||
set itemDelimiter to comma
|
||||
put "1900,1994,1996,1997,2000" into years
|
||||
repeat for each item y in years
|
||||
put y && "is" && isLeapYear(y) && return after tyears
|
||||
end repeat
|
||||
put tyears
|
||||
end testLeapYear
|
||||
|
||||
1900 is false
|
||||
1994 is false
|
||||
1996 is true
|
||||
1997 is false
|
||||
2000 is true
|
||||
Loading…
Add table
Add a link
Reference in a new issue