Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
22
Task/Exceptions/Pluto/exceptions.pluto
Normal file
22
Task/Exceptions/Pluto/exceptions.pluto
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local function get_day_no(day)
|
||||
-- Throws an error if day is invalid.
|
||||
return switch day:lower() do
|
||||
case "monday" -> 1
|
||||
case "tuesday" -> 2
|
||||
case "wednesday" -> 3
|
||||
case "thursday" -> 4
|
||||
case "friday" -> 5
|
||||
case "saturday" -> 6
|
||||
case "sunday" -> 7
|
||||
default -> error($"'{day}' is not a valid day in English.")
|
||||
end
|
||||
end
|
||||
|
||||
for {"thursday", "jeudi"} as day do
|
||||
local ok, res = pcall(get_day_no, day)
|
||||
if ok then
|
||||
print($"'{day}' is day number {res}")
|
||||
else
|
||||
print(res)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue