text:
Code Golf - Covfefe on tap
As we all know, negative press covfefe has been conspiring to bring down the American president for some months now.
There's also, definitely, an algorithm in play in that word. Covfe is a refreshing caffeinated beverage, and following the president's remarks it's clear the word can now be appended with successive f's and e's, so long as they are not adjacent to their own letters.
So I wrote some code to generate the inevitable covfefe triangle. The output looks like this:
covfefe
covfefef
covfefefe
covfefefef
covfefefefe
covfefefefef
covfefefefefe
covfefefefefef
covfefefefefefe
covfefefefefefef
covfefefefefefefe
covfefefefefefefef
covfefefefefefefefe
covfefefefefefefefef
covfefefefefefefefefe
covfefefefefefefefefef
covfefefefefefefefefefe
covfefefefefefefefefefef
covfefefefefefefefefefefe
covfefefefefefefefefefefef
covfefefefefefefefefefefefe

So here are the rules:

Output 21 lines, the first of which should be 'covfefe'.
Each line must be one character longer than the previous line.
No f can be horizontally adjacent to another f.
No e can be horizontally adjacent to another e.

Oh, and have fun!
(I'm also interested to see any other nifty covfefe-related snippets)

Do we need to print the quoted text as is? Or, can we print any text meeting the conditions listed?

Can we return an array of strings?

The output shown has plenty of es adjacent to es (and same for fs), I suppose you meant "on a [horizontal]  line"? (or maybe you mean in the code??)

@Shaggy That goes directly against the rules in the original question, I think it's got to print them somewhere, really.

I don't understand your answer.

Just curious, why the downvotes? Anyone know?

Wait, you're suggesting others might object if I output the example text you posted?!

I think the downvotes are probably because of the lack of clarity of the question.

@JonathanAllan Ahh, sorry, I completely misread. Yes, I did mean within one line. Although I'd love to see a result which avoids vertical adjacency too.

Charcoal, 13 bytes
Ｅ²¹⁺cov…fe⁺⁴ι

Try it online! Link is to verbose version of code. Explanation:
            Implicitly print joined with newlines
Ｅ²¹         the implicit range 0..21 mapped to
   ⁺cov     the concatenation of "cov" with
    …fe     the characters "fe" repeated until their length is exactly
     ⁺⁴ι    4 more than the value

05AB1E, 17 16 bytes
„fe12×η¦¦¦…covì»

Try it online!
Explanation
„fe               # push the string "fe"
   12×            # repeat it 12 times
      η           # get the prefixes of this string
       ¦¦¦        # drop the first 3
          …covì   # prepend the string "cov" to each
               »  # join on newline

Japt, 17 16 bytes
4o25_îeif)i`¬v

Test it online! 14 bytes of code, +2 for -R flag. If we can output as an array, simply remove the -R and subtract 2 bytes.
Explanation
4o25              Generate the range [4, 5, ..., 24].
    _             Map each item in this range to
      eif           "fe" (really weird hack, but it works and saves a byte)
     î   )          repeated to length <item>
          i`¬v      with "cov" inserted at the beginning.
                  Implicit: output result of last expression, joined with newlines (-R)

Alternatively, you could do 7o28_îfie)h"cov, which does the same thing, except overwriting cov onto the beginning of the string instead of inserting it at the beginning.

Pyth, 29 bytes
Vr4 25+"cov"+*/N2"fe"?%N2"f"k

Explanation:
Vr 4 25      Loops variable N from 4 to 24 (excludes 25)
    */N2"fe"     Repeats string "fe" N / 2 number of times
        ?%N2"f"k     Concatenates "f" if N % 2 is 1 (odd), or an empty
                     string if it is even (N % 2 is 0)
            +            Concatenates strings

Try it online!

Python 2, 37 bytes
s='covfef'
exec"s+=s[-2];print s;"*21

Try it online!
Matches the text  shown.

Python 2, 36 bytes
s='covfefe'
exec"print s;s+='?';"*21

Try it online!
Prints:
covfefe
covfefe?
covfefe??
covfefe???
covfefe????
covfefe?????
covfefe??????
covfefe???????
covfefe????????
covfefe?????????
covfefe??????????
covfefe???????????
covfefe????????????
covfefe?????????????
covfefe??????????????
covfefe???????????????
covfefe????????????????
covfefe?????????????????
covfefe??????????????????
covfefe???????????????????
covfefe????????????????????

Nice loophole, Each line must be one "character" longer

Attempt to produce this result with the fewest characters in your code. This must clearly produce the quoted text above. I would downvote this for being against the spirit of the challenge but I know it is only tongue in cheek. It would be better if you flipped the answer order around though.

@TheLethalCoder I actually did intend this as a serious answer. The conditions like "No f can be adjacent to another f" seem to say that "this result" is anything that meets them. Otherwise I don't see why they would be listed. I guess I'll ask.

@xnor I agree it is kind of within the rules but I think it goes against the spirit of the challenge.

C (gcc), 77 75 74 bytes
f(i,j){for(i=4;i++<25;)for(printf("\ncov"),j=i;--j;)putchar("ef"[i-j&1]);}

Try it online!

Python 3, 61 bytes
def f(n=20):
	print(' '*n+('covf'+'ef'*12)[:~n])
	if n:f(n-1)

not the shortest, but prints triangle without e/f vertical adjacency
Try it online!

SOGL V0.12, 16 15 bytes
4'⁷Ν{ņcoļvƧfemo

Try it Here!
Explanation:
4'⁷Ν             push inclusive range from 4 to 24
    {            for each do
     ņcoļv         output in a new line "cov" (split into 2 commands of "output 2 chars in a new line" and "output next char" for a byte save)
          Ƨfemo    output "fe" molded into the length of the current item

Python 2, 53 52 bytes
f=lambda n=21:n*' 'and'\ncovf'+('ef'*12)[:-n]+f(n-1)

Try it online!

Totally valid answer which matches the specs/rules.
PowerShell, 25 Bytes. Try it online!
"covfefe";8..28|%{'?'*$_}

OR (same byte count)
0..21|%{'covfefe'+'?'*$_}

As intended answer which matches the example output.
PowerShell, 44 Bytes. Try it online!
$c="covfef";0..20|%{($c=$c+('e','f')[$_%2])}

Ugly assignment at the beginning, i'm sure there's some that can be saved here.

36 bytes

C# (Mono), 132 bytes
using System.Linq;_=>{for(int i=0;i<21;)System.Console.WriteLine("cov"+string.Concat(new int[4+i++].Select((n,j)=>j%2<1?"f":"e")));}

Try it online!

Japt, 20 18 bytes
`¬vfef`
21ÆU±gJÉÃ·

Test it
16 bytes, if we can return an array.
`¬vfef`
21ÆU±gJÉ

Jelly, 17 bytes
⁾feẋ12“cov”;;\ṫ7Y

Try it online!

Husk, 15 bytes
↑21↓7ḣ+¨¢√¨¢"fe

Try it online!
NB: ¨¢√¨ is the compressed strind "cov"

Pyth, 33 bytes
V21+++"cov"*"fe"2*"fe"s/N2*\f%N2
Try it here: http://pyth.herokuapp.com

Retina, 27 bytes

covf12$*
1
ef
.
$`¶
G`.{7}

Try it online! Explanation:
covf12$*

Add covf plus 12 1s.
1
ef

Change each 1 to ef. This results in the last line of the desired output, but with an extra f.
.
$`¶

Replace the string with a list of all of its proper prefixes.
G`.{7}

Delete the prefixes that are too short.

Perl 5, 45 bytes
$_="covfef
";eval's/((.).)$/$1$2/;print;'x 20

Try it online!

Perl 5, 39 bytes
$b=covfef;say$b.=substr$b,-2,1for 1..21

Try it online!

Ruby - 53 chars
s='covfef';21.times{|i|puts s +=(i.odd? ? 'f' : 'e')}

Note: This is the OP's answer, there must be better one's out there.

I don't know Ruby, but something tells me that you don't need spaces around :.

Note: It is frowned upon to post an answer to your own challenge immediately. You should let others have a chance to answer it and wait at least a day, probably longer.

@TheLethalCoder Fair point, this is my first attempt at posing a code puzzle... I'll delete it, for the time being.


text:
All your base 97 are belong to us
Many programming languages are written using solely printable ASCII, tabs and newlines. These 97 characters are then stored in 8-bit bytes (which are actually capable of holding 256 different characters!), which is just terribly inefficient - especially in code-golfing, where every byte counts! In this challenge, you will be able to reduce your score by using base conversion.
Challenge
Your program/function takes a string or character array as input, which it then interprets as a base-97 number. It then converts this to a  base-256 number, and counts the number of symbols (i.e., bytes) necessary to represent this number. This count will be the output/return value of your program/function.
A simple example using base-2 and base-10 (binary and decimal): if the input is 10110, the output would be 2, since 101102=2210 (two digits necessary to represent output). Similarly, 11012 becomes 1310, giving an output of 2 as well, and 1102 becomes 610, so then the output would be 1.
The input string can contain all 95 printable ASCII characters  , as well as newline \n and literal tab \t, which creates a source alphabet  of 97 symbols for your base conversion. The exact alphabet will thus be (substituting the \t and \n with actual literal tab and newline; note the literal space following the newline):
\t\n !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Note that the order of this alphabet is important: for example, base-97 \t corresponds to decimal 0, and ! corresponds to decimal 3.
Some testcases: (you do not need to handle an empty string)
Input                             Output
'example@domain.com'                  15
'All your base are belong to us!'     26
'       abcd'                          9
'~      abcd'                         10
'ABCDEFGHIJK'                          9
'zyxwvutsrpq'                         10
'{".~"}.~'                             7
'\t\t\t\t\t\t\t\t'                     1 (with \t a literal tab; the result is 0, which can be represented with 1 byte)
'!\t\t\t\t\t\t\t\t'                    7 (with \t a literal tab)

Scoring

If your entry uses only printable ASCII, newline and/or tab:
The score of your program will be the output of your program, when given its own source code as input.

If your entry uses any characters that are not printable ASCII, newline or tab:
The score of your program is simply the number of bytes, like in code-golf.

If you have a better title suggestion than this outdated meme, feel free to post it in the comments!

Did you realize that this challenge could be won with a lenguage answer consisting of only tabs.

@ppperry To be honest, I have very little patience for such answers. Yes, I did realize this, but until someone can actually store the program on their system, it's not going to get my upvote.

Python 2, score 73  72 71
Edit: -1 thanks to @Jonathan Allan
def f(l,z=0):
&#9for i in map(ord,l):z+=i-[30,9][i&lt32];z*=97
	print(len(bin(z))-2)/8or 1

Try it online!

just one / should be OK I think

or 1 may be replaced with |1 in this instance.

@JonathanAllan That yields different (wrong) results.

Oh, yeah it will  >.< - was thinking only gonna get a zero there but it'll bitwise or with the other numbers too.

@JonathanAllan Exactly. It'll work for odd results, but it will add one to even results.

Jelly,  18  17 bytes - score  18  17
-1 byte thanks to Erik the Outgolfer (no need for a list of lists for the translation)
O“µœ½þ‘y_30ḅ97b⁹L

Try it online!
How?
O“µœ½þ‘y_30ḅ97b⁹L - Link: list of characters
O                 - convert from characters to ordinals
 “µœ½þ‘           - code-page indices = [9,30,10,31]
       y          - translate (9->30 and 10->31)
        _30       - subtract 30
           ḅ97    - convert from base 97
               ⁹  - literal 256
              b   - convert to base
                L - length of the result

--The best I've got with ASCII only is a score of 29:
O10,31,9,30y_30Ux"J_1 97*$$$SSb256L

- this is extremely inefficient too. It translates the ordinals like above, but the conversion from base 97 is achieved by repeating the values and summing, rather than using direct multiplication - that is to convert {".~"}.~ it gets the adjusted indexes [93,4,16,96,4,95,16,96] then reverses (U) and repeats them to make [[96,96,..., 97⁷ times ...,96],[16,16,... 97⁶ times ...16],[95,95,... 97⁵ times ...95],[4,4,... 97⁴ times ...4],[96,96,... 97³ times ...96],,[16,16,... 97² times ...,16],[4,4,... 97 times ...4],[93]] and then sums, converts to base 256 and gets the length (if it has not run out of memory :p).

Japt, score 19 (23 bytes)
nHo127 uA9 md)sG l /2 c

