Is there a smaller tautogram checker? [on hold]












9












$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









New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$



put on hold as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan 23 hours ago


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
    yesterday






  • 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
    yesterday








  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    yesterday






  • 1




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






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    yesterday
















9












$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









New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$



put on hold as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan 23 hours ago


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
    yesterday






  • 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
    yesterday








  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    yesterday






  • 1




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






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    yesterday














9












9








9





$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









New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$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









New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 23 hours ago









trichoplax

7,50664276




7,50664276






New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Jaime TenorioJaime Tenorio

463




463




New contributor




Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jaime Tenorio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan 23 hours ago


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.









put on hold as unclear what you're asking by Erik the Outgolfer, Stephen, Embodiment of Ignorance, Don Thousand, Jonathan Allan 23 hours ago


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
    yesterday






  • 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
    yesterday








  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    yesterday






  • 1




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






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    yesterday














  • 1




    $begingroup$
    Is it intended as a tips question limited to Python? If so, these both tags should be added.
    $endgroup$
    – Arnauld
    yesterday






  • 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
    yesterday








  • 1




    $begingroup$
    What do you mean by punctuation? Which characters are included?
    $endgroup$
    – Embodiment of Ignorance
    yesterday






  • 1




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






  • 6




    $begingroup$
    Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
    $endgroup$
    – AdmBorkBork
    yesterday








1




1




$begingroup$
Is it intended as a tips question limited to Python? If so, these both tags should be added.
$endgroup$
– Arnauld
yesterday




$begingroup$
Is it intended as a tips question limited to Python? If so, these both tags should be added.
$endgroup$
– Arnauld
yesterday




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
yesterday






$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
yesterday






1




1




$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
yesterday




$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
yesterday




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
yesterday




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




6




6




$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
yesterday




$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
yesterday










13 Answers
13






active

oldest

votes


















5












