Is there a smaller tautogram checker?“Convenient palindrome” checkerPrelude Syntax-CheckerA Basic Pyth-like Syntax CheckerChaining autogramsCreate a basic autocorrecting spell checkerEOC Vault Password Rank 3 Puzzle - Vault PasswordFind the last three words of each paragraph if they are shorter than 20 characters in totalVEVO User Account CheckerIsogram checkerCheckers Checker
node command while defining a coordinate in TikZ
Female=gender counterpart?
Greatest common substring
My boss asked me to take a one-day class, then signs it up as a day off
What (else) happened July 1st 1858 in London?
Is there a word to describe the feeling of being transfixed out of horror?
Invariance of results when scaling explanatory variables in logistic regression, is there a proof?
tikz grid without top edge
Lifted its hind leg on or lifted its hind leg towards?
Can a Gentile theist be saved?
How will losing mobility of one hand affect my career as a programmer?
Giant Toughroad SLR 2 for 200 miles in two days, will it make it?
General topology proving something for all of its points
Identify a stage play about a VR experience in which participants are encouraged to simulate performing horrific activities
Is there an Impartial Brexit Deal comparison site?
Can I Retrieve Email Addresses from BCC?
Superhero words!
Have I saved too much for retirement so far?
How can I raise concerns with a new DM about XP splitting?
Would it be legal for a US State to ban exports of a natural resource?
Make "apt-get update" show the exact output as `apt update`
How to prevent YouTube from showing already watched videos?
Lightning Web Components - Not available in app builder
Can a malicious addon access internet history and such in chrome/firefox?
Is there a smaller tautogram checker?
“Convenient palindrome” checkerPrelude Syntax-CheckerA Basic Pyth-like Syntax CheckerChaining autogramsCreate a basic autocorrecting spell checkerEOC Vault Password Rank 3 Puzzle - Vault PasswordFind the last three words of each paragraph if they are shorter than 20 characters in totalVEVO User Account CheckerIsogram checkerCheckers Checker
$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 can include punctuation.
Its size is 98 bytes. Is there a smaller solution in any language?
code-golf string decision-problem
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$
|
show 1 more comment
$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 can include punctuation.
Its size is 98 bytes. Is there a smaller solution in any language?
code-golf string decision-problem
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$
1
$begingroup$
Is it intended as atipsquestion limited toPython? If so, these both tags should be added.
$endgroup$
– Arnauld
1 hour ago
1
$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
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
1
$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
1 hour ago
2
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago
|
show 1 more comment
$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 can include punctuation.
Its size is 98 bytes. Is there a smaller solution in any language?
code-golf string decision-problem
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 can include punctuation.
Its size is 98 bytes. Is there a smaller solution in any language?
code-golf string decision-problem
code-golf string decision-problem
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.
edited 1 hour ago
Stephen
7,49723397
7,49723397
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 1 hour ago
Jaime TenorioJaime Tenorio
162
162
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.
1
$begingroup$
Is it intended as atipsquestion limited toPython? If so, these both tags should be added.
$endgroup$
– Arnauld
1 hour ago
1
$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
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
1
$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
1 hour ago
2
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago
|
show 1 more comment
1
$begingroup$
Is it intended as atipsquestion limited toPython? If so, these both tags should be added.
$endgroup$
– Arnauld
1 hour ago
1
$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
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
1
$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
1 hour ago
2
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago
1
1
$begingroup$
Is it intended as a
tips question limited to Python? If so, these both tags should be added.$endgroup$
– Arnauld
1 hour ago
$begingroup$
Is it intended as a
tips question limited to Python? If so, these both tags should be added.$endgroup$
– Arnauld
1 hour ago
1
1
$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
1 hour ago
$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
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
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
1 hour ago
$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
1 hour ago
2
2
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago
|
show 1 more comment
9 Answers
9
active
oldest
votes
$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.
$endgroup$
add a comment |
$begingroup$
PowerShell, 57 50 bytes
(-split"$args"|%"$($_[0])"|group).Name.count-eq1
Try it online!
Takes input and splits it on whitespace. Loops through each word, takes the first letter $_[0]. Then groups the letters (case-insensitive by default), takes the names, and verifies the count of those names are -equal to 1. Output is implicit.
The Group).Name.count seems long, but I can't figure out how to shorten it yet.
$endgroup$
add a comment |
$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.
$endgroup$
$begingroup$
or in one regex or with a space instead ofW
$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, usingtestsaves another byte.
$endgroup$
– Shaggy
2 mins ago
add a comment |
$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
$endgroup$
add a comment |
$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!
$endgroup$
add a comment |
$begingroup$
05AB1E, 5 bytes
l#€нË
Try it online!
Did this on mobile excuse the no explanation.
$endgroup$
add a comment |
$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
$endgroup$
add a comment |
$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 bytes (using Data.Char.toLower)
import Data.Char
(all=<<(==).head).map head.words.map toLower
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 5 (-p), 20 bytes
$_=!/^(.).* (?!1)/i
TIO
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "200"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Jaime Tenorio is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182175%2fis-there-a-smaller-tautogram-checker%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
$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.
$endgroup$
add a comment |
$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.
$endgroup$
add a comment |
$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.
$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.
answered 49 mins ago
TFeldTFeld
15.9k21449
15.9k21449
add a comment |
add a comment |
$begingroup$
PowerShell, 57 50 bytes
(-split"$args"|%"$($_[0])"|group).Name.count-eq1
Try it online!
Takes input and splits it on whitespace. Loops through each word, takes the first letter $_[0]. Then groups the letters (case-insensitive by default), takes the names, and verifies the count of those names are -equal to 1. Output is implicit.
The Group).Name.count seems long, but I can't figure out how to shorten it yet.
$endgroup$
add a comment |
$begingroup$
PowerShell, 57 50 bytes
(-split"$args"|%"$($_[0])"|group).Name.count-eq1
Try it online!
Takes input and splits it on whitespace. Loops through each word, takes the first letter $_[0]. Then groups the letters (case-insensitive by default), takes the names, and verifies the count of those names are -equal to 1. Output is implicit.
The Group).Name.count seems long, but I can't figure out how to shorten it yet.
$endgroup$
add a comment |
$begingroup$
PowerShell, 57 50 bytes
(-split"$args"|%"$($_[0])"|group).Name.count-eq1
Try it online!
Takes input and splits it on whitespace. Loops through each word, takes the first letter $_[0]. Then groups the letters (case-insensitive by default), takes the names, and verifies the count of those names are -equal to 1. Output is implicit.
The Group).Name.count seems long, but I can't figure out how to shorten it yet.
$endgroup$
PowerShell, 57 50 bytes
(-split"$args"|%"$($_[0])"|group).Name.count-eq1
Try it online!
Takes input and splits it on whitespace. Loops through each word, takes the first letter $_[0]. Then groups the letters (case-insensitive by default), takes the names, and verifies the count of those names are -equal to 1. Output is implicit.
The Group).Name.count seems long, but I can't figure out how to shorten it yet.
answered 43 mins ago
AdmBorkBorkAdmBorkBork
27.5k466237
27.5k466237
add a comment |
add a comment |
$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.
$endgroup$
$begingroup$
or in one regex or with a space instead ofW
$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, usingtestsaves another byte.
$endgroup$
– Shaggy
2 mins ago
add a comment |
$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.
$endgroup$
$begingroup$
or in one regex or with a space instead ofW
$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, usingtestsaves another byte.
$endgroup$
– Shaggy
2 mins ago
add a comment |
$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.
$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.
answered 43 mins ago
ArnauldArnauld
79.6k797330
79.6k797330
$begingroup$
or in one regex or with a space instead ofW
$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, usingtestsaves another byte.
$endgroup$
– Shaggy
2 mins ago
add a comment |
$begingroup$
or in one regex or with a space instead ofW
$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, usingtestsaves another byte.
$endgroup$
– Shaggy
2 mins ago
$begingroup$
or in one regex or with a space instead of
W$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
or in one regex or with a space instead of
W$endgroup$
– Nahuel Fouilleul
12 mins ago
$begingroup$
@NahuelFouilleul, using
test saves another byte.$endgroup$
– Shaggy
2 mins ago
$begingroup$
@NahuelFouilleul, using
test saves another byte.$endgroup$
– Shaggy
2 mins ago
add a comment |
$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
$endgroup$
add a comment |
$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
$endgroup$
add a comment |
$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
$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
answered 40 mins ago
ShaggyShaggy
18.9k21667
18.9k21667
add a comment |
add a comment |
$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!
$endgroup$
add a comment |
$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!
$endgroup$
add a comment |
$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!
$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!
answered 33 mins ago
Embodiment of IgnoranceEmbodiment of Ignorance
2,168125
2,168125
add a comment |
add a comment |
$begingroup$
05AB1E, 5 bytes
l#€нË
Try it online!
Did this on mobile excuse the no explanation.
$endgroup$
add a comment |
$begingroup$
05AB1E, 5 bytes
l#€нË
Try it online!
Did this on mobile excuse the no explanation.
$endgroup$
add a comment |
$begingroup$
05AB1E, 5 bytes
l#€нË
Try it online!
Did this on mobile excuse the no explanation.
$endgroup$
05AB1E, 5 bytes
l#€нË
Try it online!
Did this on mobile excuse the no explanation.
answered 29 mins ago
Magic Octopus UrnMagic Octopus Urn
12.8k444126
12.8k444126
add a comment |
add a comment |
$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
$endgroup$
add a comment |
$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
$endgroup$
add a comment |
$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
$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
answered 24 mins ago
RileyRiley
11k11448
11k11448
add a comment |
add a comment |
$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 bytes (using Data.Char.toLower)
import Data.Char
(all=<<(==).head).map head.words.map toLower
Try it online!
$endgroup$
add a comment |
$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 bytes (using Data.Char.toLower)
import Data.Char
(all=<<(==).head).map head.words.map toLower
Try it online!
$endgroup$
add a comment |
$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 bytes (using Data.Char.toLower)
import Data.Char
(all=<<(==).head).map head.words.map toLower
Try it online!
$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 bytes (using Data.Char.toLower)
import Data.Char
(all=<<(==).head).map head.words.map toLower
Try it online!
edited 23 mins ago
answered 37 mins ago
Jonathan FrechJonathan Frech
6,46311040
6,46311040
add a comment |
add a comment |
$begingroup$
Perl 5 (-p), 20 bytes
$_=!/^(.).* (?!1)/i
TIO
$endgroup$
add a comment |
$begingroup$
Perl 5 (-p), 20 bytes
$_=!/^(.).* (?!1)/i
TIO
$endgroup$
add a comment |
$begingroup$
Perl 5 (-p), 20 bytes
$_=!/^(.).* (?!1)/i
TIO
$endgroup$
Perl 5 (-p), 20 bytes
$_=!/^(.).* (?!1)/i
TIO
answered 20 mins ago
Nahuel FouilleulNahuel Fouilleul
2,915211
2,915211
add a comment |
add a comment |
Jaime Tenorio is a new contributor. Be nice, and check out our Code of Conduct.
Jaime Tenorio is a new contributor. Be nice, and check out our Code of Conduct.
Jaime Tenorio is a new contributor. Be nice, and check out our Code of Conduct.
Jaime Tenorio is a new contributor. Be nice, and check out our Code of Conduct.
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182175%2fis-there-a-smaller-tautogram-checker%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
Is it intended as a
tipsquestion limited toPython? If so, these both tags should be added.$endgroup$
– Arnauld
1 hour ago
1
$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
1 hour ago
$begingroup$
What do you mean by punctuation? Which characters are included?
$endgroup$
– Embodiment of Ignorance
1 hour ago
1
$begingroup$
@MagicOctopusUrn Sometimes when you ask for a short solution in stackOverflow the refer to this site :)
$endgroup$
– Luis felipe De jesus Munoz
1 hour ago
2
$begingroup$
Welcome to PPCG! A few more test cases (including punctuation) would be a great addition to this challenge.
$endgroup$
– AdmBorkBork
38 mins ago