Test it online!
By coincidence, I don't think this can be golfed much even with non-ASCII chars...
Explanation
UnHo127 uA9 md)sG l /2 c   Implicit: U = input string, A = 10, G = 16, H = 32
  Ho127                    Create the range [32, 33, ..., 126].
        uA9                Insert 9 and 10 at the beginning of this range.
            md             Map each to a character, yielding ["\t", "\n", " ", "!", ... "~"].
Un            )            Convert U to a number via this alphabet ("\t" -> 0, "~" -> 96, etc.)
               sG          Convert this number to a base-16 (hexadecimal) string.
                  l        Take the length of this string.
                    /2 c   Divide by two and round up to get the length in base-256.
                           Implicit: output result of last expression

J, 36 bytes, score = 30
256#@(#.inv)97x#.(u:9,10,32+i.95)&i.

Try it online!
J uses only the 7-bit ASCII characters for its primitives.
Explanation
256#@(#.inv)97x#.(u:9,10,32+i.95)&i.  Input: string S
                 (              )     Form 7-bit ASCII alphabet
                            i.95        Range [0, 95)
                         32+            Add 32
                    9,10,               Prepend 9 and 10
                  u:                    Convert to characters
                                 &i.  Index of each char in S in that alphabet
            97x#.                     Convert from base 97 to decimal
256   #.inv                           Convert to base 256
   #@                                 Length

Gaia, 14 bytes, score 14
9c₸c₵R]$;B₵rBl

Try it online!
Explanation
9c              Push a tab character. (done like this since tab isn't in the codepage)
  ₸c            Push a linefeed character.
    ₵R          Push all printable ASCII characters.
      ]$        Concatenate everything together.
        ;       Copy second-from-top, implicitly push input. Stack is now [ASCII input ASCII]
         B      Convert input from the base where the ASCII string is the digits.
          ₵rB   Convert that to the base where the code page is the digits (base 256).
             l  Get the length of the result.
                Implicitly output top of stack.

ASCII only
This is the best I could come up with using only ASCII, giving a score of 19:
9c10c8373c'R+e]$;B256Bl

The difficulty is in the conversion of input. The only reasonable way to convert from the base-97 system is to use B, since mapping requires the non-ASCII ¦. Additionally, there isn't currently a way to make a character range without mapping c over a number range, which suffers the same problem. The best solution I could see was constructing the string ₵R and evaling it.

Did you try and make an ASCII only version of this? It may not improve your score (I suppose ₵R and ₵r are not easy to replace, although ₸ obviously is), but it may be interesting to see how it compares.

@Sanchises I did, but the shortest I came up with ended up being 19, since ₵ is code point 8373 and I can't do character ranges in only ASCII either, which is a little frustrating since most of this program is ASCII.

Yes, it's really close to being ASCII only. Quick question: I don't know Gaia but played around with it a bit just now, but is there a way to convert a list of numbers? (like c but applied to each character, $ just shows all the numbers)

@Sanchises You'd have to map c over the list, which would be c¦

Actually ₵r is easy to replace since I could just use 256 instead, I only used that because it's 1 byte shorter and the program wasn't ASCII only anyway.

Python 2, score 60
lambda s:len(bin(reduce(lambda a,c:a*97+ord(c)-[30,9][c<' '],s,0)))+5>>3

Try it online!
Mapping to base-97
The value of a character is obtained by ord(c)-[30,9][c<' ']: its ASCII code, minus 9 for tabs and newlines (which precede ' ' lexicographically), or minus 30 for everything else.
Converting to a number
We use reduce to convert the string to a number. This is equivalent to computing
a = 0
for c in s: a = a*97+ord(c)-[30,9][c<' ']
return a

Computing base-256 length
The return value of bin is a string, which looks somewhat like this:
"0b10101100111100001101"

Call its length L. A value with an n-bit binary representation has a ceil(n/8)-bit base-256 representation. We can compute n as L-2; also, ceil(n/8) can be written as floor((n+7)/8) = n+7>>3, so our answer is L-2+7>>3 = L+5>>3.
The case where the input string has value 0 is handled correctly, as bin returns "0b0", so we return 3+5>>3 = 1.

64

@HalvardHummel fairly sure that should be c>=' ' or else you map space to 23 instead of 2. In ordinary code golf c>'\x1f' (a raw byte) would have helped me, but that isn't printable ASCII…

You are right, my bad

APL, score 24 (bytes*)
⌈256⍟97⊥97|118|¯31+⎕AV⍳⍞

Assumes the default ⎕IO←1, otherwise just change ¯31 to ¯30.
Explanation:
                   ⎕AV⍳⍞  Read a string and convert it to ASCII codepoints + 1
               ¯31+       Subtract 31, so that space = 2, bang = 3, etc.
           118|           Modulo 118, so that tab = 97, newline = 98
        97|               Modulo 97, so that tab = 0, newline = 1
     97⊥                  Decode number from base 97
⌈256⍟                     Ceiling of log base 256, to count number of digits

Examples:
      ⌈256⍟97⊥97|118|¯31+⎕AV⍳⍞
example@domain.com
15
      ⌈256⍟97⊥97|118|¯31+⎕AV⍳⍞
All your base are belong to us!
26
      ⌈256⍟97⊥97|118|¯31+⎕AV⍳⍞
       abcd
9
      ⌈256⍟97⊥97|118|¯31+⎕AV⍳⍞
~      abcd
10

________________
*: APL can be written in its own legacy charset (defined by ⎕AV) instead of Unicode; therefore an APL program that only uses ASCII characters and APL symbols can be scored as 1 char = 1 byte.

Not all APL symbols are in ⎕AV (at least for Dyalog), such as ⍸. All of your symbols do count as one byte each, though. So not every APL symbol = 1 byte like you state in the footnote. (Just thought I'd let you know that.) Also, which APL dialect are you using?

MATL (19 bytes), score 16
9=?1}G9tQ6Y2hh8WZan

Non-printable characters (tab, newline) in the input string are entered by contatenating their ASCII codes (9, 10) with the rest of the string.

Try it online!;
Verify all test cases;
Compute the program's score.

The initial part 9=?1}G is only necessary because of a bug in the Za (base conversion) function, which causes it to fail when the input only consists of "zeros" (tabs here). It will be fixed in the next release of the language.
Explanation
9=      % Implicitly input a string. Compare each entry with 9 (tab)
?       % If all entries were 9
  1     %   Push 1. this will be the ouput
}       % Else
  G     %   Push input string again
  9     %   Push 9 (tab)
  tQ    %   Duplicate, add 1: pushes 10 (newline)
  6Y2   %   Push string of all printable ASCII chars
  hh    %   Concatenate twice. This gives the input alphabet of 97 chars
  8W    %   Push 2 raised to 8, that is, 256. This represents the output
        %   alphabet, interpreted as a range, for base conversion
  Za    %   Base conversion. Gives a vector of byte numbers
  n     %   Length of that vector
        % End (implicit). Display (implicit)

Ruby, 70 bytes, score 58
->n{x=0;n.bytes{|i|x+=i-(i<32?9:30);x*=97};a=x.to_s(2).size/8;a<1?1:a}

Try it online!

Befunge-93, 83 79 bytes, score 74 65
<v_v#-*52:_v#-9:_v#`0:~
 5v$
^6>>1>\"a"* +
 >*- ^   0$<
0_v#:/*4*88\+1\ $<
.@>$

Try it here!
The program first converts the input to a base-97 number, and then counts how many digits are required for a base-256 number. As such, the base-97 number is huge, so big that TIO will output a maximum value of 8 for large values; however, the JS interpreter doesn't care and will output the correct value.

Jelly, score: 18 (bytes)
9,⁷Ọ;ØṖiÐ€⁸’ḅ97b⁹L

Try it online!

Let us continue this discussion in chat.

