Skip to main content
made title a little less capital
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

We Had A Question Once Which Only Failed Onhad a question once which only failed on Sundays

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally, such as a divide by zero error or using an uninitialised variable. This means that if any code were to be added after the part that errors, it would not be executed on Sunday.
  • You can also use statements that manually create an error, equivalent to Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

We Had A Question Once Which Only Failed On Sundays

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally, such as a divide by zero error or using an uninitialised variable. This means that if any code were to be added after the part that errors, it would not be executed on Sunday.
  • You can also use statements that manually create an error, equivalent to Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

We had a question once which only failed on Sundays

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally, such as a divide by zero error or using an uninitialised variable. This means that if any code were to be added after the part that errors, it would not be executed on Sunday.
  • You can also use statements that manually create an error, equivalent to Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

added 118 characters in body
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally/crashterminate abnormally, such as a divide by zero error or using an uninitialised variable. This means that if any code were to be added after the part that errors, it would not be executed on Sunday. 
  • You can also use statements that manually create an error, such asequivalent to Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally/crash, such as a divide by zero error or using an uninitialised variable. You can also use statements that manually create an error, such as Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally, such as a divide by zero error or using an uninitialised variable. This means that if any code were to be added after the part that errors, it would not be executed on Sunday. 
  • You can also use statements that manually create an error, equivalent to Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Added definition of error
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally/crash, such as a divide by zero error or using an uninitialised variable. You can also use statements that manually create an error, such as Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day.

###Rules:

  • No using input or showing output through the usual IO methods, except to print to STDERR or your language's equivalent. You are allowed to print to STDOUT if it's a by-product of your error.
  • A function may return a value on non-Sundays as long as it doesn't print anything
  • Your program may use a Sunday from any timezone, or the local timezone, as long as it is consistent.
  • An error is a something that makes the program terminate abnormally/crash, such as a divide by zero error or using an uninitialised variable. You can also use statements that manually create an error, such as Python’s raise.
  • This includes runtime errors, syntax errors and errors while compiling (good luck with that!)
  • On an error there must be some sign that distinguishes it from having no error
  • This is , so the shortest bytecount in each language wins!

I'll have to wait til Sunday to check the answers ;)

Tweeted twitter.com/StackCodeGolf/status/949351348394430465
added 84 characters in body
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
added 8 characters in body
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
added 71 characters in body
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186
Loading