$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$





















    3












    $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$





















      2












      $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
        14 hours ago










      • $begingroup$
        Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
        $endgroup$
        – Galen Ivanov
        13 hours ago



















      2












      $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
        15 hours ago










      • $begingroup$
        35 bytes with regexp
        $endgroup$
        – mazzy
        13 hours ago






      • 1




        $begingroup$
        @mazzy fixed trying to understand the intention
        $endgroup$
        – Nahuel Fouilleul
        12 hours ago










      • $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
        8 hours ago










      • $begingroup$
        I'm agree. but this question is put on hold, so I can't create a new answer.
        $endgroup$
        – mazzy
        6 hours ago





















      1












      $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$





















        1












        $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
          23 hours ago



















        1












        $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
          22 hours ago



















        1












        $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:



        $h{ord()%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
          13 hours ago










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










        • $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
          13 hours ago



















        0












        $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
          yesterday












        • $begingroup$
          @NahuelFouilleul, using test saves another byte.
          $endgroup$
          – Shaggy
          yesterday






        • 1




          $begingroup$
          @NahuelFouilleul You should probably post is separately.
          $endgroup$
          – Arnauld
          yesterday










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



















        0












        $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$





















          0












          $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$





















            0












            $begingroup$


            Perl 6, 19 bytes





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


            Try it online!






            share|improve this answer









            $endgroup$





















              0












              $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
                23 hours ago












              • $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
                14 hours ago












              • $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
                11 hours ago


















              13 Answers
              13






              active

              oldest

              votes








              13 Answers
              13






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              5












              $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$


















                5












                $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$
















                  5












                  5








                  5





                  $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 8 hours ago









                  Jo King

                  25.5k362129




                  25.5k362129










                  answered yesterday









                  Magic Octopus UrnMagic Octopus Urn

                  12.8k444126




                  12.8k444126























                      3












                      $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$


                        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












                          3








                          3





                          $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 yesterday









                          TFeldTFeld

                          16.1k21449




                          16.1k21449























                              2












                              $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
                                14 hours ago










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                13 hours ago
















                              2












                              $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
                                14 hours ago










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                13 hours ago














                              2












                              2








                              2





                              $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 23 hours ago

























                              answered 23 hours ago









                              CarcigenicateCarcigenicate

                              2,33911224




                              2,33911224












                              • $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
                                14 hours ago










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                13 hours ago


















                              • $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
                                14 hours ago










                              • $begingroup$
                                Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                                $endgroup$
                                – Galen Ivanov
                                13 hours ago
















                              $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
                              14 hours ago




                              $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
                              14 hours ago












                              $begingroup$
                              Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                              $endgroup$
                              – Galen Ivanov
                              13 hours ago




                              $begingroup$
                              Much shorter in PicoLisp: (de f(s)(apply =(mapcar car(split(chop(lowc s))" "))))
                              $endgroup$
                              – Galen Ivanov
                              13 hours ago











                              2












                              $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
                                15 hours ago










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                13 hours ago






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                12 hours ago










                              • $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
                                8 hours ago










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                6 hours ago


















                              2












                              $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
                                15 hours ago










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                13 hours ago






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                12 hours ago










                              • $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
                                8 hours ago










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                6 hours ago
















                              2












                              2








                              2





                              $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 9 hours ago

























                              answered yesterday









                              AdmBorkBorkAdmBorkBork

                              27.5k466237




                              27.5k466237












                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                15 hours ago










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                13 hours ago






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                12 hours ago










                              • $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
                                8 hours ago










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                6 hours ago




















                              • $begingroup$
                                41 bytes
                                $endgroup$
                                – mazzy
                                15 hours ago










                              • $begingroup$
                                35 bytes with regexp
                                $endgroup$
                                – mazzy
                                13 hours ago






                              • 1




                                $begingroup$
                                @mazzy fixed trying to understand the intention
                                $endgroup$
                                – Nahuel Fouilleul
                                12 hours ago










                              • $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
                                8 hours ago










                              • $begingroup$
                                I'm agree. but this question is put on hold, so I can't create a new answer.
                                $endgroup$
                                – mazzy
                                6 hours ago


















                              $begingroup$
                              41 bytes
                              $endgroup$
                              – mazzy
                              15 hours ago




                              $begingroup$
                              41 bytes
                              $endgroup$
                              – mazzy
                              15 hours ago












                              $begingroup$
                              35 bytes with regexp
                              $endgroup$
                              – mazzy
                              13 hours ago




                              $begingroup$
                              35 bytes with regexp
                              $endgroup$
                              – mazzy
                              13 hours ago




                              1




                              1




                              $begingroup$
                              @mazzy fixed trying to understand the intention
                              $endgroup$
                              – Nahuel Fouilleul
                              12 hours ago




                              $begingroup$
                              @mazzy fixed trying to understand the intention
                              $endgroup$
                              – Nahuel Fouilleul
                              12 hours ago












                              $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
                              8 hours ago




                              $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
                              8 hours ago












                              $begingroup$
                              I'm agree. but this question is put on hold, so I can't create a new answer.
                              $endgroup$
                              – mazzy
                              6 hours ago






                              $begingroup$
                              I'm agree. but this question is put on hold, so I can't create a new answer.
                              $endgroup$
                              – mazzy
                              6 hours ago













                              1












                              $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$


















                                1












                                $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$
















                                  1












                                  1








                                  1





                                  $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 yesterday









                                  RileyRiley

                                  11k11448




                                  11k11448























                                      1












                                      $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
                                        23 hours ago
















                                      1












                                      $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
                                        23 hours ago














                                      1












                                      1








                                      1





                                      $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 23 hours ago









                                      Unrelated StringUnrelated String

                                      1,381211




                                      1,381211












                                      • $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
                                        23 hours ago


















                                      • $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
                                        23 hours ago
















                                      $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
                                      23 hours ago




                                      $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
                                      23 hours ago











                                      1












                                      $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
                                        22 hours ago
















                                      1












                                      $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
                                        22 hours ago














                                      1












                                      1








                                      1





                                      $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 22 hours ago

























                                      answered yesterday









                                      Jonathan FrechJonathan Frech

                                      6,47311040




                                      6,47311040












                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        22 hours ago


















                                      • $begingroup$
                                        @nimi Thank you.
                                        $endgroup$
                                        – Jonathan Frech
                                        22 hours ago
















                                      $begingroup$
                                      @nimi Thank you.
                                      $endgroup$
                                      – Jonathan Frech
                                      22 hours ago




                                      $begingroup$
                                      @nimi Thank you.
                                      $endgroup$
                                      – Jonathan Frech
                                      22 hours ago











                                      1












                                      $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:



                                      $h{ord()%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
                                        13 hours ago










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










                                      • $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
                                        13 hours ago
















                                      1












                                      $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:



                                      $h{ord()%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
                                        13 hours ago










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










                                      • $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
                                        13 hours ago














                                      1












                                      1








                                      1





                                      $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:



                                      $h{ord()%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:



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


                                      31 bytes other







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited 10 hours ago

























                                      answered yesterday









                                      Nahuel FouilleulNahuel Fouilleul

                                      2,925211




                                      2,925211












                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        13 hours ago










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










                                      • $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
                                        13 hours ago


















                                      • $begingroup$
                                        what about punctuations? what about spaces or punctuations at the strart of string?
                                        $endgroup$
                                        – mazzy
                                        13 hours ago










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










                                      • $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
                                        13 hours ago
















                                      $begingroup$
                                      what about punctuations? what about spaces or punctuations at the strart of string?
                                      $endgroup$
                                      – mazzy
                                      13 hours ago




                                      $begingroup$
                                      what about punctuations? what about spaces or punctuations at the strart of string?
                                      $endgroup$
                                      – mazzy
                                      13 hours ago












                                      $begingroup$
                                      this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      13 hours ago




                                      $begingroup$
                                      this answer works for the given test cases, could be improved depending the requirements could be $_=!/^W*+(.).*(?=bw)(?!1)/i
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      13 hours ago












                                      $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
                                      13 hours ago




                                      $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
                                      13 hours ago











                                      0












                                      $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
                                        yesterday












                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        yesterday






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        yesterday










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
















                                      0












                                      $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
                                        yesterday












                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        yesterday






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        yesterday










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














                                      0












                                      0








                                      0





                                      $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 yesterday









                                      ArnauldArnauld

                                      79.8k797330




                                      79.8k797330












                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        yesterday












                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        yesterday






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        yesterday










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


















                                      • $begingroup$
                                        or in one regex or with a space instead of W
                                        $endgroup$
                                        – Nahuel Fouilleul
                                        yesterday












                                      • $begingroup$
                                        @NahuelFouilleul, using test saves another byte.
                                        $endgroup$
                                        – Shaggy
                                        yesterday






                                      • 1




                                        $begingroup$
                                        @NahuelFouilleul You should probably post is separately.
                                        $endgroup$
                                        – Arnauld
                                        yesterday










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
















                                      $begingroup$
                                      or in one regex or with a space instead of W
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      yesterday






                                      $begingroup$
                                      or in one regex or with a space instead of W
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      yesterday














                                      $begingroup$
                                      @NahuelFouilleul, using test saves another byte.
                                      $endgroup$
                                      – Shaggy
                                      yesterday




                                      $begingroup$
                                      @NahuelFouilleul, using test saves another byte.
                                      $endgroup$
                                      – Shaggy
                                      yesterday




                                      1




                                      1




                                      $begingroup$
                                      @NahuelFouilleul You should probably post is separately.
                                      $endgroup$
                                      – Arnauld
                                      yesterday




                                      $begingroup$
                                      @NahuelFouilleul You should probably post is separately.
                                      $endgroup$
                                      – Arnauld
                                      yesterday












                                      $begingroup$
                                      already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      yesterday




                                      $begingroup$
                                      already posted the perl version, i don't master as well javascript, i'm happy to give you a hint
                                      $endgroup$
                                      – Nahuel Fouilleul
                                      yesterday











                                      0












                                      $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$


















                                        0












                                        $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$
















                                          0












                                          0








                                          0





                                          $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 yesterday









                                          ShaggyShaggy

                                          19k21667




                                          19k21667























                                              0












                                              $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$


















                                                0












                                                $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$
















                                                  0












                                                  0








                                                  0





                                                  $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 yesterday









                                                  Embodiment of IgnoranceEmbodiment of Ignorance

                                                  2,208125




                                                  2,208125























                                                      0












                                                      $begingroup$


                                                      Perl 6, 19 bytes





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


                                                      Try it online!






                                                      share|improve this answer









                                                      $endgroup$


















                                                        0












                                                        $begingroup$


                                                        Perl 6, 19 bytes





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


                                                        Try it online!






                                                        share|improve this answer









                                                        $endgroup$
















                                                          0












                                                          0








                                                          0





                                                          $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 yesterday









                                                          nwellnhofnwellnhof

                                                          7,38011128




                                                          7,38011128























                                                              0












                                                              $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
                                                                23 hours ago












                                                              • $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
                                                                14 hours ago












                                                              • $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
                                                                11 hours ago
















                                                              0












                                                              $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
                                                                23 hours ago












                                                              • $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
                                                                14 hours ago












                                                              • $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
                                                                11 hours ago














                                                              0












                                                              0








                                                              0





                                                              $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 23 hours ago









                                                              Nahuel FouilleulNahuel Fouilleul

                                                              2,925211




                                                              2,925211








                                                              • 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
                                                                23 hours ago












                                                              • $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
                                                                14 hours ago












                                                              • $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
                                                                11 hours ago














                                                              • 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
                                                                23 hours ago












                                                              • $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
                                                                14 hours ago












                                                              • $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
                                                                11 hours ago








                                                              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
                                                              23 hours ago






                                                              $begingroup$
                                                              I think the input is allowed to start with a space, and this doesn't work for input like that.
                                                              $endgroup$
                                                              – Sara J
                                                              23 hours ago














                                                              $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
                                                              14 hours ago






                                                              $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
                                                              14 hours ago














                                                              $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
                                                              11 hours ago




                                                              $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
                                                              11 hours ago



                                                              Popular posts from this blog

                                                              Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum

                                                              He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

                                                              Slayer Innehåll Historia | Stil, komposition och lyrik | Bandets betydelse och framgångar | Sidoprojekt och samarbeten | Kontroverser | Medlemmar | Utmärkelser och nomineringar | Turnéer och festivaler | Diskografi | Referenser | Externa länkar | Navigeringsmenywww.slayer.net”Metal Massacre vol. 1””Metal Massacre vol. 3””Metal Massacre Volume III””Show No Mercy””Haunting the Chapel””Live Undead””Hell Awaits””Reign in Blood””Reign in Blood””Gold & Platinum – Reign in Blood””Golden Gods Awards Winners”originalet”Kerrang! Hall Of Fame””Slayer Looks Back On 37-Year Career In New Video Series: Part Two””South of Heaven””Gold & Platinum – South of Heaven””Seasons in the Abyss””Gold & Platinum - Seasons in the Abyss””Divine Intervention””Divine Intervention - Release group by Slayer””Gold & Platinum - Divine Intervention””Live Intrusion””Undisputed Attitude””Abolish Government/Superficial Love””Release “Slatanic Slaughter: A Tribute to Slayer” by Various Artists””Diabolus in Musica””Soundtrack to the Apocalypse””God Hates Us All””Systematic - Relationships””War at the Warfield””Gold & Platinum - War at the Warfield””Soundtrack to the Apocalypse””Gold & Platinum - Still Reigning””Metallica, Slayer, Iron Mauden Among Winners At Metal Hammer Awards””Eternal Pyre””Eternal Pyre - Slayer release group””Eternal Pyre””Metal Storm Awards 2006””Kerrang! Hall Of Fame””Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Bullet-For My Valentine booed at Metal Hammer Golden Gods Awards””Unholy Aliance””The End Of Slayer?””Slayer: We Could Thrash Out Two More Albums If We're Fast Enough...””'The Unholy Alliance: Chapter III' UK Dates Added”originalet”Megadeth And Slayer To Co-Headline 'Canadian Carnage' Trek”originalet”World Painted Blood””Release “World Painted Blood” by Slayer””Metallica Heading To Cinemas””Slayer, Megadeth To Join Forces For 'European Carnage' Tour - Dec. 18, 2010”originalet”Slayer's Hanneman Contracts Acute Infection; Band To Bring In Guest Guitarist””Cannibal Corpse's Pat O'Brien Will Step In As Slayer's Guest Guitarist”originalet”Slayer’s Jeff Hanneman Dead at 49””Dave Lombardo Says He Made Only $67,000 In 2011 While Touring With Slayer””Slayer: We Do Not Agree With Dave Lombardo's Substance Or Timeline Of Events””Slayer Welcomes Drummer Paul Bostaph Back To The Fold””Slayer Hope to Unveil Never-Before-Heard Jeff Hanneman Material on Next Album””Slayer Debut New Song 'Implode' During Surprise Golden Gods Appearance””Release group Repentless by Slayer””Repentless - Slayer - Credits””Slayer””Metal Storm Awards 2015””Slayer - to release comic book "Repentless #1"””Slayer To Release 'Repentless' 6.66" Vinyl Box Set””BREAKING NEWS: Slayer Announce Farewell Tour””Slayer Recruit Lamb of God, Anthrax, Behemoth + Testament for Final Tour””Slayer lägger ner efter 37 år””Slayer Announces Second North American Leg Of 'Final' Tour””Final World Tour””Slayer Announces Final European Tour With Lamb of God, Anthrax And Obituary””Slayer To Tour Europe With Lamb of God, Anthrax And Obituary””Slayer To Play 'Last French Show Ever' At Next Year's Hellfst””Slayer's Final World Tour Will Extend Into 2019””Death Angel's Rob Cavestany On Slayer's 'Farewell' Tour: 'Some Of Us Could See This Coming'””Testament Has No Plans To Retire Anytime Soon, Says Chuck Billy””Anthrax's Scott Ian On Slayer's 'Farewell' Tour Plans: 'I Was Surprised And I Wasn't Surprised'””Slayer””Slayer's Morbid Schlock””Review/Rock; For Slayer, the Mania Is the Message””Slayer - Biography””Slayer - Reign In Blood”originalet”Dave Lombardo””An exclusive oral history of Slayer”originalet”Exclusive! Interview With Slayer Guitarist Jeff Hanneman”originalet”Thinking Out Loud: Slayer's Kerry King on hair metal, Satan and being polite””Slayer Lyrics””Slayer - Biography””Most influential artists for extreme metal music””Slayer - Reign in Blood””Slayer guitarist Jeff Hanneman dies aged 49””Slatanic Slaughter: A Tribute to Slayer””Gateway to Hell: A Tribute to Slayer””Covered In Blood””Slayer: The Origins of Thrash in San Francisco, CA.””Why They Rule - #6 Slayer”originalet”Guitar World's 100 Greatest Heavy Metal Guitarists Of All Time”originalet”The fans have spoken: Slayer comes out on top in readers' polls”originalet”Tribute to Jeff Hanneman (1964-2013)””Lamb Of God Frontman: We Sound Like A Slayer Rip-Off””BEHEMOTH Frontman Pays Tribute To SLAYER's JEFF HANNEMAN””Slayer, Hatebreed Doing Double Duty On This Year's Ozzfest””System of a Down””Lacuna Coil’s Andrea Ferro Talks Influences, Skateboarding, Band Origins + More””Slayer - Reign in Blood””Into The Lungs of Hell””Slayer rules - en utställning om fans””Slayer and Their Fans Slashed Through a No-Holds-Barred Night at Gas Monkey””Home””Slayer””Gold & Platinum - The Big 4 Live from Sofia, Bulgaria””Exclusive! Interview With Slayer Guitarist Kerry King””2008-02-23: Wiltern, Los Angeles, CA, USA””Slayer's Kerry King To Perform With Megadeth Tonight! - Oct. 21, 2010”originalet”Dave Lombardo - Biography”Slayer Case DismissedArkiveradUltimate Classic Rock: Slayer guitarist Jeff Hanneman dead at 49.”Slayer: "We could never do any thing like Some Kind Of Monster..."””Cannibal Corpse'S Pat O'Brien Will Step In As Slayer'S Guest Guitarist | The Official Slayer Site”originalet”Slayer Wins 'Best Metal' Grammy Award””Slayer Guitarist Jeff Hanneman Dies””Kerrang! Awards 2006 Blog: Kerrang! Hall Of Fame””Kerrang! Awards 2013: Kerrang! Legend”originalet”Metallica, Slayer, Iron Maien Among Winners At Metal Hammer Awards””Metal Hammer Golden Gods Awards””Bullet For My Valentine Booed At Metal Hammer Golden Gods Awards””Metal Storm Awards 2006””Metal Storm Awards 2015””Slayer's Concert History””Slayer - Relationships””Slayer - Releases”Slayers officiella webbplatsSlayer på MusicBrainzOfficiell webbplatsSlayerSlayerr1373445760000 0001 1540 47353068615-5086262726cb13906545x(data)6033143kn20030215029