Perl 5, 76 + 1 (-F) = 77 bytes
}{$d+=97**(@F+--$i)*((ord)-(/	|
/?9:30))for@F;say!$d||1+int((log$d)/log 256)

Try it online!
How?
Implicitly, separate the characters of the input (-F), storing all of that in @F.  Close the implicit while loop and start a new block (}{) (Thanks, @Dom Hastings!).  For each character, multiply its value by 97 to the appropriate power.  Calculate the number of characters by finding the size of the sum in base 256 using logarithms.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Bigger, Better (Broken) Zipper
(Inspired quite heavily by this challenge)
In the original challenge you were to make a horizontal zipper, however, looking down at my hoodie, my zipper is much more vertical (and a little bit broken) :P
Input
You will be given a single string (s), and a pair of integers (a and b) in any format. Where:
a < (length-of-s / 2)
b <= ((length-of-s / 2) - (a + 1)) / 6
Output and Scoring
Your program may be a full program or a function that produces a single string with the correct formatting or an array (one item per line) you choose. Leading and trailing spaces and newlines are optional as long as the characters of the output all line up. eg.
["f     r"],["u     e"],["l     p"],["l     p"],["y     i"],[" o   z "],["  p n  "],["   e   "]

or
"f     r\nu     e\nl     p\nl     p\ny     i\n o   z \n  p n  \n   e   "

are acceptable outputs for test case 1
Standard Loopholes are forbidden and the shortest code in bytes wins.
Any answer with no explanation will not be able to win.
Explanation
To make a zipper you must first remove any whitespace or newline characters from the string. And then fold it in half like so (see test case 1 for more)
abcde fgh ij klmnopqr becomes the two strings below, notice the second half is reversed.
abcdefghi and rqponmlkj
Then starting at the beginnning of each string we place the same indexed character from each substring onto one line with the spacing determined as follows:
[0] a     r -- (a-3) five spaces
[1]  b   q  -- (a-2) three spaces
[2]   c p   -- (a-1) one space
[3]    d    -- (a)
[4]    o
[5]    e
[6]    n
etc...

That makes the base for our zipper. Now the integers a and b.
a is the location of our zip. To determine where the zipper is located we use the index of our output lines as the point to close our zip. eg the square bracketed [3] in my above example is where the zip is.
Before our zipper reaches a close, the above zipper must remain at a five space gap until it reaches a-2 where it closes to 3 spaces and a-1 where it closes to 1 space. Just to be clear, in the above example a = 3 (0-indexed)

b is the number of holes in my zipper. To create a hole in the zip, we split the string out again with some spacing.
Starting with the index of the example hole as h we increase the spacing of h-1 to one space, h to 3 spaces and h+1 back to one space, leaving h-2 and h+2 with just one character per line as they are counted as part of the hole.
After the zip and between each of the holes there must be a gap of one character so our zip looks fully connected between holes.
You get to choose the indexes of the holes, but they must all be present within the 'closed' section of the zipper.
Again using 'abcdefghi' and 'rqponmlkj'

[0] a     r -- (open)
[1]  b   q  -- (closing)
[2]   c p   -- (closing)
[3]    d    -- zip
[4]    o    -- gap
[5]    e    -- start of hole  (h-2)
[6]   n f   -- one space      (h-1)
[7]  m   g  -- three spaces   (hole h)
[8]   l h   -- one space      (h+1)
[9]    k    -- end of hole    (h+2)
[10]   i    -- gap
[11]   j

I'm hoping that all makes sense, if not ask away. In anticipation of questions, you may notice that the character p in my second example is present in the second substring, however, appears at the beginning of its line, this is intended, you must follow the sequence of 1-2-1-2-1-2, taking a character from each half in-turn regardless of its position in the output.
Test Cases
"fully open zipper", 7, 0                     | "fully closed zipper", 0, 0
fullyope reppizn                              | fullyclos reppizde
                                              |
f     r   *Note: i particularly like this     | f
u     e     example as it shows the reversing | r
l     p     of the second half of the string  | u
l     p     causes the words to wrap from top | e
y     i     left to the  bottom and back up   | l
 o   z      the right side                    | p
  p n                                         | l
   e                                          | p
                                              | y
                                              | i
                                              | c
                                              | z
                                              | l
                                              | d
                                              | o
                                              | e
                                              | s

Column 1: "stupidly long unbroken zipper that shouldnt exist on any decent hoodie", 24, 0
Column 2: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris faucibus molestie mi. Aliquam nec fringilla ipsum", 15, 5

:
s     e          |          L     m
t     i          |          o     u
u     d          |          r     s
p     o          |          e     p
i     o          |          m     i
d     h          |          i     a
l     t          |          p     l
y     n          |          s     l
l     e          |          u     i
o     c          |          m     g
n     e          |          d     n
g     d          |          o     i
u     y          |          l     r
n     n          |           o   f
b     a          |            r c
r     n          |             s
o     o          |             e
k     t          |             i
e     s          |            n t
n     i          |           m   a
z     x          |            a m
i     e          |             u
 p   t           |             e
  p n            |             q
   e             |             t
   d             |             i
   r             |             ,
   l             |            l c
   t             |           A   o
   u             |            . n
   h             |             i
   o             |             s
   a             |             m
   h             |            e e
   t             |           c   i
   s             |            t t
                 |             e
                 |             s
                 |             t
                 |             s
                 |             u
                 |             l
                 |             r
                 |             o
                 |             a
                 |             m
                 |             d
                 |             s
                 |             i
                 |             u
                 |             p
                 |            b i
                 |           i   s
                 |            c c
                 |             u
                 |             i
                 |             a
                 |             n
                 |             f
                 |             g
                 |             s
                 |             e
                 |             i
                 |            l r
                 |           i   u
                 |            t a
                 |             .
                 |             M

EDIT: Added Test Cases
"abcde fgh ij klmnopqr","3","1"

a     r
 b   q
  c p
   d
   o
   e
  n f
 m   g
  l h
   k
   i
   j

I think I like this challenge but I've read it three times and I'm still not 100% on exactly what I'm supposed to do. I think it would be worth making the rules and specs shorter and clearer rather than full paragraphs.

I can give it a go :P

any clearer? @TheLethalCoder

Hi, I removed the [tag:printable-ascii] tag, as that is used for restricted-source challenges rather than output layout.

I saw that thanks @AdmBorkBork I edited again to alphabetise the explanation to hopefully make it clearer to see where the characters are coming from.

I´m not sure: Are the positions of the holes determined somehow or may we chose freely?

Clearer yes and @Titus the challenge used to state You get to choose the indexes of the holes, but they must all be present within the 'closed' section of the zipper. but it was edited out. However, I expect this is still the case.

@TheLethalCoder correct, ill add that line back in, i figured it was gonna cause confusion so removed it... :/

a) Can we assume that a is at least 3? b) Do we have to remove the spaces from the input ourselves?

yes to both @Titus

PHP 7.1, 421 412 218 195 192 191 195 bytes
for([,$s,$a,$b]=$argv;$i-$k<strlen($s=strtr($s,[" "=>""]));$p=0)for($t=++$y>$a-2?$y>=$a?$y>$a?$b-->0?_4_4_4_31_23_31:_4:_31:_23:_15;$c=$t[$p++];)echo$c<_?str_pad("",$c).$s[++$f&1?$i++:$k-=1]:"
";

Run with -nr or try it online.
Prints a leading, but no trailing newline and one leading space in each line.

TIO gives me this error:
 Parse error:  syntax error, unexpected ',', expecting ']' in [...][...] on line 7

@Xynos Set the PHP version to 7.1

your answer places the hole too close to the zip, ill add the correct output for your input as a test case :)

@Xynos gaps added

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Binary Magic Cards
There's a cool magic trick that works using the power of binary. The effect of the trick is as follows:

An audience member chooses some natural number in the range of 1 to x where x is chosen by the magician.

The magician hands the audience member some special cards. Each card contains some numbers from 1 to x.

The audience member selects the cards which contain their number.

Almost instantly, the magician can determine the original number selected.

Specification:
The numbers used for the cards are determined based on binary place value. Each card is first labeled with a power of  2. The first card becomes 1, the second becomes 2, the third becomes 4, and so on.
From now on, I will refer to card n as the card labeled with n.
To determine whether a number k is on card n, determine whether k in binary has at 1 at place value n. Consider the numbers k=13 and n=4.
K in binary is 1101. The second digit (n=4) is 1, so k=13, n=4 is a valid combination.
Goal:
Given two natural numbers 0 < n < 128 and 0 < k < 128, determine whether n appears on card k. Any reasonable input and output is allowed. Standard loopholes are banned.
This is code-golf, so the fewest bytes wins.
Test cases

Better add the test cases directly here.

Also, what is determine whether k in binary has at 1 at place value n supposed to mean? Did you mean that the character in the binary representation of k at index n is 1?

@Mr.Xcoder Probably "at" should be "a" but not sure.

Also, what did you mean by The second digit (n=4). Did you refer to the fourth digit? I am not sure I understand.

@Mr.Xcoder No, binary place value 4. So like the 4-s digit.

@HyperNeutrino I don't understand your comment either :P EDIT: I understood. The exponent of 2 such that we reach n (2^2 = 4)!

@Mr.Xcoder You know how we have 1s digits, 10s digits, 100s digits, etc? Same logic applies here

Does the truthy/falsy value have to be consistent?

Why did you swap n and k at the end "determine whether n appears on card k"?

It does not seem at all clear if the input is the binary place or the minimum number on the card (most people seem to be assuming the latter) - first you say "From now on, I will refer to card n as the card labeled with n" then immediately you say "determine whether k in binary has at 1 at place value n.".

Why did you ask a question and put it on hold? Couldn't you simply delete it?

@rahnema1 Only moderators can delete answered questions (when the answerers received reputation for it). This is common if you want to abandon the challenge.

Pyth, 5 bytes
._.&E

Try it here.
Notice the cute face ._.

How?

._.&EQ  -  Q means input and is implicit.

  .&    - Bitwise AND between:
    E     - The second input and
     Q    - The first input.
._      - Sign. 0 if it equals 0, 1 otherwise.

If inconsistent values are allowed:
Pyth, 3 bytes
No cute face this time ._.
.&E

Try it here.

+2 for cute face, -1 for removing it

Jelly, 1 byte
&

Try it online!
Bitwise AND Builtin

After I have seen your comments, I am not sure enitrely you understood. binary place value is 0 for 1, 1 for 2, 2 for 4, 3 for 8 (2^binary_place_value = n). Is that what you do in your answer?

@Mr.Xcoder Now I am not entirely side I understand your comment :P I'm fairly sure this is correct since it checks if the 4s place is truthy, not if the 4th digit from the right is truthy.

@Mr.Xcoder The 4s place is the place where it adds 4 if it's 1, so 2^2. 2^n = binary_place_value

If this is the intended input, then certainly simply & will do since the range is [1,x] and "Any reasonable input and output is allowed." implies truthy/falsey is fine.

@JonathanAllan Cool, thanks.

Proton, 3 bytes
(&)

Try it online!
(Waiting for pull from TIO before it works on TIO but you can verify it by cloning the repository)
Functional operator of the Bitwise AND operator

05AB1E, 2 bytes
&Ā

Try it online!


