"… and if they have eggs, get a dozen, " she added.

He later came home with 12 gallons of milk.

“Why’d you get so much milk!?!” his wife asked.

He replies, “THEY HAD EGGS!”

        • CallMeAl (like Alan)@piefed.zip
          link
          fedilink
          English
          arrow-up
          11
          arrow-down
          4
          ·
          6 days ago

          Doesn’t change it.

          Wife adds 1 gallon of milk to shopping list;

          Wife adds ( eggs, dozen) gallons of milk to shopping list;

          Shopping list has 1 gallon and a dozen gallons for a total of 13 gallons.

          • vinnymac@lemmy.world
            link
            fedilink
            arrow-up
            10
            ·
            edit-2
            5 days ago

            The shopping list doesn’t need to be additive, that’s just one way of interpreting what the wife wrote. There is no one correct way to read a joke as a program (my whole point), that is unless you write an interpreter for jokes :P

            function getGallonOfMilk() {
              return 1;
            }
            
            function getDozen() {
              return 12;
            }
            
            const hasEggs = store.checkInventory(“eggs”);
            
            const result = (
              getGallonOfMilk(),
              hasEggs && getDozen()
            );
            
            console.log(result * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛
            
          • GoatSynagogue@lemmy.world
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            4 days ago

            1 gallon. If they have eggs, get a dozen.

            If you take that as anything other than a dozen gallons, ie 12 gallons, you’re wrong.