Inscriptio LabyrinthicaLay out the CarpetFind the Longest Palindrome in a String by Removing CharactersGenerate keyboard shortcuts for a menuCompute the specificity of a CSS selectorSwap capitalization of two stringsTwisting Words!Quine multiple timesIt's Not 2015 Anymore!Movie Title Styled StringPerfect PalindromesOdd'em out: letters
How to not confuse readers with simultaneous events?
Regex: Don't Match Text Between Curly Braces (LaTeX Commands)
Did Hitler say this quote about homeschooling?
Is Error correction and detection can be done with out adding extra bits?
Why does a tetrahedral molecule like methane have a dipole moment of zero?
Pauli exclusion principle - black holes
Why can't I hear fret buzz through the amp?
When can a polynomial be written as a polynomial function of another polynomial?
Why aren't there any women super GMs?
Grouping into more groups in one iteration
What is the period of Langton's ant on a torus?
How to draw a winding on a toroid of a circular cross section?
What happens if a company buys back all of its shares?
Term “console” in game consoles
Inscriptio Labyrinthica
Company looks for long-term employees, but I know I won't be interested in staying long
How do you give a date interval with diffuse dates?
Drawing a circle with nodes shift with Tikz
What did Jeremy Hunt mean by "slipped" to miss a vote?
How to interpret a promising preprint that was never published?
Which GPUs to get for Mathematical Optimization (if any)?
Is there a difference between PIO and GPIO pins?
Why teach C using scanf without talking about command line arguments?
Amira L'Akum not on Shabbat
Inscriptio Labyrinthica
Lay out the CarpetFind the Longest Palindrome in a String by Removing CharactersGenerate keyboard shortcuts for a menuCompute the specificity of a CSS selectorSwap capitalization of two stringsTwisting Words!Quine multiple timesIt's Not 2015 Anymore!Movie Title Styled StringPerfect PalindromesOdd'em out: letters
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge, you'll generalize the process to make them.
Input
A string (or equivalent), and an integer. You may make the following assumptions about the input:
- The string will have an odd length.
- The integer will be an odd number between 1 and one less than twice the length of the string.
Output
An inscriptio labyrinthica for the string, using the integer for the height (see models). Output should be each letter with no spaces, line break as default to your system/language.
Test cases
Note that an input of 1 or (length * 2 - 1) will result in a horizontal or vertical palindrome.
Input: FOO, 3 Input: BAR, 1 Input: BAR, 3 Input: BAR, 5
Output: OOO Output: RABAR Output: RAR Output: R
OFO ABA A
OOO RAR B
A
R
Input: ABCDE, 5 Input: ABCDE, 3 Input: *<>v^, 5
Output: EDCDE Output: EDCBCDE ^v>v^
DCBCD DCBABCD v><>v
CBABC EDCBCDE ><*<>
DCBCD v><>v
EDCDE ^v>v^
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes forbidden.
code-golf string
$endgroup$
|
show 5 more comments
$begingroup$
In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge, you'll generalize the process to make them.
Input
A string (or equivalent), and an integer. You may make the following assumptions about the input:
- The string will have an odd length.
- The integer will be an odd number between 1 and one less than twice the length of the string.
Output
An inscriptio labyrinthica for the string, using the integer for the height (see models). Output should be each letter with no spaces, line break as default to your system/language.
Test cases
Note that an input of 1 or (length * 2 - 1) will result in a horizontal or vertical palindrome.
Input: FOO, 3 Input: BAR, 1 Input: BAR, 3 Input: BAR, 5
Output: OOO Output: RABAR Output: RAR Output: R
OFO ABA A
OOO RAR B
A
R
Input: ABCDE, 5 Input: ABCDE, 3 Input: *<>v^, 5
Output: EDCDE Output: EDCBCDE ^v>v^
DCBCD DCBABCD v><>v
CBABC EDCBCDE ><*<>
DCBCD v><>v
EDCDE ^v>v^
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes forbidden.
code-golf string
$endgroup$
1
$begingroup$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputingA B C
,1 would result inC B A B C
(using a value of 1 since I can't show verticality in comments ha)
$endgroup$
– guifa
8 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago
|
show 5 more comments
$begingroup$
In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge, you'll generalize the process to make them.
Input
A string (or equivalent), and an integer. You may make the following assumptions about the input:
- The string will have an odd length.
- The integer will be an odd number between 1 and one less than twice the length of the string.
Output
An inscriptio labyrinthica for the string, using the integer for the height (see models). Output should be each letter with no spaces, line break as default to your system/language.
Test cases
Note that an input of 1 or (length * 2 - 1) will result in a horizontal or vertical palindrome.
Input: FOO, 3 Input: BAR, 1 Input: BAR, 3 Input: BAR, 5
Output: OOO Output: RABAR Output: RAR Output: R
OFO ABA A
OOO RAR B
A
R
Input: ABCDE, 5 Input: ABCDE, 3 Input: *<>v^, 5
Output: EDCDE Output: EDCBCDE ^v>v^
DCBCD DCBABCD v><>v
CBABC EDCBCDE ><*<>
DCBCD v><>v
EDCDE ^v>v^
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes forbidden.
code-golf string
$endgroup$
In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge, you'll generalize the process to make them.
Input
A string (or equivalent), and an integer. You may make the following assumptions about the input:
- The string will have an odd length.
- The integer will be an odd number between 1 and one less than twice the length of the string.
Output
An inscriptio labyrinthica for the string, using the integer for the height (see models). Output should be each letter with no spaces, line break as default to your system/language.
Test cases
Note that an input of 1 or (length * 2 - 1) will result in a horizontal or vertical palindrome.
Input: FOO, 3 Input: BAR, 1 Input: BAR, 3 Input: BAR, 5
Output: OOO Output: RABAR Output: RAR Output: R
OFO ABA A
OOO RAR B
A
R
Input: ABCDE, 5 Input: ABCDE, 3 Input: *<>v^, 5
Output: EDCDE Output: EDCBCDE ^v>v^
DCBCD DCBABCD v><>v
CBABC EDCBCDE ><*<>
DCBCD v><>v
EDCDE ^v>v^
Scoring
This is code-golf so shortest answer in bytes wins. Standard loopholes forbidden.
code-golf string
code-golf string
edited 7 hours ago
guifa
asked 8 hours ago
guifaguifa
5842 silver badges7 bronze badges
5842 silver badges7 bronze badges
1
$begingroup$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputingA B C
,1 would result inC B A B C
(using a value of 1 since I can't show verticality in comments ha)
$endgroup$
– guifa
8 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago
|
show 5 more comments
1
$begingroup$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputingA B C
,1 would result inC B A B C
(using a value of 1 since I can't show verticality in comments ha)
$endgroup$
– guifa
8 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago
1
1
$begingroup$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputing
A B C
,1 would result in C B A B C
(using a value of 1 since I can't show verticality in comments ha)$endgroup$
– guifa
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputing
A B C
,1 would result in C B A B C
(using a value of 1 since I can't show verticality in comments ha)$endgroup$
– guifa
8 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago
|
show 5 more comments
4 Answers
4
active
oldest
votes
$begingroup$
Charcoal, 25 19 bytes
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η‖O←↑
Try it online! Link is to verbose version of code. Explanation:
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η
Draw a quarter of the inscription.
‖O←↑
Reflect to complete the inscription.
$endgroup$
add a comment |
$begingroup$
Jelly, 12 bytes
Uṡṛ‘HɗŒBŒḄZY
Try it online!
A dyadic link taking the string as its left and height as its right argument. Returns a string with line breaks. If a list of strings were acceptable for output, I can remove the final Y
saving a byte. Interestingly the original “SILO PRINCEPS FECIT” looks to me like ASCII art of a 3D diamond when I look at it on TIO.
$endgroup$
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
R, 93 bytes
function(s,H,h=H/2-.5,w=length(s)-h-1)write(s[1+outer(abs(-w:w),abs(-h:h),`+`)],"",2*w+1,,"")
Try it online!
Takes input as a vector of characters.
First compute $w$ and $h$ such that the output is of size $(2w+1)times(2h+1)$.
In the output, we want the character in position $(i,j)$ to be the $1+|i-h|+|j-w|$ th character of the input. The rest is formatting.
$endgroup$
add a comment |
$begingroup$
Japt -R
, 19 16 bytes
z
ò@VÔtYVÊaU)êÃê
Try it
$endgroup$
add a comment |
Your Answer
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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%2f188528%2finscriptio-labyrinthica%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Charcoal, 25 19 bytes
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η‖O←↑
Try it online! Link is to verbose version of code. Explanation:
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η
Draw a quarter of the inscription.
‖O←↑
Reflect to complete the inscription.
$endgroup$
add a comment |
$begingroup$
Charcoal, 25 19 bytes
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η‖O←↑
Try it online! Link is to verbose version of code. Explanation:
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η
Draw a quarter of the inscription.
‖O←↑
Reflect to complete the inscription.
$endgroup$
add a comment |
$begingroup$
Charcoal, 25 19 bytes
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η‖O←↑
Try it online! Link is to verbose version of code. Explanation:
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η
Draw a quarter of the inscription.
‖O←↑
Reflect to complete the inscription.
$endgroup$
Charcoal, 25 19 bytes
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η‖O←↑
Try it online! Link is to verbose version of code. Explanation:
E⊘⊕η✂θκ⁺κ⁻Lθ⊘⊖η
Draw a quarter of the inscription.
‖O←↑
Reflect to complete the inscription.
edited 5 hours ago
answered 5 hours ago
NeilNeil
86.4k8 gold badges46 silver badges183 bronze badges
86.4k8 gold badges46 silver badges183 bronze badges
add a comment |
add a comment |
$begingroup$
Jelly, 12 bytes
Uṡṛ‘HɗŒBŒḄZY
Try it online!
A dyadic link taking the string as its left and height as its right argument. Returns a string with line breaks. If a list of strings were acceptable for output, I can remove the final Y
saving a byte. Interestingly the original “SILO PRINCEPS FECIT” looks to me like ASCII art of a 3D diamond when I look at it on TIO.
$endgroup$
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Jelly, 12 bytes
Uṡṛ‘HɗŒBŒḄZY
Try it online!
A dyadic link taking the string as its left and height as its right argument. Returns a string with line breaks. If a list of strings were acceptable for output, I can remove the final Y
saving a byte. Interestingly the original “SILO PRINCEPS FECIT” looks to me like ASCII art of a 3D diamond when I look at it on TIO.
$endgroup$
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
Jelly, 12 bytes
Uṡṛ‘HɗŒBŒḄZY
Try it online!
A dyadic link taking the string as its left and height as its right argument. Returns a string with line breaks. If a list of strings were acceptable for output, I can remove the final Y
saving a byte. Interestingly the original “SILO PRINCEPS FECIT” looks to me like ASCII art of a 3D diamond when I look at it on TIO.
$endgroup$
Jelly, 12 bytes
Uṡṛ‘HɗŒBŒḄZY
Try it online!
A dyadic link taking the string as its left and height as its right argument. Returns a string with line breaks. If a list of strings were acceptable for output, I can remove the final Y
saving a byte. Interestingly the original “SILO PRINCEPS FECIT” looks to me like ASCII art of a 3D diamond when I look at it on TIO.
answered 4 hours ago
Nick KennedyNick Kennedy
4,9949 silver badges14 bronze badges
4,9949 silver badges14 bronze badges
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
$begingroup$
I clicked on the try it just to see and yes, indeed, it does 3D. Weird but cool.
$endgroup$
– guifa
4 hours ago
add a comment |
$begingroup$
R, 93 bytes
function(s,H,h=H/2-.5,w=length(s)-h-1)write(s[1+outer(abs(-w:w),abs(-h:h),`+`)],"",2*w+1,,"")
Try it online!
Takes input as a vector of characters.
First compute $w$ and $h$ such that the output is of size $(2w+1)times(2h+1)$.
In the output, we want the character in position $(i,j)$ to be the $1+|i-h|+|j-w|$ th character of the input. The rest is formatting.
$endgroup$
add a comment |
$begingroup$
R, 93 bytes
function(s,H,h=H/2-.5,w=length(s)-h-1)write(s[1+outer(abs(-w:w),abs(-h:h),`+`)],"",2*w+1,,"")
Try it online!
Takes input as a vector of characters.
First compute $w$ and $h$ such that the output is of size $(2w+1)times(2h+1)$.
In the output, we want the character in position $(i,j)$ to be the $1+|i-h|+|j-w|$ th character of the input. The rest is formatting.
$endgroup$
add a comment |
$begingroup$
R, 93 bytes
function(s,H,h=H/2-.5,w=length(s)-h-1)write(s[1+outer(abs(-w:w),abs(-h:h),`+`)],"",2*w+1,,"")
Try it online!
Takes input as a vector of characters.
First compute $w$ and $h$ such that the output is of size $(2w+1)times(2h+1)$.
In the output, we want the character in position $(i,j)$ to be the $1+|i-h|+|j-w|$ th character of the input. The rest is formatting.
$endgroup$
R, 93 bytes
function(s,H,h=H/2-.5,w=length(s)-h-1)write(s[1+outer(abs(-w:w),abs(-h:h),`+`)],"",2*w+1,,"")
Try it online!
Takes input as a vector of characters.
First compute $w$ and $h$ such that the output is of size $(2w+1)times(2h+1)$.
In the output, we want the character in position $(i,j)$ to be the $1+|i-h|+|j-w|$ th character of the input. The rest is formatting.
answered 4 hours ago
Robin RyderRobin Ryder
2,7914 silver badges24 bronze badges
2,7914 silver badges24 bronze badges
add a comment |
add a comment |
$begingroup$
Japt -R
, 19 16 bytes
z
ò@VÔtYVÊaU)êÃê
Try it
$endgroup$
add a comment |
$begingroup$
Japt -R
, 19 16 bytes
z
ò@VÔtYVÊaU)êÃê
Try it
$endgroup$
add a comment |
$begingroup$
Japt -R
, 19 16 bytes
z
ò@VÔtYVÊaU)êÃê
Try it
$endgroup$
Japt -R
, 19 16 bytes
z
ò@VÔtYVÊaU)êÃê
Try it
answered 3 hours ago
ShaggyShaggy
20.5k3 gold badges20 silver badges69 bronze badges
20.5k3 gold badges20 silver badges69 bronze badges
add a comment |
add a comment |
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');
);
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%2f188528%2finscriptio-labyrinthica%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');
);
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');
);
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');
);
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$
not totally unrelated
$endgroup$
– Giuseppe
8 hours ago
$begingroup$
Can the input contain spaces? If so, how should they be handled?
$endgroup$
– Nitrodon
8 hours ago
$begingroup$
@Nitrodon Sure, and no special handling, just treat them as any other character. So inputing
A B C
,1 would result inC B A B C
(using a value of 1 since I can't show verticality in comments ha)$endgroup$
– guifa
8 hours ago
$begingroup$
The last test case says height is 3, but the output has 5 rows.
$endgroup$
– RootTwo
7 hours ago
$begingroup$
@RootTwo oops, fixed, thanks
$endgroup$
– guifa
7 hours ago