text:
Find All Distinct Gozinta Chains
Gozinta Chains
(Inspired by Project Euler #606)
A gozinta chain for n is a sequence {1,a,b,...,n} where each element properly divides the next.
For example, there are eight distinct gozinta chains for 12:
{1,12}, {1,2,12}, {1,2,4,12}, {1,2,6,12}, {1,3,12}, {1,3,6,12}, {1,4,12} and {1,6,12}.

The Challenge
Write a program or function that accepts a positive integer (n > 1) and outputs or returns all the distinct gozinta chains for the given number.

Order in the chains matters (ascending), order of the chains does not.
On the off-chance it exists, you cannot use a builtin that solves the challenge.
This is code-golf.

Edit: Removing 1 as a potential input.

Welcome to PPCG. Nice first question!

"On the off-chance it exists [(looking at you, Mathematica!)]"

@AdmBorkBork I had assumed [[1]], but when faced with @EriktheOutgolfer's answer of [1,1] I was at a loss for a reason to rule one way or the other.  I can't find a definitive answer online and am content to defer to @MrXcoder's suggestion to leave it open, until someone turns up an authoritative answer, or compelling reason or convention from the community.

Can the chains be output in reverse, e.g [12,6,2,1]

On the other hand, would it be more interesting to require [[1]]?  Or does the community dislike special cases?

@H.PWiz  No, ascending within chains.

@AdmBorkBork It's in the sandbox, we just missed that.  I've taken your advice and removed 1 as an input.

As AdmBorkBork said, edge-cases are generally added only if they are important to the core of the challenge - if you want a reason for only [[1]] I'd say that if [1,1] is a gozinta of 1 then [1,1,12] is a gozinta of 12 as is [1,1,1,12] and now we can no longer "return all..."

@JonathanAllan 1 isn't going to be ever input.

@JonathanAllan  Looking into it further, I'm with you: I realize a gozinta chain is a factor chain and 1 doesn't factor to 1,1, just 1.  That said, I already made the call and there's 5 answers posted, so it is what it is.

You should make the pun clear in the question for those who don't know it. 2|4 is read "two goes into four" aka "two gozinta four".

Two and a half hours is not enough time for the sandbox to work. See the sandbox FAQ.

@PeterTaylor Thank you.  I had not seen that.  I'm finding it very difficult to find rules and guidelines here as they all seem scattered in this thread and that.  Is there an index thread?

Not as such, but the [meta-tag:faq] tag should be a good start.

Python 3, 68 65 bytes
Edit: -3 bytes thanks to @notjagan
f=lambda x:[y+[x]for k in range(1,x)if x%k<1for y in f(k)]or[[x]]

Try it online!
Explanation
Each gozinta chain consists of the number x at the end of the chain, with at least one divisor to the left of it. For each divisor k of x the chains [1,...,k,x] are distinct. We can therefore for each divisor k find all of its distinct gozinta chains  and append x to the end of them, to get all distinct gozinta chains with k directly to the left of x. This is done recursively until x = 1 where [[1]] is returned, as all gozinta chains start with 1, meaning the recursion have bottomed out.
The code becomes so short due to Python list comprehension allowing double iteration. This means that the values found in f(k) can be added to the same list for all of the different divisors k.

was trying to do this, too late now =/

This answer is incredibly fast compared to the other ones thus far.

-3 bytes by removing the unnecessary list unpacking.

Husk, 13 bytes
ufo=ḣ⁰…ġ¦ΣṖḣ⁰

A somewhat different approach to that of H.PWiz, though still by brute force. Try it online!
Explanation
The basic idea is to concatenate all subsequences of [1,...,n] and split the result into sublists where each element divides the next.
Of these, we keep those that start with 1, end with n and contain no duplicates.
This is done with the "rangify" built-in ….
Then it remains to discard duplicates.
ufo=ḣ⁰…ġ¦ΣṖḣ⁰  Input is n=12.
           ḣ⁰  Range from 1: [1,2,..,12]
          Ṗ    Powerset: [[],[1],[2],[1,2],[3],..,[1,2,..,12]]
         Σ     Concatenate: [1,2,1,2,3,..,1,2,..,12]
       ġ¦      Split into slices where each number divides next: [[1,2],[1,2],[3],..,[12]]
 fo            Filter by
      …        rangified
   =ḣ⁰         equals [1,...,n].
u              Remove duplicates.

I'm guessing it's not any shorter to filter to the arrays in the powerset where each number divides the next?

@ETHproductions No, that's one byte longer.

Jelly, 9 8 bytes
ÆḌß€Ẏ;€ȯ

Try it online!
Uses a similar technique to my Japt answer, and therefore runs very quickly on larger test cases.
How it works
ÆḌß€Ẏ;€ȯ    Main link. Argument: n (integer)
ÆḌ          Yield the proper divisors of n.
       ȯ    If there are no divisors, return n. Only happens when n is 1.
  ß€        Otherwise, run each divisor through this link again. Yields
            a list of lists of Gozinta chains.
    Ẏ       Tighten; bring each chain into the main list.
     ;€     Append n to each chain.

Mathematica, 77 bytes
FindPath[Graph@Cases[Divisors@#~Subsets~{2},{m_,n_}/;m∣n:>m->n],1,#,#,All]&

Forms a Graph where the vertices are the Divisors of the input #, and the edges represent proper divisibility, then finds All paths from the vertex 1 to the vertex #.

Woah, this is pretty clever!

Jelly, 12 bytes
ŒPµḍ2\×ISµÐṀ

A monadic link accepting an integer and returning a list of lists of integers.
Try it online!
How?
We want all the sorted lists of unique integers between one and N such that the first is a one, the last is N, and all pairs divide. The code achieves this filter by checking the pair-wise division criteria is satisfied over the power-set of the range in question, but only picking those with maximal sums of incremental difference (the ones which both start with one and end with N will have a sum of incremental differences of N-1, others will have less).
ŒPµḍ2\×ISµÐṀ - Link: number N
ŒP           - power-set (implicit range of input) = [[1],[2],...,[N],[1,2],[1,3],...,[1,N],[1,2,3],...]
          ÐṀ - filter keep those for which the result of the link to the left is maximal:
  µ      µ   - (a monadic chain)
    2\       -   pairwise overlapping reduce with:
   ḍ         -     divides? (1 if so, 0 otherwise)
       I     -   increments  e.g. for [1,2,4,12] -> [2-1,4-2,12-4] = [1,2,8]
      ×      -   multiply (vectorises) (no effect if all divide,
             -                          otherwise at least one gets set to 0)
        S    -   sum         e.g. for [1,2,4,12] -> 1+2+8 = 11 (=12-1)

Wait there's n-wise overlapping reduce? :o how did I never see that :P I was using <slice>2<divisible>\<each> :P

Using the newest change to Jelly's quicks, you can use Ɲ instead of 2\ for 11 bytes.

Japt, 17 bytes
â¬£ßX m+S+URÃ·ª'1

Test it online!
Weirdly, generating the output as a string was way easier than generating it as an array of arrays...
Explanation
 â¬ £  ßX m+S+URÃ ·  ª '1
Uâq mX{ßX m+S+UR} qR ||'1   Ungolfed
                            Implicit: U = input number, R = newline, S = space
Uâ                          Find all divisors of U,
  q                           leaving out U itself.
    mX{         }           Map each divisor X to
       ßX                     The divisor chains of X (literally "run the program on X")
          m    R              with each chain mapped to
           +S+U                 the chain, plus a space, plus U.
                  qR        Join on newlines.
                     ||     If the result is empty (only happens when there are no factors, i.e. U == 1)
                       '1     return the string "1".
                            Otherwise, return the generated string.
                            Implicit: output result of last expression

So then does your approach avoid generating invalid chains then filtering them, as other approaches do?

@Umbrella Nope, it generates only the valid ones, one divisor at a time, hence why it works lightning-fast even on cases such as 12000 :-)

Very nice use of recursion :) And I'm nicking that ¬ trick! :p

@Shaggy ¬ is one of the reasons why I've implemented a bunch of functions that are basically "do X given no arguments, or Y given a truthy argument" :P

JavaScript (Firefox 30-57), 73 bytes
f=n=>n>1?[for(i of Array(n).keys())if(n%i<1)for(j of f(i))[...j,n]]:[[1]]

Conveniently n%0<1 is false.

Mathematica, 60 bytes
Cases[Subsets@Divisors@#,x:{1,___,#}/;Divisible@@Reverse@{x}]&

Uses the undocumented multi-arg form of Divisible, where Divisible[n1,n2,...] returns True if n2∣n1, n3∣n2, and so on, and False otherwise. We take all Subsets of the list of Divisors of the input #, then return the Cases of the form {1,___,#} such that Divisible gives True for the Reversed sequence of divisors.

So, Divisible is basically a builtin for verifying a gozinta chain?

@Umbrella It doesn't check for proper divisibility.

Haskell, 107 100 95 bytes
f n=until(all(<2).map head)(>>=h)[[n]]
h l@(x:_)|x<2=[l]|1<2=map(:l)$filter((<1).mod x)[1..x-1]

Maybe there is a better termination condition (tried something like
f n=i[[n]]
i x|g x==x=x|1<2=i$g x
g=(>>=h)

but it's longer). The check for 1 seems prudent as scrubbing repeat 1s or duplicates (nub not in Prelude) is more bytes.
Try it online.

(>>=h) for (concatMap h)

95 bytes

Holy crap am I stupid about u ...

Haskell (Lambdabot), 92 85 bytes
x#y|x==y=[[x]]|1>0=(guard(mod x y<1)>>(y:).map(y*)<$>div x y#2)++x#(y+1)
map(1:).(#2)

Needs Lambdabot Haskell since guard requires Control.Monad to be imported. Main function is an anonymous function, which I'm told is allowed and it shaves off a couple of bytes.
Thanks to Laikoni for saving seven bytes.
Explanation:
Monads are very handy.
x # y

This is our recursive function that does all the actual work. x is the number we're accumulating over (the product of the divisors that remain in the value), and y is the next number we should try dividing into it.
 | x == y = [[x]]

If x equals y then we're done recursing. Just use x as the end of the current gozinta chain and return it.
 | 1 > 0 =

Haskell golf-ism for "True". That is, this is the default case.
(guard (mod x y < 1) >>

We're operating inside the list monad now. Within the list monad, we have the ability to make multiple choices at the same time. This is very helpful when finding "all possible" of something by exhaustion. The guard statement says "only consider the following choice if a condition is true". In this case, only consider the following choice if y divides x.
(y:) . map (y *) <$> div x y#2)

If y does divide x, we have the choice of adding y to the gozinta chain. In this case, recursively call (#), starting over at y = 2 with x equal to x / y, since we want to "factor out" that y we just added to the chain. Then, whatever the result from this recursive call, multiple its values by the y we just factored out and add y to the gozinta chain officially.
++

Consider the following choice as well. This simply adds the two lists together, but monadically we can think of it as saying "choose between doing this thing OR this other thing".
x # (y + 1)

The other option is to simply continue recursing and not use the value y. If y does not divide x then this is the only option. If y does divide x then this option will be taken as well as the other option, and the results will be combined.
map (1 :) . (# 2)

This is the main gozinta function. It begins the recursion by calling (#) with its argument. A 1 is prepended to every gozinta chain, because the (#) function never puts ones into the chains.

Great explanation! You can save some bytes by putting the pattern guards all in one line. mod x y==0 can be shortened to mod x y<1. Because anonymous functions are allowed, your main function can be written pointfree as map(1:).(#2).

Haskell, 51 bytes
f 1=[[1]]
f n=[g++[n]|k<-[1..n-1],n`mod`k<1,g<-f k]

Recursively find gozinta chains of proper divisors and append n.
Try it online!

I feel there should be extra credit for properly handling 1.  Since we collectively concluded to exempt 1, could you save 10 bytes by removing that case?

@Umbrella 1 is not a special case for this algorithm, it is needed as base case for the recursion. On its own, the second defining equation can only return the empty list.

I see.  My solution (yet unposted) uses [[1]] as a base also.

Jelly, 17 bytes
ḊṖŒP1ppWF€ḍ2\Ạ$Ðf

Try it online!

That was impressively fast.  Your result for 1 is unexpected, though.  I haven't managed to find a definitive result for 1, but I assumed it was [[1]].  I can't say for sure that [1,1] is incorrect except that all other results are increasing sequences.  Thoughts?

@Umbrella You might want to let the answers do anything for 1.

@Umbrella If it's a problem I can fix it for +2 (replace ;€ with ;Q¥€).

Mathematica, 104 bytes
(S=Select)[Rest@S[Subsets@Divisors[t=#],FreeQ[#∣#2&@@@Partition[#,2,1],1>2]&],First@#==1&&Last@#==t&]&

FreeQ[...] can become And@@BlockMap[#∣#2&@@#&,#,2,1]

very nice! but I get an extra message DeveloperPartitionMap::nlen: -- Message text not found -- >>` why is that?

BlockMap uses the Developer`PartitionMap function internally, but since it's a developer function, it has no error messages. The error is caused by the lists that have 1 or 0 elements, which you cannot make 2-partitions with.

Mathematica 86 77 Bytes
Select[Subsets@Divisors@#~Cases~{1,___,#},And@@BlockMap[#∣#2&@@#&,#,2,1]&]&

Brute force by the definition.
Wishing there was a shorter way to do pairwise sequential element comparison of a list.
Thanks to @Jenny_mathy and @JungHwanMin for suggestions saving 9 bytes

you can use FreeQ[#∣#2&@@@Partition[#,2,1],1>2]&] (as the second argument) to go to 82 bytes

@Jenny_mathy Or better, And@@BlockMap[#∣#2&@@#&,#,2,1]

Mathematica, 72 bytes
Cases[Subsets@Divisors@#,{1,___,#}?(And@@BlockMap[#∣#2&@@#&,#,2,1]&)]&

Explanation
Divisors@#

Find all divisors of the input.
Subsets@ ...

Generate all subsets of that list.
Cases[ ... ]

Pick all cases that match the pattern...
{1,___,#}

Beginning with 1 and ending with <input>...
?( ... )

and satisfies the condition...
And@@BlockMap[#∣#2&@@#&,#,2,1]&

The left element divides the right element for all 2-partitions of the list, offset 1.

TI-BASIC, 76 bytes
Input N
1→L1(1
Repeat Ans=2
While Ans<N
2Ans→L1(1+dim(L1
End
If Ans=N:Disp L1
dim(L1)-1→dim(L1
L1(Ans)+L1(Ans-(Ans>1→L1(Ans
End

Explanation
Input N                       Prompt user for N.
1→L1(1                        Initialize L1 to {1}, and also set Ans to 1.

Repeat Ans=2                  Loop until Ans is 2.
                              At this point in the loop, Ans holds the
                              last element of L1.

While Ans<N                   While the last element is less than N,
2Ans→L1(1+dim(L1              extend the list with twice that value.
End

If Ans=N:Disp L1              If the last element is N, display the list.

dim(L1)-1→dim(L1              Remove the last element, and place the new
                              list size in Ans.

L1(Ans)+L1(Ans-(Ans>1→L1(Ans  Add the second-to-last element to the last
                              element, thereby advancing to the next
                              multiple of the second-to-last element.
                              Avoid erroring when only one element remains
                              by adding the last element to itself.

End                           When the 1 is added to itself, stop looping.

I could save another 5 bytes if it's allowed to exit with an error instead of gracefully, by removing the Ans>1 check and the loop condition. But I'm not confident that's allowed.

Did you type this into your calculator?  Because that's unexpected and somewhat impressive.

Yep! The tricky part about TI-BASIC is that there are only global variables, so I had to effectively use the list itself as my recursion stack.

Husk, 17 16 bytes
-1 byte, thanks to Zgarb
foEẊ¦m`Je1⁰Ṗthḣ⁰

Try it online!

Short, but slow.  I put 50 in the input and it timed out.  What is the gist of your approach?

It essentially tries all possible chains and picks the ones that match the spec

@Umbrella TIO has a 60-second timeout, it's not the program's fault.

o\:⁰:1can be`Je1⁰`

@Zgarb Once again...

@H.PWiz All possible chains, is that O(n!)?

@Umbrella, All increasing chains so O(2^n)

PHP 147 141
Edited to remove a redundant test
function g($i){$r=[[1]];for($j=2;$j<=$i;$j++)foreach($r as$c)if($j%end($c)<1&&$c[]=$j)$r[]=$c;foreach($r as$c)end($c)<$i?0:$R[]=$c;return$R;}

Explained:
function g($i) {

15 chars of boilerplate :(
    $r = [[1]];

Init the result set to [[1]] as every chain starts with 1.  This also leads to support for 1 as an input.
    for ($j = 2; $j <= $i; $j++) {
        foreach ($r as $c) {
            if ($j % end($c) < 1) {
                $c[] = $j;
                $r[] = $c;
            }
        }
    }

For every number from 2 to $i, we're going to extend each chain in our set by the current number if it gozinta, then, add the extended chain to our result set.
    foreach ($r as $c) {
        end($c) < $i ? 0 : $R[] = $c;
    }

Filter out our intermediate chains that didn't make it to $i
    return $R;
}

10 chars of boilerplate :(

Mathematica
f[1] = {{1}};
f[n_] := f[n] = Append[n] /@ Apply[Join, Map[f, Most@Divisors@n]]

Answer is cached for additional calls.

Welcome to the site! This is a [tag:code-golf] so you should include your byte count and in addition attempt to remove all extra whitespace, which I suspect you have some.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Finding your partner
Challenge
Given an arbitrary list of 2-tuples, and a single element in one of those tuples, output its "partner", i.e. given a and [(i,j),...,(a,b),...,(l,m)], output b. You can assume all tuples are unique, and that all elements in tuples are strings. Further assume you do not have both (x,y) and (y,x).
Test cases
Input                                                           Output

[("(", ")"), ("{", "}"), ("[", "]")], "}"                       "{"
[("I'm", "So"), ("Meta", "Even"), ("This", "Acronym")], "Even"  "Meta"
[("I", "S"), ("M", "E"), ("T", "A")], "A"                       "T"
[("test", "cases"), ("are", "fun")], "test"                     "cases"
[("sad", "beep"), ("boop", "boop")], "boop"                     "boop"

Fewest bytes wins!

Also, what to do if the input appears several times, or doesn't appear

I don't suppose we can take input as a flat list, right? For example, [a, b, c, d] instead of [(a, b), (c, d)]. It would shave a ton of bytes off my answer. :P

I have edited to hopefully clear some stuff up and have added test cases. Feel free to roll back if anything is wrong.

@totallyhuman I specifically asked about (a,a) and was told it would not happen. Nate then even edited the question to specify this fact. However you've added a test case with such an entry and also edited the specification reversing this decision - why? It's broken a bunch of answers.

It seems I misunderstood this comment. What does "oh well" mean?

@totallyhuman I took it to mean "return anything, crash, whatever" especially since the post was then revised to say everything would be unique.

Japt, 6 bytes
Works with strings or integers.
æøV kV

Test it

Explanation
Implicit input of array U and string/integer V.
æ

Get the first element (subarray) in U that ...
øV

Contains V.
kV

Remove V and implicitly return the resulting single-element array.

That's... I literally tried that exact scenario, same input and all. I must have missed something... EDIT: Oh right, I was using f instead of æ at the time. Duh :P

@ETHproductions: Makes a nice change - usually I'm the one who forgets about æ and tries to muddle through with f! :D

Haskell, 33 bytes
x!((a,b):c)|x==a=b|x==b=a|1<2=x!c

Try it online!
Defines a binary operator !, which takes as its left argument a value x of type τ and as its right argument a list of tuples (τ, τ). The definition pattern matches on the head (a,b) and tail c of the given list; if x==a then b is returned; if x==b then a is returned, and otherwise we go on looking in the rest of the list by recursing.
  'f' ! [('a', 'b'), ('c', 'd'), ('e', 'f'), ('g', 'h')]
≡ 'f' ! [('c', 'd'), ('e', 'f'), ('g', 'h')]
≡ 'f' ! [('e', 'f'), ('g', 'h')]
≡ 'e'

(If there’s no “partner” in the list, this will crash, because we didn’t define what x![] should be.)

MATL, 4 14 5 6 bytes
yY=P)u

Try it online!
Input is an array as [{a;b},{c;d}]. Bytecount fluctuates heavily while the OP figures out what's actually allowed.
y     % Implicitly input tuples T and 'lonely element' E, duplicate from below to get [T E T] on the stack
 Y=   % String comparison, element wise, between T and E. Yields a boolean array with a 1 at the correct location.
   P  % Flip this array vertically, to put the 1 at the 'partner' of E.
    ) % Select this partner from the bottom T.

I started off with a 4-byte version that could only handle single-character strings, which was the only testcase in the original challenge. When this turned out to be invalid, I made a very long 14-byte version, which was nice and hacky (check the revision history!), made me discover a bug, and then turned out to be completely unnecessary as Y=, with suitable input, worked just as well as my original 4-byte y=P).

JavaScript (ES6), 39 bytes
e=>g=([[b,c],...a])=>e==b?c:e==c?b:g(a)

Takes the entry and array of arrays as curried arguments. Best non-recursive version I could do was 44 bytes:
e=>a=>a.find(a=>a.includes(e)).find(b=>b!=e)

Here's a 41-byte non-recursive solution: a=>b=>a.map(e=>b=e[1-e.indexOf(b)]||b)&&b

You ... You finally gave in to currying?! :o

@Shaggy Normally I don't bother for the (a,b)=> => a=>b=> type of currying, but the non-recursive version started out from the recursive version, which was curried because I was able to save 2 bytes on the recursive call (the currying itself actually costs a byte).

Python 2, 37 bytes
lambda x,y:dict(x+map(reversed,x))[y]

Try it online!
Proton, 31 bytes
a,b=>dict(a+map(reversed,a))[b]

Try it online!
(These two answers are so similar that I'm posting them together to avoid repfarming)

Rename reversed to reverse in Proton for -1 byte. \s :P More seriously, reverse is a much better name, no? :P

@totallyafloppydisk maybe /shrug but I didn't rename most of the Python builtins that get carried over to Proton

@Sanchises I don't see what's wrong?

Sorry my bad, disregard that comment.

Jelly, 6 bytes
ċÞṪ⁻ÞṪ

A dyadic link taking the list partners on the left and the lost-partner on the right and returning the partner.
Try it online!
How?
ċÞṪ⁻ÞṪ - Link: list, partners; item, lost-partner
 Þ     - sort (the tuples) by:
ċ      -   count occurrence of lost-partner
  Ṫ    - tail (gets the tuple containing the lost-partner)
    Þ  - sort (that tuple's items) by:
   ⁻   -   not equals (non-vectorising version)
     Ṫ - tail (get the other one, or the rightmost one if they were equla)

This is invalid since the new testcases have been added.

Thanks for pointing that out - I've commented under the question to the editor (I had specifically asked the OP about (a,a) and was told we did not need to handle it). I'm sure I could fix it, but am unsure if the specification is as it was intended now.

Hmm, although looking at the revision history it seems we need to support strings not just characters so this wont work anyway...

Works with the new spec now.

That was my interpretation too of the "oh well" comment, but evidently this was not the case.

May be worth noting that œ- in place of ⁻ÞṪ could also handle (a,a) if the elements weren't strings. Probably not worth the edit, of course

Python 2, 59 45 42 bytes
-14 bytes thanks to Emigna. -3 bytes thanks to Maltysen.
lambda l,v:sum(l,())[sum(l,()).index(v)^1]

Try it online!
Still wanna use currying though. ;-;

45 bytes

Aha, knew there was a shorter way of doing y+[1,-1][y%2]. Just didn't think it was bitwise... Thanks!

Perl 5, 30 + 1 (-p) = 31 bytes
$_={@f=eval$_,reverse@f}->{<>}

Try it online!

Mathematica 27 24 Bytes
Cases picks out elements of a list that match a pattern.  When used with an arrow, elements matching patterns can be transformed.
Cases[{#,x_}|{x_,#}:>x]&

Usage:
%[3][{{1, 2}, {3, 4}}]

Explanation:  In this example, after encountering the first argument, 3, the function becomes Cases[{3,x_}|{x_,3}:>x] which is an operator form of Cases that is then applied to the 2nd argument, {{1, 2}, {3, 4}}, thus selecting the companion of 3, whether it be in the abscissa or ordinate position.  Notably, this function will list out all of the companions if in fact the 1st argument appears more than once within the 2nd argument, in other words, this goes a little beyond the assumptions of the stated question.
Enclosing glyphs must be squiggly braces. Saved 3 bytes with "Currying" suggestion from @Notatree

If you have version 10 and you take input by currying, you can save 3 bytes: Cases[{#,x_}|{x_,#}:>x]&, used like %[3][{{1,2},{3,4}}]

Can you explain this one a bit?

R, 47 42 bytes
function(v,a)a[(i=min(which(v==a)))+(i%%2*2-1)]

Try it online!
Works on either a matrix or a straight vector.  v = the search value, a = tuple array.

C++, 179 bytes
#include<vector>
#include<string>
#define S std::string
S f(std::vector<std::pair<S,S>>s,S t){for(auto&a:s){if(a.first==t)return a.second;if(a.second==t)return a.first;}return"";}

C++ w/ map data type, 162 bytes
#include<map>
#include<string>
#define S std::string
S f(std::map<S,S>s,S t){for(auto&a:s){if(a.first==t)return a.second;if(a.second==t)return a.first;}return"";}

With MSVC, the code compiles even if the last return statement ( return""; ) is omitted. It makes the code 9 bytes lighter, BUT exiting by the function end ( i.e. not exiting by a return statement in the loop ) with no return statements will cause undefined behavior, and not work if the tuple array does not contains the "key" element

PowerShell, 36 Bytes
param($a,$c)$a|?{$c-in$_}|%{$_-ne$c}

finds the element containing the intput, then gets the 'other' element by excluding the input from it, PowerShell doesn't have the most amazing array management but there might be a built-in for this i'm not aware of.
.\Partner.ps1 (("I'm","So"),("Meta","Even"),("This","Acronym")) "Even"
Meta

This approach doesn't work for the ("boop", "boop") test case.

Röda, 30 bytes
f a{[(_+"")[1-indexOf(a,_1)]]}

Try it online!
Explanation:
f a{[(_+"")[1-indexOf(a,_1)]]}
f a{                         } /* Function f(a)                         */
                               /* For each pair _1 in the stream:       */
              indexOf(a,_1)    /*   Index of a in _1 or -1 if not found */
            1-                 /*   Subtract from 1 to get the index of
                                     the other value in the pair or 2 if
                                     a is not in the pair               */
     (_+"")                    /*   Append "" to _1                     */
           [               ]   /*   Get element the other element or "" */
    [                       ]  /*   Push it to the straem               */
                               /* All values in the stream are printed  */

Pyth - 11 9 8 bytes
h-hf}QTE

Try it online here.

Haskell, 65 62 bytes
c#(a,b)|a==c=b|1>0=a
x%l=x#(snd(span(\(a,b)->a/=x&&b/=x)l)!!0)

Try it online!
Explanation
This uses span to find the first instance where x is contained by the tuple.  It then grabs the first element of the tuple if its not equal and the second otherwise.
Haskell Lambdabot, 59  56 bytes
c#Just(a,b)|a==c=b|1>0=a
x%l=x#find(\(a,b)->a==x||b==x)l

Try it online!
Explanation
This uses Data.Lists first function to cut down on the bytes used by (!!0).snd.span, however because first returns a Maybe we need to add Just to our pattern match in #.

Don’t overthink it… x!((a,b):c)|x==a=b|x==b=a|1<2=x!c is 33 bytes.

@Lynn Go ahead and post it.  I feel a bit foolish for not thinking of that, but its really your answer.

Fair, posted ^^

Husk, 10 bytes
→ḟo=⁰←S+m↔

Try it online!
Ungolfed/Explanation
            -- example input:                         4 [(1,2),(3,4)]
      S+    -- concatenate list with                -
        m↔  --   itself but all pairs flipped       -   [(1,2),(3,4),(2,1),(4,3)]
 ḟo         -- find first occurence where           -
   =⁰←      --   the left element is equal to input -   (4,3)
→           -- get the right element                -   3

Note: The above example works on integers just for the sake of readability, the type itself doesn't matter (as long as you can compare it).

05AB1E, 7 bytes
.åÏ`¹K`
  Ï      # keep only pairs that contain the first input
   `     # flatten
    ¹K   # remove the first input
      `  # flatten

Try it online!
Alternative 7 byte solution
˜DIkX~è
˜        # deep flatten
 D       # duplicate
  Ik     # get the index of the second input in this list
    X^   # XOR with 1
      è  # get the element at this index

Try it online!

˜D²k>è for 6, unless there's a specific reason for XOR'ing with 1?

@MagicOctopusUrn: The reason is that even indices should decrement and odd indices increment.

Except the reverse of what I wrote there...

Common Lisp, 74 bytes
(lambda(a x)(or(cdr(assoc x a :test'equal))(car(rassoc x a :test'equal))))

Try it online!

Java 8, 78 bytes
A lambda (curried) from Stream<List<String>> to a lambda from String to String (although implicit typing happens to allow this to work for arbitrary lists). The language has no dedicated tuple classes, and I'm not aware of any in the standard library, so input pairs are represented as lists. Can be assigned to Function<Stream<List<String>>, Function<String, String>>.
l->s->l.filter(p->p.contains(s)).map(p->p.get(1-p.indexOf(s))).findAny().get()

Try It Online
I'll credit the saving of the last 6 bytes to anyone who can convince me that returning an Optional is valid. I haven't been able to convince myself.
One of the interesting parts of this solution for me was determining the cheapest way to get the output from the stream. I considered reduce, findFirst, and min/max, but none was shorter than the intuitive findAny.

C# (.NET Core), 101 100 + 18 bytes
thank you to  Grzegorz Puławski helping reducing a couple of bytes.
x=>y=>x.Where(z=>z.Item1==y).FirstOrDefault()?.Item2??x.Where(z=>z.Item2==y).FirstOrDefault()?.Item1

Try it online!
C# (.NET Core), 122 121 120 bytes
x=>y=>{for(int i=0;i<x.Length;i++){if(x[i].Item1==y){return x[i].Item2;}if(x[i].Item2==y){return x[i].Item1;}}return"";}

Try it online!

x=>y=> is shorter than (x,y)=> (Func<a, b, c> becomes Func<a, Func<b, c>> and function call f(a, b) becomes f(a)(b)) - Great answer btw!

Also for first answer, the function itself doesn't use anything but System.Linq, so you can add only 18 bytes to answer (using System.Linq; versus namespace System.Linq{})

@GrzegorzPuławski thank you for the help and the compliment, hopefully i fixed the answers up to snuff

JavaScript (ES6), 45 bytes
Came up with this last night then noticed Neil had beaten me to a better JS solution; figured I may as well post it anyway.
Works with strings and integers.
a=>n=>a.reduce((x,y)=>y[1-y.indexOf(n)]||x,0)

Prolog (SWI), 43 bytes
f([[A,B]|T],X,R):-A=X,R=B;B=X,R=A;f(T,X,R).

Try it online!

QBIC, 30 bytes
{_?~A=G|_X]_?~A=;|Z=B]~B=C|Z=A

QBIC isn't strong on lists and tuples. The above code takes a as a command line parameter, then asks for user input in pairs for the tuples. When an empty element is given, it outputs b.
Sample run
Command line: Even
I'm
So
Meta
Even
This
Acronym

Meta

Explanation
{           DO infinitely
_?          Ask for part 1 of tuple, A$
~A=G|  ]    IF A$ is empty (equal to G$, which is undefined and therefore "") THEN
     _X         Quit
_?          Ask for part 2 of tuple, B$
~A=;|       IF part 1 of the tuple equals teh cmd line param (loaded in as C$) THEN
    Z=B]        set Z$ to part 2 of the tuple (Z$ gets printed when QBIC quits)
~B=C|Z=A    IF part 2 of the tuple matches input, set Z$ to part 1
            The final IF and the DO loop are closed implicitly

Alternative version, 22 bytes
{_?_?~A=;|_XB]~B=C|_XA

This basically does the same as the longer version, but immediately quits when it finds a match. I've listed this as the alternative, because you can't input all tuples into this program given that it quits early.

Swift 4, 43 bytes
{a,m in a.flatMap{$0==m ?$1:$1==m ?$0:nil}}

The output is an array, which is either empty (no partner found), or has a single element (the partner).
Test cases:
let testcases: [(pairs: [(String, String)], match: String, expected: String)] = [
    (
        pairs: [("(", ")"), ("{", "}"), ("[", "]")],
        match: "}", expected: "{"
    ),
    (
        pairs: [("I'm", "So"), ("Meta", "Even"), ("This", "Acronym")],
        match: "Even", expected: "Meta"
    ),
    (
        pairs: [("I", "S"), ("M", "E"), ("T", "A")],
        match: "A", expected: "T"
    ),
    (
        pairs: [("test", "cases"), ("are", "fun")],
        match: "test", expected: "cases"
    ),
    (
        pairs: [("sad", "beep"), ("boop", "boop")],
        match: "boop", expected: "boop"
    ),
]

for (caseNumber, testcase) in testcases.enumerated() {
    let actual = f(testcase.pairs, testcase.match).first

    assert(actual == testcase.expected,
        "Testcase #\(caseNumber) \((testcase.pairs, testcase.match)) failed. Got \(String(reflecting: actual)), but expected \(testcase.expected)!")
    print("Testcase #\(caseNumber) passed!")
}

Arturo, 32 bytes
$[a,s][--select.n:1a=>[in? s&]s]

Try it

Mathematica, 50 bytes
(t={#2};Select[Complement[#,t]&/@#,Length@#==1&])&

Try it online!

This doesn't work for the {'boop','boop'} testcase.

@Sanchises"boop" wasn't there when I answered and the question was not about [a,a] tuples.I believe answers before boop-edit are valid

I don't know the policy on clarifications of the OP invalidating existing answers; it was just a heads-up about the edit.

Ruby, 31 bytes
->a,e{e=*e;a.find{|p|p!=p-e}-e}

Returns a singleton array.

Stacked, 21 bytes
[:$revmap,KeyArray\#]

Try it online! This takes input from the the stack and leaves output on the stack. Expanded, this looks like:
[ : $rev map , KeyArray \ # ]

Explanation
Let's take (('sad' 'beep') ('boop' 'boop')) and 'boop' as the input. Then, an array like so is constructed by :$revmap,:
(( 'sad' 'beep')
 ('boop' 'boop')
 ('beep'  'sad')
 ('boop' 'boop'))

That is, a copy of the array is map, each member is reversed, and the two are concatenated together. KeyArray in turn makes a hash out of the values given, like so:
KeyArray [ sad => beep, boop => boop, beep => sad, boop => boop ]

Then, \ brings the search string to the top of the stack, and obtains the key from the KeyArray that matches with #. This returns only one value, so the duplicate key in the KeyArray does not need to be worried about.
Other approaches
32 bytes: (input from stack, output to STDOUT) [@x:$revmap,uniq[...x=$out*]map]
36 bytes: {%x[y index#+]YES 0# :y neq keep 0#}
38 bytes: [@x:$revmap#,[KeyArray x#]map:keep 0#]
46 bytes: [@x:KeyArray\$revmap KeyArray,[x#]map:keep 0#]

Excel, 18 Bytes
Anonymous Excel Workbook Formula that takes input as <Lookup Value> from range A1, <Key Array> from range B:B and <Def Array> from range C:C, and outputs the value of the definition associated with the lookup value to the calling cell
=VLOOKUP(A1,B:C,2)

Sample I/O shall be included when possible


text:
Proper army (Canadian Air Cadet) squadron formation
(Note: I'm not in the army so feel free to correct me if my formation is wrong, but I will not be changing the question. I will change any terminology mistakes though, because I'm trying to avoid air-cadet-specific wording choices)
(Note: this follows the standards for Canadian Air Cadets, not any actual army thing)
Challenge
Given some configurations for a squadron, output what it should look like.
You will use 1 non-whitespace character to represent people.
Configuration
The configuration will consist of a mandatory non-empty list, a mandatory positive integer, and an optional positive integer. The list represents the number of people per "squad", the mandatory integer represents the maximum number of rows, and the optional integer represents the number of "squads" in the squadron; in other words, the length of the list.
Each squad looks like this (without the commanders):
X X X X X
X   X X X
X   X X X

This would be a squad with 13 people in 3 rows.
A squad must be strictly wider than it is tall, unless it's a single person, in which case it's 1 × 1. It must also be as tall as possible (within the restriction for the number of rows); that is, once it is one larger than a perfect square, it should form another row. An exception is that when there are 5 people, it should still be a single row.** The gap is always placed in the second column from the left, starting from the second row and moving downwards. For example, with 28 people and 5 rows maximum:
X X X X X X
X   X X X X
X   X X X X
X X X X X X
X X X X X X

Then, after the squad is formed, a commander is to be placed 2 rows above and below the squad, in the exact centre. For odd width squads:
    X

X X X X X
X X X X X
X X X X X

    X

And for even width squads:
   X

X X X X
X X X X
X X X X

   X

Hopefully you now understand how an individual squad is formed. Then, to form a squadron, each squad has 7 blank columns between it. For example, with a maximum row count of 3 and three squads of size 15, 16, and 17:
                      X

    X                X                 X

X X X X X       X X X X X X       X X X X X X
X X X X X       X   X X X X       X   X X X X
X X X X X       X   X X X X       X X X X X X

    X                X                 X

Then, in the final step, a commander is placed two rows above the row of front commanders, directly in the centre of the squadron, to the left if it has even width. In the example above, that would be the X at the very top.
The final output may contain trailing whitespace on each line and an optional trailing newline.
Here's a reference implementation: Try It Online! (Python 3)
Input
Input will be given in any flexible format with the 3 components listed above: list, int[, int].
Rules

Standard loopholes apply
Output must be in this exact format (of course, you may choose the character to use)
Newline may be CR, LF, or CRLF
Trailing whitespace is allowed
Trailing newline is allowed

**Except our squadron's Flag Party formed a 3x2 pseudorectangle :P

Sandbox Post

'Murica

Python 3, 308 314 309 305 269 bytes
Input is the number rows in a squad and a list with a single integer for each squad, indicating the number of persons in the squad.
Could probably be golfed quite a bit.
Edit: +6 bytes, fixed a bug for squads with the same number of persons as rows
Edit: -6 bytes thanks to @Mr.Xcoder
Edit: -36 bytes by combining everything to one function
def z(r,l,v=" ",z="X "):q=[z,v]+[(v*6).join(([z.center((w//r+(w%r>0))*2),v]+[r*[z],[z+[z,v*2][I*w%r and r>=w%r+I]+z*(w//r+(w%r>0)-2)for I in range(r)]][w>r]+[v,z.center((w//r+(w%r>0))*2)])[i]for w in l)for i in range(r+4)];return"\n".join(p.center(len(q[2]))for p in q)

Try it online!

308 bytes

Batch, 628 bytes
@echo off
call:s 1 %1 %4
call:s 2 %2 %4
call:s 3 %3 %4
set s=%s1%X%s1%       %s2%X%s2%       %s3%X
echo %s1%    %s2%    %s3%X
echo(
echo %s%
echo(
for /l %%i in (1,1,%4)do call:r %%i
echo(
echo %s%
exit/b
:q
set/ah=h%1,f=f%1
call set x=%%x%1%%
if %2 gtr %f% set x=X  %x:~3%
if %2 gtr %h% set x=%x:X= %
set r=%r%%x%
exit/b
:r
set r=
for %%j in (1 2 3)do call:q %%j %1
if not "%r: =%"=="" echo %r%
exit/b
:s
set h=%3
if %2==5 set h=1
:t
set/aw=~-%2/h+1
if %w% leq %h% set/ah-=1&goto t
set x=X
for /l %%i in (2,1,%w%)do call set x=%%x%% X
set/ah%1=h,f%1=%2-h*~-w
set x%1=%x%
set s%1=%x:X=%

Takes the three squad sizes and the height as parameters. Explanation:
call:s 1 %1 %4
call:s 2 %2 %4
call:s 3 %3 %4

Calculate the dimensions of each squad.
set s=%s1%X%s1%       %s2%X%s2%       %s3%X

Calculate the squad commanders. The sN variables hold a number of spaces equal to half the width in characters of the squads rounded down, so adding this on both sides centres each commander.
echo %s1%    %s2%    %s3%X
echo(

Calculate and output the position of the front commander. This is similar to the case of the individual commanders except for the additional spacing between the squads, which has to be rounded up to allow for the sN being rounded down.
echo %s%
echo(

Output the first row of individual commanders.
for /l %%i in (1,1,%4)do call:r %%i

Output the squads.
echo(
echo %s%
exit/b

Finish by outputting the second row of per-squad commanders.
:q
set/ah=h%1,f=f%1
call set x=%%x%1%%

Get the height, full width rows and full width cadet string for the squad.
if %2 gtr %f% set x=X  %x:~3%

If this is not a full width row, remove the second cadet.
if %2 gtr %h% set x=%x:X= %

If all the rows have already been output, remove all the cadets.
set r=%r%%x%
exit/b

Add any remaining cadets to the overall row.
:r
set r=
for %%j in (1 2 3)do call:q %%j %1
if not "%r: =%"=="" echo %t%
exit/b

Given a row in %1, add each squad's cadets for that row and output the result.
:s
set h=%3
if %2==5 set h=1
:t
set/aw=~-%2/h+1
if %w% leq %h% set/ah-=1&goto t

Calculate the number of rows and columns for this squad.
set x=X
for /l %%i in (2,1,%w%)do call set x=%%x%% X

Calculate the full width cadet string for this squad.
set/ah%1=h,f%1=%2-h*~-w
set x%1=%x%

Calculate the number of full width rows and save all the results in per-squad variables.
set s%1=%x:X=%

Also calculate the half-width string for centring purposes.


text:
Enumerate a Cell Notation
So we're all hopefully familiar with Spreadsheet 'A1' cell notation.
It's simply an alphanumeric representation of the positioning of said cell within a grid.
The letter(s) represent the column positioning of the cell, and the number represents the row.
The 'letter' part can consist of 1 or more letters from the 26 letter English alphabet, all of which must be capital letters. These map to numbers through the use of 26-adic bijective numeration.
The 'number' part can consist of any positive, non-zero integer.

The challenge, write a program that given the A1 notation of any cell as a single string, can output a string containing the column position represented as a number, followed by a space and then the row number.
Sample Input/Outputs below:
A1
>>1 1
B10
>>2 10
AC4
>>29 4
AAC753
>>705 753
F123
>>6 123
GL93
>>194 93

This is my first challenge, hence the relative simplicity and potential poorness of the criteria.
EDIT: String must be letters followed by numbers and the winning criteria is the shortest code length (if that can be a thing)
EDIT: Related to this but does the reverse process with a different starting index. Some may argue that this fact makes the linked puzzle more interesting.

Can we take the input as, for example, an array containing the letters and the numbers: ["A", "1"]

related: https://codegolf.stackexchange.com/questions/54105/all-your-bijective-base-are-belong-to-us

@StepHen I suppose that would be too easy. One of the work is to parse the string.

@StepHen No. It must be a single string containing both the letters and numbers. I should probably add, also, that the string MUST be in the order of letters followed by numbers.

We usually allow more flexible input and output formats, such as choosing newline instead of space as output separator

@LuisMendo Why is this? Surely part of the challenge is conforming to stricter requirements, otherwise some problems including this one are much more trivial.

@DeanBrunt It depends on you, and of course you can enforce a strict format to make the challenge more difficult. But people usually enjoy the difficulty in the actual computations more than in the format

It's because the formatting does not add any value to the actual challenge itself

Are we allowed leading space and/or trailing newline?

@Greedo No we're not I'm afraid.

05AB1E, 12 11 bytes
áÇ64-₂βð¹þJ

Uses the 05AB1E encoding. Try it online!

Microsoft Excel, 43 Bytes.
=COLUMN(INDIRECT(A1))&" "&ROW(INDIRECT(A1))

I couldn't help myself, I just had to use the right tool for the job.
Takes input on A1.
Test Cases

Microsoft Excel, 40 bytes
Brasilian Portuguese language version.
=COL(INDIRETO(A1))&" "&LIN(INDIRETO(A1))

Translated (and therefore golfed) version of ATaco's solution.

I can't remember if Excel allows this like sheets, but could you use the suggestion by @Uriel on another answer and lose the last 2 parentheses?

That suggestion (omitting rightmost parentheses) throws a warning in Excel that you have to confirm to proceed, so I don't think it's allowed here.

Ah I see. It is different to sheets then.

Python 2, 94 91 73 bytes
-3 bytes thanks to Jonathan Allan
-18 bytes thanks to tsh
s=input().strip
a=s(`3**39`);t=0
for n in a:t=t*26+ord(n)-64
print t,s(a)

Try it online!
This abuses the way that .strip works, removing all digits wtih a=s(`3**39`) where `3**39` is just a shorter way to generate the digits from 0 to 9, this will store only the chars on a that will be used to strip the chars from the numbers on s(a)

I don't think there is a need for strip's input to be the unique characters, so 3**39 should do the same job.

73 bytes

Google Sheets, 43 bytes
=COLUMN(INDIRECT(A1))&" "&ROW(INDIRECT(A1))

Try it online!
A1 is the input cell. Hopefully the above link works, I've never tried code golf with Google Sheets before.

@ATaco There's no reason to, as duplicate answers can coexist.

The appearance of Google Sheets and Microsoft Excel answers pleases me.

you can do =COLUMN(INDIRECT(A1))&" "&ROW(INDIRECT(A1 for 41 bytes. sheets fills in missing right parens.

JavaScript, 72 bytes
x=>x.replace(/\D+/,s=>[...s].reduce((n,v)=>n*26+parseInt(v,36)-9,0)+' ')

Proton, 113 bytes
k=>{b=(s=k.strip)('0123456789');str(sum(map((a=>26**a[1][0]*(ord(a[1][1])-64)),enumerate(b[to by-1]))))+' '+s(b)}

Try it online!
-19 bytes borrowing Rod's algorithm (note to self: add listcomps)

Dyalog APL, 44 bytes
(26⊥¯65+⎕AV⍳(a~⎕D)),⎕A~⍨a←⍞

Try it online!

Remove the parenthesis around (a~⎕D). Look-up in ⎕A instead of ⎕AV. Make tacit. Swap argument of ,. Gets down to only 16 bytes: ~∘⎕A,⍨26⊥⎕A⍳~∘⎕D

Pyth - 31 bytes
First attempt, very naive.
jd,s*V.u*26NQ1_hMxLGr-QK@`UTQZK

Try it online here.

Jelly,  16  15 bytes
ØAɓi@€ḟ0ḅ26,⁸Kḟ

A full program accepting the string as an argument and printing the result
Try it online!
How?
ØAɓi@€ḟ0ḅ26,⁸Kḟ - Main link: list of characters, ref  e.g. "AAC753"
ØA              - uppercase alphabet yield               = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  ɓ             - dyadic chain separation, call that B and place it on the right
   i@€          - first index for €ach (swap arguments)    [1,1,3,0,0,0]
      ḟ0        - filter discard zeros                     [1,1,3]
        ḅ26     - convert from base 26 to integer           705
            ⁸   - chain's left argument (ref)              "AAC753"
           ,    - pair                                     [705,['A','A','C','7','5','3']]
             K  - join with spaces                         [705,' ','A','A','C','7','5','3']
              ḟ - filter discard those in right (B)        [705,' ','7','5','3']
                - implicit print                        >>>705 753

Note: conversion from a list of numbers using the base conversion atom ḅ allows places to be outside of the expected range, so conversion from, say,  [2,26,1] ("BZA") using ḅ26 is calculated as 2×262+26×261+1×260=2029 even though the "expected" representation would have been [3,0,1].

@Dean Brunt It is not usual to accept an answer so quickly (most leave it a week) - it may discourage others from competing. I would not be surprised to see this beaten by 05AB1E or another golfing language...

Point taken. Still learning my way round

No problem! Welcome to PPCG, & nice first post :)

Perl 5, 35 + 1 (-p) = 36 bytes
map$r=$r*26-64+ord,/\D/g;s/\D*/$r /

Try it online!
The map statement treats the column like a base26 number and converts it to decimal.  The substitution replaces the letters with the numbers.  The input and output are implicit in the -p flag.

Mathematica, 108 bytes
StringReplace[c:LetterCharacter..~~r:DigitCharacter..:>ToString@FromDigits[ToCharacterCode@c-64,26]<>" "<>r]

Operator form of StringReplace which takes the alphabetic part c of the string, converts it to a list of character codes, subtracts 64 from each code point, interprets the result as a base 26 integer, converts that integer to a String, then StringJoins a space followed by the numeric part r.
Using a regex (also 108 bytes):
StringReplace[RegularExpression["([A-Z]+)(.+)"]:>ToString@FromDigits[ToCharacterCode@"$1"-64,26]<>" "<>"$2"]

ToCharacterCode@c-64 can sometimes be reduced to LetterNumber@c. LetterNumber does not wrap the output in List when the input is a single character, though.

Mathematica, 77 72 69 68 bytes
#/.{a__,b__?DigitQ}:>{f=FromDigits;f[LetterNumber@{a},26],f[b<>""]}&

Takes a list of characters.
Try it on Wolfram Sandbox
Usage
#/.{a__,b__?DigitQ}:>{f=FromDigits;f[LetterNumber@{a},26],f[b<>""]}&[{"G", "L", "9", "3"}]

{194, 93}

or
#/.{a__,b__?DigitQ}:>{f=FromDigits;f[LetterNumber@{a},26],f[b<>""]}&[Characters["GL93"]]

{194, 93}

Explanation
#/.

In the input replace...
{a__,b__?DigitQ}

A list containing two sequences a and b (with 1 or more elements), where b consists of digit characters only... (Mathematica uses lazy pattern matching, so no check is required for a)
:>

into...
f=FromDigits;

Set f to digit-to-integer conversion function.
LetterNumber@{a}

Convert a to letter numbers (a -> 1, b -> 2, etc).
{f[ ... ,26],f[b<>""]}

Convert the above from base-26 to decimal, and convert b to decimal.

Ruby, 50 48+1 = 51 49 bytes
Uses the -p flag. -2 bytes from m-chrzan.
sub(/\D+/){i=0;$&.bytes{|b|i=26*i+b-64};"#{i} "}

Try it online!

i=i*26+b-64 saves 2 bytes.

Ruby, 64 61 59 bytes
->s{s.sub(/\D+/){"#{$&.bytes.reduce(0){|t,b|t*26+b-64}} "}}

Saved 2 bytes thanks to Value Ink.

$& is the last regex match, so use it instead of m to save 2 bytes.

Excel-VBA Immediate window, 44 45 Bytes (36 35)
Set v=Range([A1]):?trim(v.Column &" "&v.Row);

1 byte added to suppress the trailing newline

Or for 35 with leading whitespace
Set v=Range([A1]):?v.Column""&v.Row

1 byte saved thanks to @TaylorScott!
Both take input from cell A1, output to the VBE Immediate window

I'm gonna go ahead and say that the leading whitespace answer is a valid response as having to remove it would force the use of Trim() on nearly all numeric answers  - and on that not I would go with Set v=Range([A1]):?v.Column""&v.Row over your current solution

also, darn, I can't believe I missed this question when it came out!

@TaylorScott Oh nice trick using  the "" - I guess Excel knows to insert the ; when the character following Column can't be part of the routine name. I wonder if there's a single character that could do the same thing, probably not.  Yes, I would have guessed the leading space would be acceptable for most qus, but for this one I think it's more of a "Print this exact string". I did ask (last comment on question) and was told no leading space or newline.

also, when I saw the question title, I immediately knew I should have a go if you or someone else hadn't already! As the other Excel-based answers say, right tool for the job.

Haskell, 67 bytes
(\(l,n)->show(foldl(\a->(a*26-64+).fromEnum)0l)++" "++n).span(>'9')

Try it online.

Retina, 85 bytes
[A-Z]
$&
[T-Z]
2$&
[J-S]
1$&
T`_L`ddd
\d+
$*
{`\G1(?=.* .* )
26$*
}` (.* )
$1
1+
$.&

Try it online! Explanation:
[A-Z]
$&

Separate the letters from each other and the final number.
[T-Z]
2$&
[J-S]
1$&
T`_L`ddd

Convert the letters to decimal.
\d+
$*

Convert everything to unary.
{`\G1(?=.* .* )
26$*
}` (.* )
$1

While there are at least three numbers, multiply the first by 26 and add it to the second.
1+
$.&

Convert everything to decimal.

><>, 42 Bytes
0i88*-:0(?\$2d**+!
$n88*+48*o\
oi:0(?;   >

Try It Online
Explanation:
0i88*-:0(?\$2d**+! Read in the Letters part of the input
0                  Push an initial 0 to the stack
 i                 Read a character of input
  88*-             Subtract 64 to get from the ascii code to its value ('A'=1,'B'=2 etc.)
      :0(?\        If the value is less than 0, break out of this loop
           $2d**   Multiply our accumulator by 26
                +  Add our new number to the accumulator
                 ! don't add a new zero to the stack

The above loop will read in the first number of the numbers part (eg. '3' in "AB34") before breaking, and will have already subtracted 64 from it, so the next bit of code has to deal with that
$n88*+48*o\        Output a space, and prepare to output the first number we read in during the previous loop
          \        Loop round to the left end of this line
$n                 Output the value of the letters part as a number
  88*+             Add the 64 we subtracted from the first number
      48*o         Output a space
          \        Enter the next loop

This loop starts by outputting a character which will either be the 1st character read in by the first loop, or the character read in by the previous iteration of this loop.
oi:0(?;   >        Output the numbers part, by just echoing it
          >        Loop round to the start of the line
o                  Output the character
 i                 Read in the next character
  :0(?;            If the value read in was less than 0, terminate

Lua, 127 Bytes
Some nice string manipulations going there, I'm using some function that are usually never used while golfing in lua :D. The best way to golf this would be to find an other way to iterate over the column part of the input while being able to retain the position of each letter. I didn't ^^'.
Try it online!
I=...l=I:gsub("%d",""):reverse()r=0
for i=1,#l
do
r=r+(l:sub(i,i):byte()-64)*math.pow(26,i-1)end
print(r.." "..I:gsub("%a",""))

Explanation
I=...                       -- shorthand for the input
l=I:gsub("%d","")           -- shorthand for the column part
   :reverse()               -- letters are put in reverse order to calculate their weight
r=0                         -- column number
for i=1,#l                  -- iterate over the letters of the input
do
  r=r+                      -- add to the column number
      (l:sub(i,i):byte()-64)-- the byte value of the current letter minus 64 (A=1 this way)
      *math.pow(26,i-1)     -- then apply its weight in base 26
end
print(r                     -- output the column number
        .." "               -- a space
        ..I:gsub("%a",""))  -- and the row number

Vyxal ṡ, 9 bytes
⌊ẆhøA₄β?⌊

Try it Online!
whoa

JavaScript (Node.js), 67 bytes
x=>(a=0,b=x.replace(/\D/g,u=>(a=a*26+parseInt(u,36)-9,'')),a+' '+b)

Try it online!
Lots of code formatting