Is there a smaller tautogram checker? [closed]“Convenient palindrome” checkerPrelude Syntax-CheckerRecreate the sentenceHuman Friendly Filename DetectionDon't break the bridges!VEVO User Account CheckerIsogram checkerCheckers CheckerDraw the Easter BunnyHavel-to-da-Hakimi

How to factor a fourth degree polynomial

What's the big deal about the Nazgûl losing their horses?

How to play a D major chord lower than the open E major chord on guitar?

Examples of fluid (including air) being used to transmit digital data?

Park the computer

What is this airplane with small wings at different angles seen at Paphos Airport?

What is the highest level of accuracy in motion control a Victorian society could achieve?

How do I talk to my wife about unrealistic expectations?

Why do we need a bootloader separate from our application program in microcontrollers?

Groups where no elements commute except for the trivial cases

Machine Learning Golf: Multiplication

Did William Shakespeare hide things in his writings?

What's the difference between a type and a kind?

How predictable is $RANDOM really?

Alternative to Willpower in Fighting Cravings

Gory anime with pink haired girl escaping an asylum

Why did Super-VGA offer the 5:4 1280*1024 resolution?

Computer name naming convention for security

Wouldn't putting an electronic key inside a small Faraday cage render it completely useless?

Is this car delivery via Ebay Motors on Craigslist a scam?

Soda water first stored in refrigerator and then outside

How can I use my cell phone's light as a reading light?

Why do people prefer metropolitan areas, considering monsters and villains?

How complicated can a finite double complex over a field be?



Is there a smaller tautogram checker? [closed]


“Convenient palindrome” checkerPrelude Syntax-CheckerRecreate the sentenceHuman Friendly Filename DetectionDon't break the bridges!VEVO User Account CheckerIsogram checkerCheckers CheckerDraw the Easter BunnyHavel-to-da-Hakimi






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








10












$begingroup$


I got into code-golfing recently and tried to write the smallest tautogram checker.



A tautogram is a sentence in which all words start with the same letter, for example: Flowers flourish from France.



Given a sentence as input, determine whether it is a tautogram.



Test Cases



Flowers flourish from France
True

This is not a Tautogram
False


I came up with this python code (because it is my main language):



print(True if len(list(set([x.upper()[0] for x in __import__('sys').argv[1:]]))) == 1 else False)


Usage:



python3 tautogram.py Flowers flourish from France
# True
python3 tautogram.py This is not a Tautogram
# False


The sentence may contain commas and periods, but no other special characters, only upper and lower case letters and spaces.



Its size is 98 bytes. Is there a smaller solution in any language?










share|improve this question











$endgroup$



closed as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan Mar 25 at 22:26


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 1




    $begingroup$
    Is it intended as a tips question limited to Python? If so, these both tags should be added.
    $endgroup$
    – Arnauld
    Mar 25 at 19:26






  • 2




    $begingroup$
    Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
    $endgroup$
    – Magic Octopus Urn
    Mar 25 at 19:27







  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    Mar 25 at 19:35






  • 1




    $begingroup$
    @MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
    $endgroup$
    – Luis felipe De jesus Munoz
    Mar 25 at 19:45






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    Mar 25 at 20:10

















10












$begingroup$


I got into code-golfing recently and tried to write the smallest tautogram checker.



A tautogram is a sentence in which all words start with the same letter, for example: Flowers flourish from France.



Given a sentence as input, determine whether it is a tautogram.



Test Cases



Flowers flourish from France
True

This is not a Tautogram
False


I came up with this python code (because it is my main language):



print(True if len(list(set([x.upper()[0] for x in __import__('sys').argv[1:]]))) == 1 else False)


Usage:



python3 tautogram.py Flowers flourish from France
# True
python3 tautogram.py This is not a Tautogram
# False


The sentence may contain commas and periods, but no other special characters, only upper and lower case letters and spaces.



Its size is 98 bytes. Is there a smaller solution in any language?










share|improve this question











$endgroup$



closed as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan Mar 25 at 22:26


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 1




    $begingroup$
    Is it intended as a tips question limited to Python? If so, these both tags should be added.
    $endgroup$
    – Arnauld
    Mar 25 at 19:26






  • 2




    $begingroup$
    Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
    $endgroup$
    – Magic Octopus Urn
    Mar 25 at 19:27







  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    Mar 25 at 19:35






  • 1




    $begingroup$
    @MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
    $endgroup$
    – Luis felipe De jesus Munoz
    Mar 25 at 19:45






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    Mar 25 at 20:10













10












10








10





$begingroup$


I got into code-golfing recently and tried to write the smallest tautogram checker.



A tautogram is a sentence in which all words start with the same letter, for example: Flowers flourish from France.



Given a sentence as input, determine whether it is a tautogram.



Test Cases



Flowers flourish from France
True

This is not a Tautogram
False


I came up with this python code (because it is my main language):



print(True if len(list(set([x.upper()[0] for x in __import__('sys').argv[1:]]))) == 1 else False)


Usage:



python3 tautogram.py Flowers flourish from France
# True
python3 tautogram.py This is not a Tautogram
# False


The sentence may contain commas and periods, but no other special characters, only upper and lower case letters and spaces.



Its size is 98 bytes. Is there a smaller solution in any language?










share|improve this question











$endgroup$




I got into code-golfing recently and tried to write the smallest tautogram checker.



A tautogram is a sentence in which all words start with the same letter, for example: Flowers flourish from France.



Given a sentence as input, determine whether it is a tautogram.



Test Cases



Flowers flourish from France
True

This is not a Tautogram
False


I came up with this python code (because it is my main language):



print(True if len(list(set([x.upper()[0] for x in __import__('sys').argv[1:]]))) == 1 else False)


Usage:



python3 tautogram.py Flowers flourish from France
# True
python3 tautogram.py This is not a Tautogram
# False


The sentence may contain commas and periods, but no other special characters, only upper and lower case letters and spaces.



Its size is 98 bytes. Is there a smaller solution in any language?







code-golf string decision-problem






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 21:30









trichoplax

7,5866 gold badges43 silver badges76 bronze badges




7,5866 gold badges43 silver badges76 bronze badges










asked Mar 25 at 19:23









Jaime TenorioJaime Tenorio

514 bronze badges




514 bronze badges




