Skip to main content
added 96 characters in body
Source Link
LiefdeWen
  • 3.9k
  • 16
  • 38

C# (.NET Core), 55 5454 48 bytes

Try it online!Try it online!

Saved 1 byte thanks to Shaggy

Saved 5 byte thanks to Emigna

Saved 1 byte thanks to Kevin Cruijssen

()=>_=>{var k=0;k=Systemk=1/(int)System.DateTime.Now.DayOfWeek>0?0:1/k;DayOfWeek;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

C# (.NET Core), 55 54 bytes

Try it online!

Saved 1 byte thanks to Shaggy

()=>{var k=0;k=System.DateTime.Now.DayOfWeek>0?0:1/k;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

C# (.NET Core), 55 54 48 bytes

Try it online!

Saved 1 byte thanks to Shaggy

Saved 5 byte thanks to Emigna

Saved 1 byte thanks to Kevin Cruijssen

_=>{var k=1/(int)System.DateTime.Now.DayOfWeek;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

added 84 characters in body
Source Link
LiefdeWen
  • 3.9k
  • 16
  • 38

C# (.NET Core)C# (.NET Core), 5555 54 bytes

Try it online!Try it online!

Saved 1 byte thanks to Shaggy

()=>{var k=0;k=System.DateTime.Now.DayOfWeek==0DayOfWeek>0?0:1/k:0;k;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

C# (.NET Core), 55 bytes

Try it online!

()=>{var k=0;k=System.DateTime.Now.DayOfWeek==0?1/k:0;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

C# (.NET Core), 55 54 bytes

Try it online!

Saved 1 byte thanks to Shaggy

()=>{var k=0;k=System.DateTime.Now.DayOfWeek>0?0:1/k;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7

Source Link
LiefdeWen
  • 3.9k
  • 16
  • 38

C# (.NET Core), 55 bytes

Try it online!

()=>{var k=0;k=System.DateTime.Now.DayOfWeek==0?1/k:0;}

Lucky that Sunday is indexed 0 in enum or else it would've needed to be (System.DayOfWeek)7