Skip to content

Commit

Permalink
Add leap year example
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwill committed Jun 1, 2012
1 parent f5f9757 commit b54314a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions leapyear.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/osascript

-- Calculate whether a year is a leap year.

on leap(year)
if (year mod 100 is equal to 0) then
return (year mod 100 is equal to 0)
else
return (year mod 4 is equal to 0)
end if
end leap

leap(1900)

0 comments on commit b54314a

Please sign in to comment.