closed as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan Mar 25 at 22:26


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan Mar 25 at 22:26


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    $begingroup$
    Is it intended as a tips question limited to Python? If so, these both tags should be added.
    $endgroup$
    – Arnauld
    Mar 25 at 19:26






  • 2




    $begingroup$
    Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
    $endgroup$
    – Magic Octopus Urn
    Mar 25 at 19:27







  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    Mar 25 at 19:35






  • 1




    $begingroup$
    @MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
    $endgroup$
    – Luis felipe De jesus Munoz
    Mar 25 at 19:45






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    Mar 25 at 20:10












  • 1




    $begingroup$
    Is it intended as a tips question limited to Python? If so, these both tags should be added.
    $endgroup$
    – Arnauld
    Mar 25 at 19:26






  • 2




    $begingroup$
    Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
    $endgroup$
    – Magic Octopus Urn
    Mar 25 at 19:27







  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    Mar 25 at 19:35






  • 1




    $begingroup$
    @MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
    $endgroup$
    – Luis felipe De jesus Munoz
    Mar 25 at 19:45






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    Mar 25 at 20:10







1




1




$begingroup$
Is it intended as a tips question limited to Python? If so, these both tags should be added.
$endgroup$
– Arnauld
Mar 25 at 19:26




$begingroup$
Is it intended as a tips question limited to Python? If so, these both tags should be added.
$endgroup$
– Arnauld
Mar 25 at 19:26




2




2




$begingroup$
Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
$endgroup$
– Magic Octopus Urn
Mar 25 at 19:27





$begingroup$
Heya friend! This site is usually reserved for explicitly defined problems. Things like "can the input contain punctuation" should be answered before posting, but other than that this is a great first question comparatively to the other new-user questions we usually see. Judging by your examples I'd just clarify that the only characters in the input will be "[A-Za-z ]" and your question will be purely objective. I'd scope out some other questions around here, else this may honestly be a better fit on overflow.
$endgroup$
– Magic Octopus Urn
Mar 25 at 19:27





1




1




$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
Mar 25 at 19:35




$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
Mar 25 at 19:35




1




1




$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
Mar 25 at 19:45




$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
Mar 25 at 19:45




6




6




$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
Mar 25 at 20:10




$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
Mar 25 at 20:10










13 Answers
13






active

oldest

votes


















7












$begingroup$


05AB1E, 5 bytes



l#€нË


Try it online!




l # Lowercase input.
# # Split on spaces.
€н # a[0] of each.
Ë # All equal?


Did this on mobile excuse the no explanation.






share|improve this answer











