Found a lovely output for BOOL in the solution!


#1

In three lines!

    NSTimeZone *LouKY = [NSTimeZone systemTimeZone];
    BOOL LouKYDST = [LouKY isDaylightSavingTime];
    NSLog(@"Is it currently Daylight Savings Time in Louisville? %s", LouKYDST ? "YES" : "NO");

I will use this output method for BOOL as long as I live :mrgreen:


#2

Cool. I always use %i and pass the BOOL value, which returns 0 if false/NO and 1 if true/YES. But I like your approach.


#3

Ahhh yes I remember reading about this. Can’t believe I forgot!


#4

Nice! :smiley:


#5

[quote=“Suraya”]In three lines!
[/quote]

That’s wonderful! I forgot all about the ? :
Funny, in only 13 chapters we all try our best to write as little lines of code as possible :slight_smile:


#6

Taking it to extremes … one line

        NSLog(@"is it currently DST? %s", [[NSTimeZone systemTimeZone] isDaylightSavingTime] ? "yes" : "no");

I’m beginning to enjoy this game … and there was me thinking I was an old mainframe dinosaur :slight_smile:

Sorry being a smartar$e (for our colonial cousins smarta$$)