• 0 Posts
  • 181 Comments
Joined 11 months ago
cake
Cake day: July 31st, 2023

help-circle













  • paholg@lemm.eetoHelldivers 2@lemmy.caTheoretically speaking, of course
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    3 months ago

    No, that’s the point of the comment you’re responding to. It’s painfully obvious that the bugs have no way to fling asteroids into the Earth, and the only “evidence” that it was the bugs is in-universe propaganda.

    You can make the most over-the-top satire in the world, and people still won’t get it.



  • paholg@lemm.eetoProgrammer Humor@programming.devExam Answer
    link
    fedilink
    English
    arrow-up
    21
    ·
    4 months ago

    Works even better in Ruby, as the code as given is valid, you just need to monkey patch length:

    #!/usr/bin/env ruby
    
    module DayLength
      def length
        if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self
          "24 hours"
        else
          super
        end
      end
    end
    
    class String
      prepend DayLength
    end
    
    day = "Monday"
    
    x = day.length
    
    print(x)
    

  • paholg@lemm.eetoProgrammer Humor@programming.devExam Answer
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    4 months ago

    It could be Ruby; puts is more common, but there is a print. With some silly context, the answer could even be correct:

    #!/usr/bin/env ruby
    
    module DayLength
      def length
        if ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].include? self
          "24 hours"
        else
          super
        end
      end
    end
    
    class String
      prepend DayLength
    end
    
    day = "Monday"
    
    x = day.length
    
    print(x)