$endgroup$




















    4












    $begingroup$


    Python 2, 47 bytes





    lambda s:len(set(zip(*s.lower().split())[0]))<2


    Try it online!



    Came up with this on mobile. Can probably be golfed more.






    share|improve this answer









    $endgroup$




















      3












      $begingroup$


      Clojure, 80 bytes



      Try it online!. TIO doesn't support Clojure's standard String library though, so the first version will throw a "Can't find lower-case" error.





      (fn[s](use '[clojure.string])(apply =(map first(map lower-case(split s #" ")))))


      Ungolfed:



      (defn tautogram? [s]
      (use '[clojure.string])
      (->> (split s #" ") ; Get words
      (map lower-case)
      (map first) ; Get first letter of each word
      (apply =))) ; And make sure they're all the same


      I made a version that avoids the import:



      (fn [s](apply =(map #(if(<(-(int %)32)65)(int %)(-(int %) 32))(map first(take-nth 2(partition-by #(= % )s))))))

      ; -----

      (defn tautogram? [s]
      (->> s
      (partition-by #(= % )) ; Split into words
      (take-nth 2) ; Remove spaces
      (map first) ; Get first letter
      ; Convert to uppercased letter code
      (map #(if (< (- (int %) 32) 65) ; If attempting to uppercase puts the letter out of range,
      (int %) ; Go with the current code
      (- (int %) 32))) ; Else go with the uppercased code
      (apply =))) ; And check if they're all equal


      But it's 112 Bytes.






      share|improve this answer











      $endgroup$












      • $begingroup$
        Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
        $endgroup$
        – Galen Ivanov
        Mar 26 at 7:18










      • $begingroup$
        Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
        $endgroup$
        – Galen Ivanov
        Mar 26 at 7:47


















      3












      $begingroup$


      PowerShell, 57 50 41 bytes





      (-split$args|% s*g 0 1|sort -u).count-eq1


      Try it online!



      Takes input and splits it on whitespace. Loops through each word, and grabs the first letter by taking the substring starting at position 0 and going for 1 character. Then sorts the letters (case-insensitive by default) with the -unique flag to pull out only one copy of each letter, and verifies the count of those names are -equal to 1. Output is implicit.



      -9 bytes thanks to mazzy.






      share|improve this answer











      $endgroup$












      • $begingroup$
        41 bytes
        $endgroup$
        – mazzy
        Mar 26 at 5:43










      • $begingroup$
        35 bytes with regexp
        $endgroup$
        – mazzy
        Mar 26 at 8:01






      • 1




        $begingroup$
        @mazzy fixed trying to understand the intention
        $endgroup$
        – Nahuel Fouilleul
        Mar 26 at 8:36










      • $begingroup$
        @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
        $endgroup$
        – AdmBorkBork
        Mar 26 at 12:29










      • $begingroup$
        I'm agree. but this question is put on hold, so I can't create a new answer.
        $endgroup$
        – mazzy
        Mar 26 at 15:27



















      2












      $begingroup$


      05AB1E (legacy), 5 bytes



      #€¬uË


      Try it online!



      # // split on spaces
      €¬ // get the first letter of each word
      uË // check if they're the same (uppercase) letter





      share|improve this answer









      $endgroup$




















        2












        $begingroup$


        Brachylog, 5 bytes



        ḷṇ₁hᵛ


        Try it online!



         The input
        ḷ lowercased
        ṇ₁ and split on spaces
        hᵛ is a list of elements which all start with the same thing.





        share|improve this answer









        $endgroup$












        • $begingroup$
          I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
          $endgroup$
          – Unrelated String
          Mar 25 at 22:13


















        2












        $begingroup$


        Haskell, 71 bytes





        f s|c<-fromEnum.head<$>words s=all(`elem`[-32,0,32]).zipWith(-)c$tail c


        Try it online!





        Haskell, 61 58 bytes (using Data.Char.toLower)



        • Saved three bytes thanks to nimi.

        import Data.Char
        (all=<<(==).head).(toLower.head<$>).words


        Try it online!






        share|improve this answer











        $endgroup$












        • $begingroup$
          @nimi Thank you.
          $endgroup$
          – Jonathan Frech
          Mar 25 at 23:15


















        2












        $begingroup$

        Perl 5 (-p), 20 bytes



        $_=!/^(.).* (?!1)/i


        TIO



        following comments in case bad punctuation (31 bytes)



        $_=!/^W*+(.).*(?=bw)(?!1)/i


        31 bytes



        otherwise there's another approach, also with 31 bytes:



        $hord()%32++for/w+/g;$_=2>%h


        31 bytes other






        share|improve this answer











        $endgroup$












        • $begingroup$
          what about punctuations? what about spaces or punctuations at the strart of string?
          $endgroup$
          – mazzy
          Mar 26 at 7:49










        • $begingroup$
          this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
          $endgroup$
          – Nahuel Fouilleul
          Mar 26 at 8:06










        • $begingroup$
          but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
          $endgroup$
          – Nahuel Fouilleul
          Mar 26 at 8:14


















        1












        $begingroup$


        JavaScript (Node.js), 54 bytes





        s=>!s.match(/bw+/g).some(p=s=>p-(p=Buffer(s)[0]&31))


        Try it online!



        Or 47 bytes if each word (but the first) is guaranteed to be preceded by a space.






        share|improve this answer









        $endgroup$












        • $begingroup$
          or in one regex or with a space instead of W
          $endgroup$
          – Nahuel Fouilleul
          Mar 25 at 20:35











        • $begingroup$
          @NahuelFouilleul, using test saves another byte.
          $endgroup$
          – Shaggy
          Mar 25 at 20:45






        • 1




          $begingroup$
          @NahuelFouilleul You should probably post is separately.
          $endgroup$
          – Arnauld
          Mar 25 at 20:55










        • $begingroup$
          already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
          $endgroup$
          – Nahuel Fouilleul
          Mar 25 at 21:08


















        1












        $begingroup$


        Japt , 5 bytes



        ¸mÎro


        Try it



        ¸mÎro :Implicit input of string
        ¸ :Split on spaces
        m :Map
        Î : Get first character
        r :Reduce by
        o : Keeping the characters that appear in both, case-insensitive
        :Implicit output as boolean





        share|improve this answer









        $endgroup$




















          1












          $begingroup$


          C# (Visual C# Interactive Compiler), 41 bytes





          n=>n.Split().GroupBy(c=>c[0]|32).Single()


          Throws an exception if false, nothing if true.



          Try it online!






          share|improve this answer









          $endgroup$




















            1












            $begingroup$


            Perl 6, 19 bytes





            [eq] m:g/<<./o&lc


            Try it online!






            share|improve this answer









            $endgroup$




















              1












              $begingroup$

              Java, (36 bytes)



              s->!s.matches("(?i)(.).* (?!\1).*")


              TIO






              share|improve this answer









              $endgroup$








              • 1




                $begingroup$
                I think the input is allowed to start with a space, and this doesn't work for input like that.
                $endgroup$
                – Sara J
                Mar 25 at 22:13











              • $begingroup$
                indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                $endgroup$
                – Nahuel Fouilleul
                Mar 26 at 6:32











              • $begingroup$
                however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                $endgroup$
                – Nahuel Fouilleul
                Mar 26 at 10:19



















              13 Answers
              13






              active

              oldest

              votes








              13 Answers
              13






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              7












              $begingroup$


              05AB1E, 5 bytes



              l#€нË


              Try it online!




              l # Lowercase input.
              # # Split on spaces.
              €н # a[0] of each.
              Ë # All equal?


              Did this on mobile excuse the no explanation.






              share|improve this answer











              $endgroup$

















                7












                $begingroup$


                05AB1E, 5 bytes



                l#€нË


                Try it online!




                l # Lowercase input.
                # # Split on spaces.
                €н # a[0] of each.
                Ë # All equal?


                Did this on mobile excuse the no explanation.






                share|improve this answer











                $endgroup$















                  7












                  7








                  7





                  $begingroup$


                  05AB1E, 5 bytes



                  l#€нË


                  Try it online!




                  l # Lowercase input.
                  # # Split on spaces.
                  €н # a[0] of each.
                  Ë # All equal?


                  Did this on mobile excuse the no explanation.






                  share|improve this answer











                  $endgroup$




                  05AB1E, 5 bytes



                  l#€нË


                  Try it online!




                  l # Lowercase input.
                  # # Split on spaces.
                  €н # a[0] of each.
                  Ë # All equal?


                  Did this on mobile excuse the no explanation.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 26 at 13:27









                  Jo King

                  29.4k3 gold badges69 silver badges135 bronze badges




                  29.4k3 gold badges69 silver badges135 bronze badges










                  answered Mar 25 at 20:18









                  Magic Octopus UrnMagic Octopus Urn

                  13.2k4 gold badges47 silver badges127 bronze badges




                  13.2k4 gold badges47 silver badges127 bronze badges























                      4












                      $begingroup$


                      Python 2, 47 bytes





                      lambda s:len(set(zip(*s.lower().split())[0]))<2


                      Try it online!



                      Came up with this on mobile. Can probably be golfed more.






                      share|improve this answer









                      $endgroup$

















                        4












                        $begingroup$


                        Python 2, 47 bytes





                        lambda s:len(set(zip(*s.lower().split())[0]))<2


                        Try it online!



                        Came up with this on mobile. Can probably be golfed more.






                        share|improve this answer









                        $endgroup$















                          4












                          4








                          4





                          $begingroup$


                          Python 2, 47 bytes





                          lambda s:len(set(zip(*s.lower().split())[0]))<2


                          Try it online!



                          Came up with this on mobile. Can probably be golfed more.






                          share|improve this answer









                          $endgroup$




                          Python 2, 47 bytes





                          lambda s:len(set(zip(*s.lower().split())[0]))<2


                          Try it online!



                          Came up with this on mobile. Can probably be golfed more.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 25 at 19:59









                          TFeldTFeld

                          17.4k3 gold badges14 silver badges54 bronze badges




                          17.4k3 gold badges14 silver badges54 bronze badges





















                              3












                              $begingroup$


                              Clojure, 80 bytes



                              Try it online!. TIO doesn't support Clojure's standard String library though, so the first version will throw a "Can't find lower-case" error.





                              (fn[s](use '[clojure.string])(apply =(map first(map lower-case(split s #" ")))))


                              Ungolfed:



                              (defn tautogram? [s]
                              (use '[clojure.string])
                              (->> (split s #" ") ; Get words
                              (map lower-case)
                              (map first) ; Get first letter of each word
                              (apply =))) ; And make sure they're all the same


                              I made a version that avoids the import:



                              (fn [s](apply =(map #(if(<(-(int %)32)65)(int %)(-(int %) 32))(map first(take-nth 2(partition-by #(= % )s))))))

                              ; -----

                              (defn tautogram? [s]
                              (->> s
                              (partition-by #(= % )) ; Split into words
                              (take-nth 2) ; Remove spaces
                              (map first) ; Get first letter
                              ; Convert to uppercased letter code
                              (map #(if (< (- (int %) 32) 65) ; If attempting to uppercase puts the letter out of range,
                              (int %) ; Go with the current code
                              (- (int %) 32))) ; Else go with the uppercased code
                              (apply =))) ; And check if they're all equal


                              But it's 112 Bytes.






                              share|improve this answer











                              $endgroup$












                              • $begingroup$
                                Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:18










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:47















                              3












                              $begingroup$


                              Clojure, 80 bytes



                              Try it online!. TIO doesn't support Clojure's standard String library though, so the first version will throw a "Can't find lower-case" error.





                              (fn[s](use '[clojure.string])(apply =(map first(map lower-case(split s #" ")))))


                              Ungolfed:



                              (defn tautogram? [s]
                              (use '[clojure.string])
                              (->> (split s #" ") ; Get words
                              (map lower-case)
                              (map first) ; Get first letter of each word
                              (apply =))) ; And make sure they're all the same


                              I made a version that avoids the import:



                              (fn [s](apply =(map #(if(<(-(int %)32)65)(int %)(-(int %) 32))(map first(take-nth 2(partition-by #(= % )s))))))

                              ; -----

                              (defn tautogram? [s]
                              (->> s
                              (partition-by #(= % )) ; Split into words
                              (take-nth 2) ; Remove spaces
                              (map first) ; Get first letter
                              ; Convert to uppercased letter code
                              (map #(if (< (- (int %) 32) 65) ; If attempting to uppercase puts the letter out of range,
                              (int %) ; Go with the current code
                              (- (int %) 32))) ; Else go with the uppercased code
                              (apply =))) ; And check if they're all equal


                              But it's 112 Bytes.






                              share|improve this answer











                              $endgroup$












                              • $begingroup$
                                Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:18










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:47













                              3












                              3








                              3





                              $begingroup$


                              Clojure, 80 bytes



                              Try it online!. TIO doesn't support Clojure's standard String library though, so the first version will throw a "Can't find lower-case" error.





                              (fn[s](use '[clojure.string])(apply =(map first(map lower-case(split s #" ")))))


                              Ungolfed:



                              (defn tautogram? [s]
                              (use '[clojure.string])
                              (->> (split s #" ") ; Get words
                              (map lower-case)
                              (map first) ; Get first letter of each word
                              (apply =))) ; And make sure they're all the same


                              I made a version that avoids the import:



                              (fn [s](apply =(map #(if(<(-(int %)32)65)(int %)(-(int %) 32))(map first(take-nth 2(partition-by #(= % )s))))))

                              ; -----

                              (defn tautogram? [s]
                              (->> s
                              (partition-by #(= % )) ; Split into words
                              (take-nth 2) ; Remove spaces
                              (map first) ; Get first letter
                              ; Convert to uppercased letter code
                              (map #(if (< (- (int %) 32) 65) ; If attempting to uppercase puts the letter out of range,
                              (int %) ; Go with the current code
                              (- (int %) 32))) ; Else go with the uppercased code
                              (apply =))) ; And check if they're all equal


                              But it's 112 Bytes.






                              share|improve this answer











                              $endgroup$




                              Clojure, 80 bytes



                              Try it online!. TIO doesn't support Clojure's standard String library though, so the first version will throw a "Can't find lower-case" error.





                              (fn[s](use '[clojure.string])(apply =(map first(map lower-case(split s #" ")))))


                              Ungolfed:



                              (defn tautogram? [s]
                              (use '[clojure.string])
                              (->> (split s #" ") ; Get words
                              (map lower-case)
                              (map first) ; Get first letter of each word
                              (apply =))) ; And make sure they're all the same


                              I made a version that avoids the import:



                              (fn [s](apply =(map #(if(<(-(int %)32)65)(int %)(-(int %) 32))(map first(take-nth 2(partition-by #(= % )s))))))

                              ; -----

                              (defn tautogram? [s]
                              (->> s
                              (partition-by #(= % )) ; Split into words
                              (take-nth 2) ; Remove spaces
                              (map first) ; Get first letter
                              ; Convert to uppercased letter code
                              (map #(if (< (- (int %) 32) 65) ; If attempting to uppercase puts the letter out of range,
                              (int %) ; Go with the current code
                              (- (int %) 32))) ; Else go with the uppercased code
                              (apply =))) ; And check if they're all equal


                              But it's 112 Bytes.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Mar 25 at 22:19

























                              answered Mar 25 at 22:12









                              CarcigenicateCarcigenicate

                              2,3291 gold badge12 silver badges24 bronze badges




                              2,3291 gold badge12 silver badges24 bronze badges











                              • $begingroup$
                                Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:18










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:47
















                              • $begingroup$
                                Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:18










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                Mar 26 at 7:47















                              $begingroup$
                              Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                              $endgroup$
                              – Galen Ivanov
                              Mar 26 at 7:18




                              $begingroup$
                              Here's my Racket solution: (define(f s)(apply char=?(map(λ(x)(char-upcase(car(string->list x))))(string-split s))))
                              $endgroup$
                              – Galen Ivanov
                              Mar 26 at 7:18












                              $begingroup$
                              Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                              $endgroup$
                              – Galen Ivanov
                              Mar 26 at 7:47




                              $begingroup$
                              Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                              $endgroup$
                              – Galen Ivanov
                              Mar 26 at 7:47











                              3












                              $begingroup$


                              PowerShell, 57 50 41 bytes





                              (-split$args|% s*g 0 1|sort -u).count-eq1


                              Try it online!



                              Takes input and splits it on whitespace. Loops through each word, and grabs the first letter by taking the substring starting at position 0 and going for 1 character. Then sorts the letters (case-insensitive by default) with the -unique flag to pull out only one copy of each letter, and verifies the count of those names are -equal to 1. Output is implicit.



                              -9 bytes thanks to mazzy.






                              share|improve this answer











                              $endgroup$












                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                Mar 26 at 5:43










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                Mar 26 at 8:01






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                Mar 26 at 8:36










                              • $begingroup$
                                @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                                $endgroup$
                                – AdmBorkBork
                                Mar 26 at 12:29










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                Mar 26 at 15:27
















                              3












                              $begingroup$


                              PowerShell, 57 50 41 bytes





                              (-split$args|% s*g 0 1|sort -u).count-eq1


                              Try it online!



                              Takes input and splits it on whitespace. Loops through each word, and grabs the first letter by taking the substring starting at position 0 and going for 1 character. Then sorts the letters (case-insensitive by default) with the -unique flag to pull out only one copy of each letter, and verifies the count of those names are -equal to 1. Output is implicit.



                              -9 bytes thanks to mazzy.






                              share|improve this answer











                              $endgroup$












                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                Mar 26 at 5:43










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                Mar 26 at 8:01






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                Mar 26 at 8:36










                              • $begingroup$
                                @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                                $endgroup$
                                – AdmBorkBork
                                Mar 26 at 12:29










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                Mar 26 at 15:27














                              3












                              3








                              3





                              $begingroup$


                              PowerShell, 57 50 41 bytes





                              (-split$args|% s*g 0 1|sort -u).count-eq1


                              Try it online!



                              Takes input and splits it on whitespace. Loops through each word, and grabs the first letter by taking the substring starting at position 0 and going for 1 character. Then sorts the letters (case-insensitive by default) with the -unique flag to pull out only one copy of each letter, and verifies the count of those names are -equal to 1. Output is implicit.



                              -9 bytes thanks to mazzy.






                              share|improve this answer











                              $endgroup$




                              PowerShell, 57 50 41 bytes





                              (-split$args|% s*g 0 1|sort -u).count-eq1


                              Try it online!



                              Takes input and splits it on whitespace. Loops through each word, and grabs the first letter by taking the substring starting at position 0 and going for 1 character. Then sorts the letters (case-insensitive by default) with the -unique flag to pull out only one copy of each letter, and verifies the count of those names are -equal to 1. Output is implicit.



                              -9 bytes thanks to mazzy.







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Mar 26 at 12:29

























                              answered Mar 25 at 20:05









                              AdmBorkBorkAdmBorkBork

                              28.4k4 gold badges70 silver badges245 bronze badges




                              28.4k4 gold badges70 silver badges245 bronze badges











                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                Mar 26 at 5:43










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                Mar 26 at 8:01






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                Mar 26 at 8:36










                              • $begingroup$
                                @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                                $endgroup$
                                – AdmBorkBork
                                Mar 26 at 12:29










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                Mar 26 at 15:27

















                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                Mar 26 at 5:43










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                Mar 26 at 8:01






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                Mar 26 at 8:36










                              • $begingroup$
                                @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                                $endgroup$
                                – AdmBorkBork
                                Mar 26 at 12:29










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                Mar 26 at 15:27
















                              $begingroup$
                              41 bytes
                              $endgroup$
                              – mazzy
                              Mar 26 at 5:43




                              $begingroup$
                              41 bytes
                              $endgroup$
                              – mazzy
                              Mar 26 at 5:43












                              $begingroup$
                              35 bytes with regexp
                              $endgroup$
                              – mazzy
                              Mar 26 at 8:01




                              $begingroup$
                              35 bytes with regexp
                              $endgroup$
                              – mazzy
                              Mar 26 at 8:01




                              1




                              1




                              $begingroup$
                              @mazzy fixed trying to understand the intention
                              $endgroup$
                              – Nahuel Fouilleul
                              Mar 26 at 8:36




                              $begingroup$
                              @mazzy fixed trying to understand the intention
                              $endgroup$
                              – Nahuel Fouilleul
                              Mar 26 at 8:36












                              $begingroup$
                              @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                              $endgroup$
                              – AdmBorkBork
                              Mar 26 at 12:29




                              $begingroup$
                              @mazzy I'll let you post the regex version when the question is reopened. It's different enough to warrant its own answer.
                              $endgroup$
                              – AdmBorkBork
                              Mar 26 at 12:29












                              $begingroup$
                              I'm agree. but this question is put on hold, so I can't create a new answer.
                              $endgroup$
                              – mazzy
                              Mar 26 at 15:27





                              $begingroup$
                              I'm agree. but this question is put on hold, so I can't create a new answer.
                              $endgroup$
                              – mazzy
                              Mar 26 at 15:27












                              2












                              $begingroup$


                              05AB1E (legacy), 5 bytes



                              #€¬uË


                              Try it online!



                              # // split on spaces
                              €¬ // get the first letter of each word
                              uË // check if they're the same (uppercase) letter





                              share|improve this answer









                              $endgroup$

















                                2












                                $begingroup$


                                05AB1E (legacy), 5 bytes



                                #€¬uË


                                Try it online!



                                # // split on spaces
                                €¬ // get the first letter of each word
                                uË // check if they're the same (uppercase) letter





                                share|improve this answer









                                $endgroup$















                                  2












                                  2








                                  2





                                  $begingroup$


                                  05AB1E (legacy), 5 bytes



                                  #€¬uË


                                  Try it online!



                                  # // split on spaces
                                  €¬ // get the first letter of each word
                                  uË // check if they're the same (uppercase) letter





                                  share|improve this answer









                                  $endgroup$




                                  05AB1E (legacy), 5 bytes



                                  #€¬uË


                                  Try it online!



                                  # // split on spaces
                                  €¬ // get the first letter of each word
                                  uË // check if they're the same (uppercase) letter






                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Mar 25 at 20:24









                                  RileyRiley

                                  11.1k1 gold badge15 silver badges48 bronze badges




                                  11.1k1 gold badge15 silver badges48 bronze badges





















                                      2












                                      $begingroup$


                                      Brachylog, 5 bytes



                                      ḷṇ₁hᵛ


                                      Try it online!



                                       The input
                                      ḷ lowercased
                                      ṇ₁ and split on spaces
                                      hᵛ is a list of elements which all start with the same thing.





                                      share|improve this answer









                                      $endgroup$












                                      • $begingroup$
                                        I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                        $endgroup$
                                        – Unrelated String
                                        Mar 25 at 22:13















                                      2












                                      $begingroup$


                                      Brachylog, 5 bytes



                                      ḷṇ₁hᵛ


                                      Try it online!



                                       The input
                                      ḷ lowercased
                                      ṇ₁ and split on spaces
                                      hᵛ is a list of elements which all start with the same thing.





                                      share|improve this answer









                                      $endgroup$












                                      • $begingroup$
                                        I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                        $endgroup$
                                        – Unrelated String
                                        Mar 25 at 22:13













                                      2












                                      2








                                      2





                                      $begingroup$


                                      Brachylog, 5 bytes



                                      ḷṇ₁hᵛ


                                      Try it online!



                                       The input
                                      ḷ lowercased
                                      ṇ₁ and split on spaces
                                      hᵛ is a list of elements which all start with the same thing.





                                      share|improve this answer









                                      $endgroup$




                                      Brachylog, 5 bytes



                                      ḷṇ₁hᵛ


                                      Try it online!



                                       The input
                                      ḷ lowercased
                                      ṇ₁ and split on spaces
                                      hᵛ is a list of elements which all start with the same thing.






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 25 at 22:10









                                      Unrelated StringUnrelated String

                                      2,7352 gold badges3 silver badges14 bronze badges




                                      2,7352 gold badges3 silver badges14 bronze badges











                                      • $begingroup$
                                        I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                        $endgroup$
                                        – Unrelated String
                                        Mar 25 at 22:13
















                                      • $begingroup$
                                        I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                        $endgroup$
                                        – Unrelated String
                                        Mar 25 at 22:13















                                      $begingroup$
                                      I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                      $endgroup$
                                      – Unrelated String
                                      Mar 25 at 22:13




                                      $begingroup$
                                      I just now noticed that this has to be able to handle punctuation, but without any punctuated test cases I can't tell if this does or doesn't still work...
                                      $endgroup$
                                      – Unrelated String
                                      Mar 25 at 22:13











                                      2












                                      $begingroup$


                                      Haskell, 71 bytes





                                      f s|c<-fromEnum.head<$>words s=all(`elem`[-32,0,32]).zipWith(-)c$tail c


                                      Try it online!





                                      Haskell, 61 58 bytes (using Data.Char.toLower)



                                      • Saved three bytes thanks to nimi.

                                      import Data.Char
                                      (all=<<(==).head).(toLower.head<$>).words


                                      Try it online!






                                      share|improve this answer











                                      $endgroup$












                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        Mar 25 at 23:15















                                      2












                                      $begingroup$


                                      Haskell, 71 bytes





                                      f s|c<-fromEnum.head<$>words s=all(`elem`[-32,0,32]).zipWith(-)c$tail c


                                      Try it online!





                                      Haskell, 61 58 bytes (using Data.Char.toLower)



                                      • Saved three bytes thanks to nimi.

                                      import Data.Char
                                      (all=<<(==).head).(toLower.head<$>).words


                                      Try it online!






                                      share|improve this answer











                                      $endgroup$












                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        Mar 25 at 23:15













                                      2












                                      2








                                      2





                                      $begingroup$


                                      Haskell, 71 bytes





                                      f s|c<-fromEnum.head<$>words s=all(`elem`[-32,0,32]).zipWith(-)c$tail c


                                      Try it online!





                                      Haskell, 61 58 bytes (using Data.Char.toLower)



                                      • Saved three bytes thanks to nimi.

                                      import Data.Char
                                      (all=<<(==).head).(toLower.head<$>).words


                                      Try it online!






                                      share|improve this answer











                                      $endgroup$




                                      Haskell, 71 bytes





                                      f s|c<-fromEnum.head<$>words s=all(`elem`[-32,0,32]).zipWith(-)c$tail c


                                      Try it online!





                                      Haskell, 61 58 bytes (using Data.Char.toLower)



                                      • Saved three bytes thanks to nimi.

                                      import Data.Char
                                      (all=<<(==).head).(toLower.head<$>).words


                                      Try it online!







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Mar 25 at 23:15

























                                      answered Mar 25 at 20:11









                                      Jonathan FrechJonathan Frech

                                      6,5011 gold badge11 silver badges40 bronze badges




                                      6,5011 gold badge11 silver badges40 bronze badges











                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        Mar 25 at 23:15
















                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        Mar 25 at 23:15















                                      $begingroup$
                                      @nimi Thank you.
                                      $endgroup$
                                      – Jonathan Frech
                                      Mar 25 at 23:15




                                      $begingroup$
                                      @nimi Thank you.
                                      $endgroup$
                                      – Jonathan Frech
                                      Mar 25 at 23:15











                                      2












                                      $begingroup$

                                      Perl 5 (-p), 20 bytes



                                      $_=!/^(.).* (?!1)/i


                                      TIO



                                      following comments in case bad punctuation (31 bytes)



                                      $_=!/^W*+(.).*(?=bw)(?!1)/i


                                      31 bytes



                                      otherwise there's another approach, also with 31 bytes:



                                      $hord()%32++for/w+/g;$_=2>%h


                                      31 bytes other






                                      share|improve this answer











                                      $endgroup$












                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        Mar 26 at 7:49










                                      • $begingroup$
                                        this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:06










                                      • $begingroup$
                                        but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:14















                                      2












                                      $begingroup$

                                      Perl 5 (-p), 20 bytes



                                      $_=!/^(.).* (?!1)/i


                                      TIO



                                      following comments in case bad punctuation (31 bytes)



                                      $_=!/^W*+(.).*(?=bw)(?!1)/i


                                      31 bytes



                                      otherwise there's another approach, also with 31 bytes:



                                      $hord()%32++for/w+/g;$_=2>%h


                                      31 bytes other






                                      share|improve this answer











                                      $endgroup$












                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        Mar 26 at 7:49










                                      • $begingroup$
                                        this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:06










                                      • $begingroup$
                                        but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:14













                                      2












                                      2








                                      2





                                      $begingroup$

                                      Perl 5 (-p), 20 bytes



                                      $_=!/^(.).* (?!1)/i


                                      TIO



                                      following comments in case bad punctuation (31 bytes)



                                      $_=!/^W*+(.).*(?=bw)(?!1)/i


                                      31 bytes



                                      otherwise there's another approach, also with 31 bytes:



                                      $hord()%32++for/w+/g;$_=2>%h


                                      31 bytes other






                                      share|improve this answer











                                      $endgroup$



                                      Perl 5 (-p), 20 bytes



                                      $_=!/^(.).* (?!1)/i


                                      TIO



                                      following comments in case bad punctuation (31 bytes)



                                      $_=!/^W*+(.).*(?=bw)(?!1)/i


                                      31 bytes



                                      otherwise there's another approach, also with 31 bytes:



                                      $hord()%32++for/w+/g;$_=2>%h


                                      31 bytes other







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Mar 26 at 10:31

























                                      answered Mar 25 at 20:28









                                      Nahuel FouilleulNahuel Fouilleul

                                      3,6651 gold badge4 silver badges13 bronze badges




                                      3,6651 gold badge4 silver badges13 bronze badges











                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        Mar 26 at 7:49










                                      • $begingroup$
                                        this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:06










                                      • $begingroup$
                                        but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:14
















                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        Mar 26 at 7:49










                                      • $begingroup$
                                        this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:06










                                      • $begingroup$
                                        but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 26 at 8:14















                                      $begingroup$
                                      what about punctuations? what about spaces or punctuations at the strart of string?
                                      $endgroup$
                                      – mazzy
                                      Mar 26 at 7:49




                                      $begingroup$
                                      what about punctuations? what about spaces or punctuations at the strart of string?
                                      $endgroup$
                                      – mazzy
                                      Mar 26 at 7:49












                                      $begingroup$
                                      this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 26 at 8:06




                                      $begingroup$
                                      this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 26 at 8:06












                                      $begingroup$
                                      but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 26 at 8:14




                                      $begingroup$
                                      but reading carefuly the question and the given solution, spaces at beginning can't occur because the spaces are used by the shell to split the arguments. The program checks only that all arguments start with the same character
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 26 at 8:14











                                      1












                                      $begingroup$


                                      JavaScript (Node.js), 54 bytes





                                      s=>!s.match(/bw+/g).some(p=s=>p-(p=Buffer(s)[0]&31))


                                      Try it online!



                                      Or 47 bytes if each word (but the first) is guaranteed to be preceded by a space.






                                      share|improve this answer









                                      $endgroup$












                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 20:35











                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        Mar 25 at 20:45






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        Mar 25 at 20:55










                                      • $begingroup$
                                        already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 21:08















                                      1












                                      $begingroup$


                                      JavaScript (Node.js), 54 bytes





                                      s=>!s.match(/bw+/g).some(p=s=>p-(p=Buffer(s)[0]&31))


                                      Try it online!



                                      Or 47 bytes if each word (but the first) is guaranteed to be preceded by a space.






                                      share|improve this answer









                                      $endgroup$












                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 20:35











                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        Mar 25 at 20:45






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        Mar 25 at 20:55










                                      • $begingroup$
                                        already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 21:08













                                      1












                                      1








                                      1





                                      $begingroup$


                                      JavaScript (Node.js), 54 bytes





                                      s=>!s.match(/bw+/g).some(p=s=>p-(p=Buffer(s)[0]&31))


                                      Try it online!



                                      Or 47 bytes if each word (but the first) is guaranteed to be preceded by a space.






                                      share|improve this answer









                                      $endgroup$




                                      JavaScript (Node.js), 54 bytes





                                      s=>!s.match(/bw+/g).some(p=s=>p-(p=Buffer(s)[0]&31))


                                      Try it online!



                                      Or 47 bytes if each word (but the first) is guaranteed to be preceded by a space.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 25 at 20:05









                                      ArnauldArnauld

                                      87.7k7 gold badges102 silver badges358 bronze badges




                                      87.7k7 gold badges102 silver badges358 bronze badges











                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 20:35











                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        Mar 25 at 20:45






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        Mar 25 at 20:55










                                      • $begingroup$
                                        already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 21:08
















                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 20:35











                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        Mar 25 at 20:45






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        Mar 25 at 20:55










                                      • $begingroup$
                                        already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        Mar 25 at 21:08















                                      $begingroup$
                                      or in one regex or with a space instead of W
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 25 at 20:35





                                      $begingroup$
                                      or in one regex or with a space instead of W
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 25 at 20:35













                                      $begingroup$
                                      @NahuelFouilleul, using test saves another byte.
                                      $endgroup$
                                      – Shaggy
                                      Mar 25 at 20:45




                                      $begingroup$
                                      @NahuelFouilleul, using test saves another byte.
                                      $endgroup$
                                      – Shaggy
                                      Mar 25 at 20:45




                                      1




                                      1




                                      $begingroup$
                                      @NahuelFouilleul You should probably post is separately.
                                      $endgroup$
                                      – Arnauld
                                      Mar 25 at 20:55




                                      $begingroup$
                                      @NahuelFouilleul You should probably post is separately.
                                      $endgroup$
                                      – Arnauld
                                      Mar 25 at 20:55












                                      $begingroup$
                                      already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 25 at 21:08




                                      $begingroup$
                                      already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      Mar 25 at 21:08











                                      1












                                      $begingroup$


                                      Japt , 5 bytes



                                      ¸mÎro


                                      Try it



                                      ¸mÎro :Implicit input of string
                                      ¸ :Split on spaces
                                      m :Map
                                      Î : Get first character
                                      r :Reduce by
                                      o : Keeping the characters that appear in both, case-insensitive
                                      :Implicit output as boolean





                                      share|improve this answer









                                      $endgroup$

















                                        1












                                        $begingroup$


                                        Japt , 5 bytes



                                        ¸mÎro


                                        Try it



                                        ¸mÎro :Implicit input of string
                                        ¸ :Split on spaces
                                        m :Map
                                        Î : Get first character
                                        r :Reduce by
                                        o : Keeping the characters that appear in both, case-insensitive
                                        :Implicit output as boolean





                                        share|improve this answer









                                        $endgroup$















                                          1












                                          1








                                          1





                                          $begingroup$


                                          Japt , 5 bytes



                                          ¸mÎro


                                          Try it



                                          ¸mÎro :Implicit input of string
                                          ¸ :Split on spaces
                                          m :Map
                                          Î : Get first character
                                          r :Reduce by
                                          o : Keeping the characters that appear in both, case-insensitive
                                          :Implicit output as boolean





                                          share|improve this answer









                                          $endgroup$




                                          Japt , 5 bytes



                                          ¸mÎro


                                          Try it



                                          ¸mÎro :Implicit input of string
                                          ¸ :Split on spaces
                                          m :Map
                                          Î : Get first character
                                          r :Reduce by
                                          o : Keeping the characters that appear in both, case-insensitive
                                          :Implicit output as boolean






                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Mar 25 at 20:08









                                          ShaggyShaggy

                                          20.1k3 gold badges20 silver badges68 bronze badges




                                          20.1k3 gold badges20 silver badges68 bronze badges





















                                              1












                                              $begingroup$


                                              C# (Visual C# Interactive Compiler), 41 bytes





                                              n=>n.Split().GroupBy(c=>c[0]|32).Single()


                                              Throws an exception if false, nothing if true.



                                              Try it online!






                                              share|improve this answer









                                              $endgroup$

















                                                1












                                                $begingroup$


                                                C# (Visual C# Interactive Compiler), 41 bytes





                                                n=>n.Split().GroupBy(c=>c[0]|32).Single()


                                                Throws an exception if false, nothing if true.



                                                Try it online!






                                                share|improve this answer









                                                $endgroup$















                                                  1












                                                  1








                                                  1





                                                  $begingroup$


                                                  C# (Visual C# Interactive Compiler), 41 bytes





                                                  n=>n.Split().GroupBy(c=>c[0]|32).Single()


                                                  Throws an exception if false, nothing if true.



                                                  Try it online!






                                                  share|improve this answer









                                                  $endgroup$




                                                  C# (Visual C# Interactive Compiler), 41 bytes





                                                  n=>n.Split().GroupBy(c=>c[0]|32).Single()


                                                  Throws an exception if false, nothing if true.



                                                  Try it online!







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Mar 25 at 20:14









                                                  Embodiment of IgnoranceEmbodiment of Ignorance

                                                  4,3661 silver badge28 bronze badges




                                                  4,3661 silver badge28 bronze badges





















                                                      1












                                                      $begingroup$


                                                      Perl 6, 19 bytes





                                                      [eq] m:g/<<./o&lc


                                                      Try it online!






                                                      share|improve this answer









                                                      $endgroup$

















                                                        1












                                                        $begingroup$


                                                        Perl 6, 19 bytes





                                                        [eq] m:g/<<./o&lc


                                                        Try it online!






                                                        share|improve this answer









                                                        $endgroup$















                                                          1












                                                          1








                                                          1





                                                          $begingroup$


                                                          Perl 6, 19 bytes





                                                          [eq] m:g/<<./o&lc


                                                          Try it online!






                                                          share|improve this answer









                                                          $endgroup$




                                                          Perl 6, 19 bytes





                                                          [eq] m:g/<<./o&lc


                                                          Try it online!







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered Mar 25 at 21:28









                                                          nwellnhofnwellnhof

                                                          7,8501 gold badge12 silver badges29 bronze badges




                                                          7,8501 gold badge12 silver badges29 bronze badges





















                                                              1












                                                              $begingroup$

                                                              Java, (36 bytes)



                                                              s->!s.matches("(?i)(.).* (?!\1).*")


                                                              TIO






                                                              share|improve this answer









                                                              $endgroup$








                                                              • 1




                                                                $begingroup$
                                                                I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                                $endgroup$
                                                                – Sara J
                                                                Mar 25 at 22:13











                                                              • $begingroup$
                                                                indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 6:32











                                                              • $begingroup$
                                                                however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 10:19















                                                              1












                                                              $begingroup$

                                                              Java, (36 bytes)



                                                              s->!s.matches("(?i)(.).* (?!\1).*")


                                                              TIO






                                                              share|improve this answer









                                                              $endgroup$








                                                              • 1




                                                                $begingroup$
                                                                I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                                $endgroup$
                                                                – Sara J
                                                                Mar 25 at 22:13











                                                              • $begingroup$
                                                                indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 6:32











                                                              • $begingroup$
                                                                however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 10:19













                                                              1












                                                              1








                                                              1





                                                              $begingroup$

                                                              Java, (36 bytes)



                                                              s->!s.matches("(?i)(.).* (?!\1).*")


                                                              TIO






                                                              share|improve this answer









                                                              $endgroup$



                                                              Java, (36 bytes)



                                                              s->!s.matches("(?i)(.).* (?!\1).*")


                                                              TIO







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Mar 25 at 21:30









                                                              Nahuel FouilleulNahuel Fouilleul

                                                              3,6651 gold badge4 silver badges13 bronze badges




                                                              3,6651 gold badge4 silver badges13 bronze badges







                                                              • 1




                                                                $begingroup$
                                                                I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                                $endgroup$
                                                                – Sara J
                                                                Mar 25 at 22:13











                                                              • $begingroup$
                                                                indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 6:32











                                                              • $begingroup$
                                                                however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 10:19












                                                              • 1




                                                                $begingroup$
                                                                I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                                $endgroup$
                                                                – Sara J
                                                                Mar 25 at 22:13











                                                              • $begingroup$
                                                                indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 6:32











                                                              • $begingroup$
                                                                however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                                $endgroup$
                                                                – Nahuel Fouilleul
                                                                Mar 26 at 10:19







                                                              1




                                                              1




                                                              $begingroup$
                                                              I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                              $endgroup$
                                                              – Sara J
                                                              Mar 25 at 22:13





                                                              $begingroup$
                                                              I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                              $endgroup$
                                                              – Sara J
                                                              Mar 25 at 22:13













                                                              $begingroup$
                                                              indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                              $endgroup$
                                                              – Nahuel Fouilleul
                                                              Mar 26 at 6:32





                                                              $begingroup$
                                                              indeed it's not a test case, but this can be handled adding (?> *), using atomic group to match space at beginning and to pevent bactracking. just ` *` doesn't work because after failing matches will backtrack ` *` to match empty string
                                                              $endgroup$
                                                              – Nahuel Fouilleul
                                                              Mar 26 at 6:32













                                                              $begingroup$
                                                              however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                              $endgroup$
                                                              – Nahuel Fouilleul
                                                              Mar 26 at 10:19




                                                              $begingroup$
                                                              however reading the question again spaces can occur at the beginning beause in the example the usage is to pass the words as argument and spaces are shell argument delimiter
                                                              $endgroup$
                                                              – Nahuel Fouilleul
                                                              Mar 26 at 10:19



                                                              Popular posts from this blog

                                                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript