title: Guess my password (robbers' thread)

text:
# Question
Title: Guess my password (robbers' thread)
*Inspired by this challenge, which got closed. This is meant to be an easier, but no less interesting version of that.*

This is the robbers thread of a challenge. For the cops thread, see here.

Cops will provide a program/function and a flag. Robbers will guess a password. When the password is given to the cop's program, the flag should be outputted.

## Robber rules

* When the cop's program is given the password you guess, it should output the flag.
* Your password does not have to be the same as the cop's password.
* You are allowed to take advantage of ambiguous descriptions of the flag by cops.

Cop answers will be safe if they haven't been cracked for two weeks.

## Example

Cop:

## Scala, 4 bytes

```
x=>x

```

Flag: `Yay, you cracked it!` (an object of type `String` is returned from the lambda above)

Try it online!

Robber:

Password: the string "Yay, you cracked it!"

Try it online!

# Answer
# Sisyphus, PHP

Password:

A string `golf` with 1,000,000 leading whitespaces and 1,000,000 trailing whitespaces

Output: `golf`

Reason: 1,000,000 is the default backtracking limit of PCRE (which you can get by `var_dump(ini_get('pcre.backtrack_limit'));`). And `preg_match` will return `FALSE` other than 0 or 1 when this limit is breaked.

Try it online!
> 19 votes

# Answer
# ovs, Python 2

Password:

```
class m:0
m.__init__ = hex.__init__
n = 49374
m.__str__ = n.__hex__
class a: __metaclass__ = m

```

Output: `0xc0de`

Try it online!
> 12 votes

# Answer
# R, Robin Ryder

Password: `as.roman(c(1, 9)))`

It was roman numerals!

Try it online!
> 10 votes

# Answer
# Lynn, Haskell

Lynn created a stack based mini-language, the task was to generate the primes up to 500 in 60 or less operation. Here is my 55-operation password:

```
[0,0,2,1,4,1,0,2,1,1,4,4,4,30,0,2,0,2,0,20,10,0,3,10,2,0,3,1,0,10,3,6,6,6,6,5,4,7,5,0,7,3,10,2,0,3,20,2,1,0,3,0,3,30,2]

```

Try it online!

The available operations are

```
0   push 1
1   duplicate top of stack
2   add top two values
3   subtract
4   multiply
5   integer divide top value by second value
6   push the second value without popping it
7   swap top two values
c>7 while loop, runs until top of stack is 0
    the loops ends at the first instruction >=c

```

---

`0,0,2,1,4,1,0,2,1,1,4,4,4` pushes the initial number `500`. The remainder of the code is best explained inside out:

`6,6,6,6,5,4,7,5` is a divisibility test. Given `k` and `n` as the top two values on the stack this calculates \\$\lfloor {\lfloor {n \over k} \rfloor \cdot k \over n}\rfloor\\$, which is only 1 if `k` divides `n`: Try it online!

---

`1,0,10,3,div test,0,7,3,10,2,0,3` is a primality test, or a composite test since this returns truthy (non-zero) values for composite numbers:

```
1                  -- duplicate n
 0                 -- push 1 - stack: [1, k=n, n]
                   -- in the next iterations of the loop,
                   -- the top of stack will be the inverted result
                   -- of the divisibility test
  10       10      -- while loop:
                   -- runs until [0, d, n] is on the stack,
                   -- where d is the largest divisor of n <n
    3              --   subtract top value (always 1) from k
     div           --   the divisibility test
        0          --   push 1
         7         --   swap top two values
          3        --   subtract (1 - div test result)
             2     -- add the top 0 to the last k
              0,3  -- subtract 1
                   -- if the loop ended with [0, 1, n], this is now 0
                   -- otherwise we have a positive number

```

Try it online!

---

`0,20,10,0,3,10,2,0,3,comp. test,20,2,1` generates the next prime less than `n`:

```
0                        -- push 1. This means the current number is composite
                         -- Even if it isn't, we still want to find a prime <n
 20                      -- while loop. This iterates until the composite tests returns 0
   10   10               --   we have an positive number on the top of the stack ...
     0 3                 --   by subtracting 1 until it is 0, ...
          2              --   and adding this to the last prime candidate ...
                         --   we can get rid of it.
           0 3           --   subtract 1 to get new prime candidate pc
              comp       --   check if pc is composite
                  20     -- end of loop, top of stack is now [0, p], with p prime
                    2    -- add 0+p
                     1   -- duplicate the prime, such that we store the result,
                         -- and can use the value to find the next prime

```

Try it online!

---

`30,0,2,0,2,next prime,0,3,0,3,30,2` repeats this until the prime `2` is found:

```
30              30  -- while loop
  0 2               --   add 1
     0 2            --   add 1
        np          --   find the prime less than this
          0 3       --   subtract 1
             0 3    --   subtract 1
                    --   if the prime was 2, this is now 0
                    --     and the while loop terminates
                  2 -- add the 0 to the 2 to remove it

```

Try it online!
> 7 votes

# Answer
# R, Robin Ryder

```
5.099829245500619335478113833945732102551318887107339446461762721i

```

Try it online!
> 6 votes

# Answer
# Sisyphus, Jelly

Password:

```
[1.1071487177940904,1.1071487177940904,1.1071487177940904,1.1071487177940904,1.1071487177940904,1.1071487177940904,1.1071487177940904,0.897846510365972]

```

Try it online!

The code `OÆTP`, when taken literally, means `product(math.tan(ord(c)) for c in input)`. But the ord function in Jelly does nothing for numbers, so we can ignore that. Now the problem is to generate that *very* specific number. I figured that as product is likely to have precision loss, I'd use 2's as multiplicands. The number `1.1071487177940904` is equal to `arctan(2)`, and I use seven copies of it to reduce the problem to `arctan(x)` where `x<2` so that I have better chance at getting that exact result. Finally I computed `arctan(answer/128)` and put it as the last term of the input array, and it worked perfectly.
> 5 votes

# Answer
# att, Wolfram Language (Mathematica)

Password:

```
flag /: Head[flag] = flag

```

Try it online!

.

We can adapt this kind of solution to work with any Mathematica program:

```
a /: _[a] = flag; a

```

With this argument, any function returns `flag`.
> 5 votes

# Answer
# JavaScript by tjjfvi

The flag is: `()*` (Or `()?` / `(){0}`)

Try it online!

This splits between the two x's (it matches the empty string) without actually capturing anything with the group. The return value of `split` includes capturing groups, which results in `["x", undefined, "x"]`. This gets reduced to `"xundefinedx"`.
> 5 votes

# Answer
# Sisyphus, Python3

All you need to do is keep the processor busy for more than 9 seconds.

Any regex that requires lots of backtracking will gum up the parser. The only real difficulty is not slowing it up so much that Tio runs over its 60-second limit.

```
'b(.*.*.*)*z|baaaaaaay'

```

Try it online here.
> 4 votes

# Answer
# JavaScript (SpiderMonkey), tsh

Password hexdump:

```
61 61 61 00

```

(3 `a` followed by a null byte).

Try it online!
> 4 votes

# Answer
# Eric Duminil, Ruby

My password is

```
14127792144400463565475544498208881214759697720904563865426051592050217695592754443713601541725640031x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456789

```

According to the Ruby documentation, to\_i discards everything after the first integer it finds.

Try it online!

Alternative solution:

```
9164214512877268290754278122624834497733309914632715416260853069873976599113800182718102190123456789

```

I factored the semiprime with cado-nfs.

Try it online!
> 4 votes

# Answer
# JavaScript (V8) by PkmnQ

```
({toString(){return this.i--;},i:43})

```

Try it online!

JavaScript variables like: `({toString(){return this.i.shift();},i:[1,2,3,4,5]})` would be useful in many answers.

---

```
({valueOf:()=>43,toString:()=>42})

```

Try it online!

It is strange: While, let `p=({valueOf:()=>43,toString:()=>42})`: `''+p` results `"43"` but ``${p}`` results `"42"`...
> 4 votes

# Answer
# ZippyMagician, Arn

Password: `J0e_Biden!`

I'm sure this isn't the password that ZippyMagician was thinking of, but it works at least. The flag is equal to 296, and the uncompressed code starts with `:*:*`, which raises something to the 4th power. I'm not sure what's going on in the middle, but the last few bytes of code (`:i0^:i"n`) calculate the value of *a**b*, where *a* and *b* are the indexes of the characters `0` and `n` in some transformed version of the input. So if the second character is `0`, it's just a matter of tweaking the input until the `n` is in the right place.
> 4 votes

# Answer
# Python 3.7, ovs's answer

```
@print
@int.__invert__
@len
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@ascii
@str.lstrip
@min
@ascii
class a:
 pass

```

Try it online!

I used a brute force program to find the solution, although in the end it ends up being quite nice: Try it online!

Initially I found one with `__sizeof__`, but it doesn't work on TIO (being implementation-specific).

I had to made quite a few tweaks for it to fork (disable `open` and `id`, as the former will read from stdin with `list(open(1))` or something similar)

It's also possible to get `import inspect` and quite a few other modules, but I didn't consider that possibility.

In retrospect, `repr` would work as well, but `ascii` comes before `repr` in my generator program.
> 4 votes

# Answer
# JavaScript (Node.js) by emanresu A

```
[Math.PI, 2n]

```

Try it online!

`JSON.stringify` throws a `TypeError` if it finds a `BigInt`, thus executing `catch(e){return v[0]===Math.PI}`, and then it is simple to make that true.
> 4 votes

# Answer
# JavaScript by tjjfvi

```
document.all.toString = ()=>"length", document.all

```

`document.all` is an object that is unique in several ways, including being falsy.

`in` uses `toString`, so the first part can be made true by changing `toString`.
> 4 votes

# Answer
# HyperNeutrino, Python 3

Password: `import sys;sys.exit()`

Try it online!

Output: nothing

I'm not sure if erroring would be OK. It would not output anything to STDOUT, only STDERR.
> 3 votes

# Answer
# HyperNeutrino, Python 3

Password: `raise SystemExit`

Try it online!

Output: nothing
> 3 votes

# Answer
# ThisIsAQuestion, Python 2.7

```
True=False
The
Flag

```

Try it online!

Output is `The Flag`. *Sadly* reassigning `True` doesn't work in Python 3 anymore.
> 3 votes

# Answer
# Perl 5, cracks Nahuel Fouilleul

Password: `"^^@@^^:@@@^"^".,).*||,!'|"`

Try it online!
> 3 votes

# Answer
# SE - stop firing the good guys, \>\<\>

One password is

```
5 8a*3+o ab*1+o ab*1-o aa*1+o ab*6+o aa*4+o aa*5+o ab*o aa*3+o 48*o ab*5+o ab*1-o aa*1+o aa*8+o aa*8+o ab*5+o 48*o aa*o aa*1+o aa*8+o aa*5+o aa*1-o aa*5+o ab*1+o ab*7+o ab*5+o 95*1+o 95*1+o 95*1+o;

```

Try it online!

The program was `i10p`. `i` reads one character of input `1` and `0` push `1` and `0`, and `p` changes the value at `x=1, y=0` to the inputted character.

Whit the first input the program is modified to `i50p`, which allows to execute arbitrary commands from input.
`0-9a-f` push their hexadecimal value to the stack, `*+-` work as expected, `o` outputs a value as a character and `;` terminates the program.
> 3 votes

# Answer
# Kevin Cruijssen, 05AB1E

The password is

```
2
,*xžIž?¶

```

The `.E` builtin seems to push the Python code back to stack when it failed. The first input is just any number for the loop. The second input is a reversed 05AB1E program to produce the correct output:

```
¶        # push newline character
 ?       # print without trailing newline
  žI     # push 2**31
    žx   # push 2**6 = 64
      *  # multiply these numbers => 2**37 = 137438953472
       , # print this with trailing newline
         # since there was explicit output, implicit is now disabled

```

Try it online!

---

After some more experimenting, I found a cleaner password:

```
3
print()
3

```

Try it online!

`.E` executed on `"print()"` returns `None`, reversed is `enoN`. This is then executed as 05AB1E code, which seems to return the right result. I'm not sure how though, there might some features of the legacy version used here that I don't know of. Beacuse Python was used to print the newline, the value is still implicitly outputted.
> 3 votes

# Answer
# SunnyMoon, !@#$%^&\*()\_+

```
1728

```

I read the code, and it seemed to parse decimal input, divide it by 48 (not halting if it's not divisible) and print the corresponding character 3 times.

Try it online!
> 3 votes

# Answer
# Python 3.8 pre-release, pxeger

```
("unittest.mock",("mock","sentinel","pxeger","name"),())

```

Probably not the intended solution.

Try it online!
> 3 votes

# Answer
# Ruby, Dingus' answer

```
system gets;exit
echo '"""'

```

Try it online!
> 3 votes

# Answer
# r3mainer, C

I'm really sorry, but this answer on Stack Overflow has code that directly undoes elementary xorshift operations... It made running xorshift in reverse much easier (I only had to copy-paste some code and write 6 lines of Python).

```
07RtUrVE

```

Try it online!
> 3 votes

# Answer
# Conor O'Brien, Javascript

```
^^^Z_][_\\\\\]_\\]]]]]]]]]]]]]]]]]]]]]_\\\]_\\\\\\\]_\\\\\\\\\\\\\\\\\\\\\\\\]b_\\\\\\\\\]aa

```

The code seems to generate a random maze (the seed is based on our input, but I don't use that) without loops. We must solve it (in at most 999 steps) with a program in a stack-based language with these 8 commands:

```
0, rotate stack: S.push(S.shift())
1, pop twice, compare and push difference: [a,b]=S.splice(-2);F=a==b;S.push(a-b)
2, increment register: M++
3, push register: S.push(M)
4, pop and discard: S.pop();
5, reset register: M=0
6, pop to register: M=S.pop();
7, set answer to ToS and halt: R=S.pop();O=[]
8, pop pop() numbers, and if the last equality comparison was true then
   insert the numbers into the program: n=S.pop();n=S.splice(-n);if(F)O=n.concat(O)

```

The program receives its input as the lengths of the lines of sight in 4 directions, and must output one or more commands in base 4 (digits 0 and 3 are errors, 1 is "rotate left" and 2 is "move forward").

My algorithm checks if the line of sight to the left is zero; if it's zero, then it rotates right (by returning 21), otherwise it rotates left and moves forward (by returning 9). I might have confused left and right completely, though.

Our "program" is obtained from our input by concatenating all char codes in it (as decimal integers). However, nines are discarded. So I used characters with codes from 90 to 98 to access the commands.

Try it online!
> 3 votes

# Answer
# Dingus, Ruby and Dingus, Ruby

One password for both Ruby challenges by Dingus is:

```
G=->*x{i=0;i+=1 while x[0][i]!~x[1];x[0][i]};Q=method G[methods,/^[o-q]ri/];C=method G[q=Q[],/[o-r]ut[b-d]/];D=method G[q,/^de/];P=G[q,/^[o-r]\z/];D[P]{|x|};C[34];C[34];C[34];C[10]

```

Try it online! & Try it online!

* Gets access to `putc` by listing all the available (private) methods and filters them with regexen.
* Also redefines `p` to not do anything.
* a lambda is used instead of `def`
* `method :method_name` with `[]` is used instead of `()`
* `.` cannot be used, so only the methods for `Object` and `Kernel` are available
* Since `putc` is available, any string could be written.

FORTRAN like code:

```
GREP = lambda do |l,r|
  i=0
  while l[i]!~r do
    i+=1
  end
  l[i]
end
PRIVATE_METHODs=method GREP[methods,/^[o-q]ri/]
PUTC=method GREP[PRIVATE_METHODs[],/[o-r]ut[b-d]/]
DEFINE_METHOD=method GREP[PRIVATE_METHODs[],/^de/]
P=GREP[PRIVATE_METHODs[],/^[o-r]\z/]
DEFINE_METHOD[P]{|x|}
PUTC[34]
PUTC[34]
PUTC[34]
PUTC[10]

```

Try it online!
> 3 votes

# Answer
# , Robin Ryder

```
function(x,y,z){if(length(ls(1))>1|length(ls())!=3)return("S");LETTERS[lengths(lapply(y,intToUtf8(x),z))*lengths(lapply(y,intToUtf8(x+32),z))]}

```

Try it online!

The password is pretty insecure: `94,(numeric vector of length 1),(numeric vector of length 6)`. In particular, `94,1,1:6` was what I used.

The first thing I did was note that the `lengths` have to multiply to `18`, so we need to generate two lists such that the `lengths` are equal to `1,18`,`2,9`,or `3,6`.

Next, noting the `intToUtf8(x)` and `intToUtf8(x+32)` I found all pairs of functions that satisfy that condition with this script. I safely ruled out `nrow` and `ncol` since they would generate the same values, and the `lengths` must be distinct.

After that it was a matter of just trying things out; `lapply` always returns a `list` with length equal to the length of its first argument, so `y` had to be of length `1`. Luckily, R recycles, so `lapply(1,"^",1:6)==list(1^(1:6))`, which has `lengths` equal to `6`.

Finally, `~`, the `formula` builder is very odd, `x ~ y` is a `formula` with length `3`, with three elements, `'~'()`, `x()`, and `y()`, so `lapply(1,"~",1:6` is the same as `1 ~ 1:6` which is also length `3`.
> 3 votes

# Answer
# Python 3, breaks pxeger's challenge

```
__builtins__
SyntaxError
__build_class__

```

Try it online!

The first line loads the dictionary of Python's builtins.

Then, we assign `__build_class__` to `SyntaxError`. Why? Because `__build_class__` is called like so

```
__build_class__(<class_body>, "class_name")

```

While `SyntaxError` is called like so

```
SyntaxError("msg", (filename, lineno, offset, line))

```

When Python tries to call `SyntaxError` as if it were `__build_class__`, it tries to index the class name as a tuple.
> 3 votes

# Answer
# Python, pxeger

Input `__debug__` and magic!

```
from keyword import*
x=input()
if~-iskeyword(x)and x.isidentifier():
 exec(x,d:={"__builtins__":{}})
 try:exec(f"del {x}",d)
 except:print(1)
```

Attempt This Online!

The condition are `not keyword and is made of a-z,0-9` and also can't be `del` while not being a builtin function =\> builtin constant?
> 3 votes

# Answer
# Python 3 by pxeger

`assert`, `int`

Attempt This Online!

An assert statement can take two expressions; if the first expression evaluates to a true value, the second expression is not evaluated.
> 3 votes

# Answer
# Aaron, Vyxal (Not intended)

aka this solution is not correct.

```
.dI:⅛kF*×u⅛Ė.SṪḢ42f÷₍+*Π¾J∑Cøṙ

```

input:

```
1.2
EEEEEEEEEEEEEEEEEEEEEEEE

```

`1.2` Make program have exception and the top of the stack is the flag.

`1.2` can be any float.

Try it Online!
> 3 votes

# Answer
# JavaScript by tjjfvi

Input:

```
((x))

```

I'm not 100% why it works, but it seems that JavaScript insists that all capture groups appear in the split. Because the same string exists twice, it is captured twice. This is consistent with, e.g., input = `(((x)))`, which lists each `x` three times. Furthermore, what occurs before each string seems to also be preserved:

```
> "Hello".split(/(He)(llo)/)
[ '', 'He', 'llo', '' ]
> "Why Hello There".split(/(He)(llo)/)
[ 'Why ', 'He', 'llo', ' There' ]

```

In any case, either behavior is enough to cause a discrepancy between the length we might intuitively expect (2) and the actual result.
> 3 votes

# Answer
# Cracks pxeger's python 3 answer

```
__builtins__['if'].stdout.write("Hello, World!\n")
sys

```

Attempt it Online!

#### Explanation

The code `exec(`s the first input, and `exec(`'s second argument is the dictionary which contains all the variables / functions in the scope of `exec(`.

What I did was simply import `sys` and access the library using `__builtins__['if']` and print to stdout.
> 3 votes

# Answer
# Vyxal, cracks emanresu A

```
`555`

```

Try it Online!

Infinite possibilities. Wrap any palindromic string that is at least 3 characters long in backticks.
> 3 votes

# Answer
# JavaScript (V8), cracks Scott's answer

Password: `{length:"0"}`

Try it online!
> 2 votes

# Answer
# Aryan Beezadhur, JavaScript

The password is `defined`.

Using this reverseengineering.SE answer I was able to able to decode the JSFuck back to normal JavaScript:

```
if (prompt('Password') === ([0][1]+"").slice(2,9)) alert('cracked!')
```

The password needs to be equal to `([0][1]+"").slice(2,9))`, which evaluates to `"defined"`.
> 2 votes

# Answer
# ovs, Python 3

Password: `"".format`

Try it online!
> 2 votes

# Answer
# tsh, Javascript (SpiderMonkey)

Password: `-0`

Output: `true`
> 2 votes

# Answer
# R, Paul

```
data.frame(a = 1, b = 0/0)

```

Try it online!
> 2 votes

# Answer
# Dorian, dotcomma

```
[49375, -1]

```

Of course, the cryptic response in the comments turned out to mean "no, it's not a string". I think it's a big problem with the answer if "it would become too easy" if you told me what IO format I must use.

I noticed that the code seems to ignore all the input except for the first number until it finds a negative number. Then I noticed that it subtracts something from 49375. I don't know how does the code work, though.

Try it online!
> 2 votes

# Answer
# Python 3, pxeger

Object-oriented programming is always the best solution.

```
class c:
 def f():
  from os import system
  system('echo ryjtufbohqszxgg')
 f()

```

Our code is being executed in an environment where trying to access any global variable (including built-in functions) throws an error. However, `import` still functions correctly (I don't really understand this part of Python, but I suppose it's because `__import__` technically isn't being removed; it's just no longer accessible by the normal means). But just importing a necessary function is not enough: once imported, it will become a global variable, and these can't be accessed!
And the following fix doesn't work:

```
def f():
 from os import system
 system('echo ryjtufbohqszxgg')
f()

```

because once `f` is declared, it also becomes an inaccessible global variable! Fortunately, classes are executed as normal code when declared, and variables declared inside them are not global (and therefore are accessible).

Attempt This Online!
> 2 votes

# Answer
# Python 3, pxeger

```
e%e#d¹F¹S
z(1,42)
A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S
T;U;V;W;X;Y;Z;a;b;c;d;f;g;h;abs;j;id

```

`¹` represents a byte with value 1

Attempt This Online!

The input first needs to pass the `exec` call. This checks the syntax and creates tables of constants and names:

```
co_consts = (1, 42, None)
co_names = ('e', 'z', 'A', ..., 'id')

```

Then all the bytecode is replaced with our input, the relevant part is the first line:

```
e%   101 37   LOAD_NAME   37 (=id)
e#   101 35   LOAD_NAME   35 (=abs)
d¹   100  1   LOAD_CONST   1 (=42)
F¹    70  1   PRINT_EXPR   1 (argument is ignored)
S     83      RETURN_VALUE   (exits the execution)

```

---

without any comments and unprintables:

```
dAdAFFS(71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42)

```

Attempt This Online!

The first 8 bytes are actually executed:

```
dA   100 65   LOAD_CONST  65 (=42)
dA   100 65   LOAD_CONST  65 (=42)
FF    70 70   PRINT_EXPR  70 (argument is ignored)
S(    83 40   RETURN_VALUE   (returns 42 and exits the execution)

```
> 2 votes

# Answer
# Python 3, pxeger

```
f("(lambda **k:k)(a='b')", [12, 14])

```

Attempt This Online!

The challenge consists of two parts, first to create a dictionary without `}` and any builtins, and to get code compiled for `exec` to return a value.
The dictionary can be created using named function arguments.

The instructions in the bytecode at the indices specified in the integer list are set to `NOP` (9). The expression compiles compiles to the following bytecode, if we remove (convert to `NOP`) 12 and 14, the dictionary is returned.

```
 0 LOAD_CONST               0 (<code object <lambda> at 0x10f79ad40, file "<dis>", line 1>)
 2 LOAD_CONST               1 ('<lambda>')
 4 MAKE_FUNCTION            0
 6 LOAD_CONST               2 ('b')
 8 LOAD_CONST               3 (('a',))
10 CALL_FUNCTION_KW         1
12 POP_TOP                  0
14 LOAD_CONST               4 (None)
16 RETURN_VALUE

```
> 2 votes

# Answer
# JavaScript (V8) by EnderShadow8

```
function a(){this.i=0;this.toString=()=>this.i++?'is':'constructor'}
f(new a())

```

Try it online!

A bit of a mess. This uses the fact that `Object.is()` called with no parameters returns true.
> 2 votes

# Answer
# FZs, JavaScript

```
o=Object.defineProperty;o.a=window;o.b="x";o.c=o;o.get=x=>i++==0?2:i;i=0;o

```

This essentially encodes

```
i = 0
Object.defineProperty(window, "x", { get: () => i++ == 0 ? 2 : i })

```

Once run, `x` will return `2` the first call, `2` the second, then `3`, `4`, `5`, etc. This means that `x === x && x !== x`, as `2 === 2 && 3 !== 4`.
> 2 votes

# Answer
# Python, cracks @pxeger's answer

```

__hello__

```

Attempt This Online!

Coincidentally, `import __hello__` is an easter egg that outputs the exact text `Hello world!`. As such, the first line of input doesn't really matter here; perhaps it was used as a red herring.
> 2 votes

# Answer
# Python, 62 bytes cracks @pxeger's answer

A generic escape from exec with no `__builtins__`:

Uses the class heirarchy to go from list to object, builds a dict of subclasses of 'object', finds BuiltinImporter and imports all of the builtins again.

module name doesn't matter, must be a valid module.

```
{x.__name__:x for x in [].__class__.__base__.__subclasses__()}['BuiltinImporter']().load_module('builtins').print('Hello world!')
csv
```

Attempt This Online! (yes, the code on ATO prints the wrong key)
> 2 votes

# Answer
# I am kind of a language dev, Python

```
[c for c in [].__class__.mro()[1].__subclasses__() if "os." in str(c)][0].close.__globals__["write"](1,b"not a chance \n")

```

Classic pyjail escape. Of course, you could always use `from __future__ import braces` or `raise Exception("not a chance ")`, but that's more boring IMO.

Try it online!
> 2 votes

# Answer
# pxeger, Python 3.8

Password:

* A = `eval`
* B = `print("the_flag")`

Try it online!

Output: `the_flag`
> 1 votes

# Answer
# JavaScript (SpiderMonkey), cracks Aryan Beezadhur's answer

Password: `fine`

Try it online!
> 1 votes

# Answer
# Python 3, ovs

```
[x for x in ().__class__.__base__.__subclasses__() if x.__name__ == "Quitter"][0]("a",True)()

```

Try it online!
> 1 votes

# Answer
# SuperPizz, BrainF\***

Password: `ej`aH`

Try it online!

Python script used
> 1 votes

# Answer
# Python 3, pxeger

```
(_ for _ in()).throw(E())

```

Yep. Apparently generators just have a throw method. Found by searching SO for "raise exception from python lambda".
> 1 votes

# Answer
# Zsh \+ coreutils, pxeger's post, cracked after being safe.

Password.

```
${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)}${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)}${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)}${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)} ${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $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(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)}${(#)$((){<<<$#} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $)}

```

Try it online!

## What original program does

* Generates one random integer: 1-9999999.
* Variable p should represent if the integer is prime.

## How I cracked
> 1 votes

# Answer
# Python 3, pxeger

```
[].__class__.__base__.__subclasses__()[81].acquire.__globals__['__builtins__']['print']('uslcgtutmuexbwb')

```

Attempt This Online!

Our code is being executed in an environment where trying to access any variable throws an error (and there are no built-in functions). But the list of subclasses of `object` is very large, and includes multiple classes that somehow reference the original `builtins` object... The number 81 may stop working in other Python versions (but it can be replaced by something different, and it works in both Python 3.8 and 3.9)
> 1 votes

# Answer
# Python 3, pxeger

With direct memory access, nothing is really immutable. Replaces the string in the constant table of the lambda function.

```
import ctypes

wow = f.__code__.co_consts[2].co_consts[1]
hah = 'hah'
ctypes.memmove(id(wow), id(hah), hah.__sizeof__())

```

Attempt This Online!
> 1 votes

# Answer
# Python, cracks @Bgil Midol's answer

```
t%sb

```

Took be a minute to realize that this is a format and not a mod operation
> 1 votes

# Answer
# Python 3, pxeger \- (Incorrect crack)

```
 f=open(1,'w')
 f.write('hah')
 f.close()

```

Attempt This Online!
> 0 votes

---
Tags: cops-and-robbers
---


title: I done did made a spaceship maw!

text:
# Question
Title: I done did made a spaceship maw!
## Introduction:

Inspired by this comment of *@MagicOctopusUrn* on *@Emigna*'s 05AB1E answer for my "*It was just a bug*" challenge:

> `8F9ÝÀNð×ý}».∊` I done did made a spaceship maw! And I was all excited about suggesting a 12-byte edit. – Magic Octopus Urn Jul 17 '17 at 20:10

Which is a 05AB1E (legacy) program resulting in this:

```
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890

```

Try it online.

## Challenge:

Input: A non-empty string

Output: From outwards going inwards, add one more space between each character every line, similar as done in the output above, equal to the `length - 1`. So for an input `1234567890` the output would actually be this instead:

```
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0
1         2         3         4         5         6         7         8         9         0
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890

```

Why? The length of `1234567890` is `10`. So we start by outputting 10 lines: the first line without spaces; second with one space delimiter; third with two; etc. And then (without have the middle line with `length - 1` spaces duplicated), we go back to the initial input while going down.

## Challenge rules:

* Input is guaranteed to be non-empty (a length `>= 1`). (For single char inputs we simply output that character.)
* Any amount of trailing/leading spaces/newlines are allowed, as long as the output itself (wherever on the screen) is correct. (Empty line(s) in between output lines also isn't allowed.)
* Input will only contain printable ASCII characters excluding whitespaces (code-point range `[33, 126]`)
* I/O is flexible. Input may be taken as STDIN, argument, or function parameter. May be a list/array/stream of characters instead of string. Output may also be a list/array/stream of characters instead of strings; may be printed to STDOUT; returned as newline-delimited string; etc.

## General rules:

* This is , so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
* Default Loopholes are forbidden.
* If possible, please add a link with a test for your code.
* Also, adding an explanation for your answer is highly recommended.

## Test cases:

```
Input: @
Output:
@

Input: test
Output:
test
t e s t
t  e  s  t
t   e   s   t
t  e  s  t
t e s t
test

Input: ?!
Output:
?!
? !
?!

Input: Spaceship
Output:
Spaceship
S p a c e s h i p
S  p  a  c  e  s  h  i  p
S   p   a   c   e   s   h   i   p
S    p    a    c    e    s    h    i    p
S     p     a     c     e     s     h     i     p
S      p      a      c      e      s      h      i      p
S       p       a       c       e       s       h       i       p
S        p        a        c        e        s        h        i        p
S       p       a       c       e       s       h       i       p
S      p      a      c      e      s      h      i      p
S     p     a     c     e     s     h     i     p
S    p    a    c    e    s    h    i    p
S   p   a   c   e   s   h   i   p
S  p  a  c  e  s  h  i  p
S p a c e s h i p
Spaceship

Input: 05AB1E
Output:
05AB1E
0 5 A B 1 E
0  5  A  B  1  E
0   5   A   B   1   E
0    5    A    B    1    E
0     5     A     B     1     E
0    5    A    B    1    E
0   5   A   B   1   E
0  5  A  B  1  E
0 5 A B 1 E
05AB1E

Input: )}/\
Output:
)}/\
) } / \
)  }  /  \
)   }   /   \
)  }  /  \
) } / \
)}/\

```

# Answer
# Japt, ~~8~~ 6 bytes

Takes input as an array of characters, outputs an array of strings.

```
£qYçÃê

```

Try it

---

## Explanation

```
£          :Map each element at (0-based) index Y
 q         :  Join input with
  Yç       :   Space repeated Y times
    Ã      :End Map
     ê     :Palindromise

```

---

## Original, 8 bytes

I/O is a string. Uses the `-R` flag. Includes trailing spaces on each line.

```
¬£múYÄÃê

```

Try it

### Explanation

```
             :Implicit input of string U
¬            :Split
 £           :Map each character at 0-based index Y
  m          :  Map original U
   ú         :    Right pad with spaces to length ...
    YÄ       :     Y+1
      Ã      :End map
       ê     :Palindromise
             :Implicitly join with newlines

```
> 13 votes

# Answer
# , ~~105~~ ~~99~~ ~~85~~ ~~84~~ 79 bytes

-6 thanks to @Kevin Cruissen and @Giuseppe

-14 from changing to a regex based method

-1 thanks to @Giuseppe

-5 thanks to @digEmALl

```
function(w,n=nchar(w)-1)write(trimws(Map(gsub,"",strrep(" ",n-abs(n:-n)),w)),1)

```

Try it online!
> 11 votes

# Answer
# 05AB1E, ~~10~~ 9 bytes

Saved 1 bytes thanks to *Adnan*

```
εINð×ý}û»

```

Try it online!

**Explanation**

```
ε            # apply to each in input
 I           # push the input
  Nð×        # push <index> spaces
     ý       # merge the input on the spaces
      }      # end loop
       û     # palendromize
        »    # join on newlines

```
> 7 votes

# Answer
# Python 2, ~~72~~ ~~70~~ ~~68~~ ~~66~~ 65 bytes

-2 bytes thanks to Kevin Cruijssen
-3 bytes thanks to ovs

```
w=input();c=s=-1
while c:print(' '*~c).join(w);s*=w[:c]>'';c+=s|1

```

Try it online!
> 6 votes

# Answer
# JavaScript (ES6), 53 bytes

Takes input as an array of characters.

```
f=(s,p=i='',o=s.join(p)+`
`)=>s[++i]?o+f(s,p+' ')+o:o

```

Try it online!
> 6 votes

# Answer
# Charcoal, 10 bytes

```
Ｅθ⪫θ× κ‖Ｏ↓

```

Try it online! Link is to verbose version of code. Explanation:

```
Ｅθ          Map over characters of input string
  ⪫θ        Join characters of input string using
    ×       a literal space repeated
      κ     current index number of times
            Implicitly print each result on its own line
       ‖Ｏ↓  Reflect vertically with overlap

```
> 6 votes

# Answer
# Canvas, 8 bytes

```
┐² ×＊］──

```

Try it here!

The 7 byte version was too good for this challenge..
> 6 votes

# Answer
# Ruby, ~~54~~ 49 bytes

```
->a{(-(z=a.size-1)..z).map{|i|a*(?\s*(z-i.abs))}}

```

Try it online!

Takes input as an array of characters, outputs array of strings.
> 5 votes

# Answer
# 05AB1E (legacy), 9 bytes

```
εINúíJ}û»

```

Input as list of characters.

Try it online or verify all test cases.

**Explanation:**

```
ε     }    # Map each character in the input to:
 I         #  Take the input
  Nú       #  Prepend each with the 0-indexed amount of spaces
           #   i.e. ["t","e","s","t"] & 3 → ["   t","   e","   s","   t"]
    í      #  Reverse each item
           #   i.e. ["   t","   e","   s","   t"] → ["t   ","e   ","s   ","t   "]
     J     #  Join them together to a single string
           #   i.e. ["t   ","e   ","s   ","t   "] → "t   e   s   t   "
       û»  # Palindromize the list, and join by newlines
           #  i.e. ["test","t e s t ","t  e  s  t  ","t   e   s   t   "]
           #   → "test\nt e s t \nt  e  s  t  \nt   e   s   t   \nt  e  s  t  \nt e s t \ntest"

```
> 5 votes

# Answer
# Haskell, ~~60~~ 59 bytes

```
(init<>reverse).(scanl(?)<*>tail)
a?_=do u<-a;u:[' '|' '<u]

```

Try it online!

## Explanation

For a string (eg. `"abc"`) we apply first

```
scanl (?) <*> tail

```

which is the same as

```
\str -> scanl (?) str (tail str)

```

This repeatedly applies `(?)` (appends a space to each character in the range *\[33..\]*) to the `str` until there are that many strings as `str` has characters: `["abc","a b c ", "a b c "]`

Now we only need to concatenate the result (minus the last element) with its reversed counter part:

```
init<>reverse

```
> 5 votes

# Answer
# Japt, ~~9~~ 8 bytes

*-1 byte from @Shaggy*

```
ÊÆ¬qXîÃê

```

---

```
ÊÆ¬qXîÃê        Full program, implicity input U
ÊÆ              Range from 0 to U length and map
  ¬             split U at ""
   qXîÃ         join U using " " times range current value
        ê       horizontal mirror

```

Try it online!
> 4 votes

# Answer
# PowerShell, ~~66~~ 54 bytes

*-12 bytes thanks to mazzy*

```
0..($x=($a=$args).count-1)+$x..0|gu|%{$a-join(' '*$_)}

```

Try it online!

Takes input via splatting, which on TIO manifests as separate command-line arguments for each character.

We first set `$a=$args` as the input argument. Then we set `$x` equal to the `.count` of that array `-1`. We then need to loop through the letters to construct the spaceship. That's done by constructing a range from `0` to `$x`, then `$x` back down to `0`, then using `Get-Unique` to pull out just the appropriate range.

Each iteration, we take our input arguments and `-join` them together with the corresponding number of spaces. Each of those strings is left on the pipeline, and an implicit `Write-Output` gives us newlines for free when the program completes.
> 4 votes

# Answer
# MATL, ~~25~~ ~~22~~ 13 bytes

```
zZv"Gtz@he!1e

```

Try it online!

Thanks to Luis Mendo for suggesting a 5 byte golf, which then inspired me to shave off 4 more bytes!

Explanation, with example input `'abc'`:

```
         # Implicit input, 'abc'
z        # find number of nonzero elements (length of string)
         # stack: [3]
Zv       # symmetric range
         # stack: [[1 2 3 2 1]]
"        # begin for loop, iterating over [1 2 3 2 1] as the loop indices
G        # push input
         # stack: ['abc']
tz       # dup and push length
         # stack: ['abc', 3]
@        # push loop index, i (for example, 2)
         # stack: ['abc', 3, 2]
h        # horizontally concatenate
         # stack: ['abc', [3, 2]]
e!       # reshape to matrix of 3 rows and i columns, padding with spaces, and transpose
         # stack: [['abc';'   ';'   ']]
1e       # reshape to matrix of 1 row, leaving last value on stack
         # stack: ['a  b  c  ']
         # implicit end of for loop
         # implicit end of program, display stack contents

```
> 4 votes

# Answer
# Vyxal `j`, 5 bytes

```
ż∞v↲∩

```

Try it Online! -5 bytes thanks to lyxal.

```
ż     # range from 1 to length of input
 ∞    # Palindromised
  v↲  # For each character of the input, pad left by each of the above
    ∩ # Transpose
      # (j flag formats list of lines as a string)

```
> 4 votes

# Answer
# Java (JDK 10), 115 bytes

```
s->{for(int l=s.length(),i=-l;++i<l;)System.out.printf(s.replaceAll(".","%-"+(i<0?l+i:l-i)+"s")+"%n",s.split(""));}

```

Try it online!
> 3 votes

# Answer
# Jelly, 9 bytes

```
jⱮLḶ⁶ẋƲŒḄ

```

Try it online!

Returns a list of lines; output prettified over TIO.
> 3 votes

# Answer
# Pyth, 12 bytes

Just my mandatory Pyth submission. I am quite proud of this so an explanation will likely come soon.

```
+P_=jRQ*L;_U

```

Try it here!

```
+P_=jRQ_.e*d

```

Try it here!
> 3 votes

# Answer
# K (oK), ~~25~~ 24 bytes

**Solution:**

```
,/'(1+a,1_|a:!#x)$\:+,x:

```

Try it online!

**Explanation:**

Port of my K4 solution:

```
,/'(1+a,1_|a:!#x)$\:+,x: / the solution
                      x: / save input as x
                     ,   / enlist
                    +    / flip
                 $\:     / pad ($) right by each-left (\:)
   (            )        / do this together
              #x         / count length of input,           e.g. 3
             !           / range 0..length,                 e.g. 0 1 2
           a:            / save as a
          |              / reverse it,                      e.g. 2 1 0
        1_               / drop first,                      e.g. 1 0
      a,                 / join to a,                       e.g. 0 1 2 1 0
    1+                   / add 1,                           e.g. 1 2 3 2 1
,/'                      / flatten (,/) each (')

```

**Notes:**

* -1 byte thanks to ngn
> 3 votes

# Answer
# Stax, 10 bytes

```
Ç·9ƒù▌╘Ä┘e

```

Run and debug it

Outputs with trailing whitespace on each line.

Explanation:

```
%R|pmx{]n(m Full program, unpacked, implicit input
%           Length of input
 R          1-based range
  |p        Palindromize
    m       Map:
     x{   m   Map over characters of input:
       ]        Character -> string
        n(      Right-pad to length given by outer map value
              Implicit flatten and output

```
> 3 votes

# Answer
# Oracle SQL, 115 bytes

Not a golfing language but...

```
SELECT TRIM(REGEXP_REPLACE(v,'(.)',LPAD('\1',1+LENGTH(v)-ABS(LEVEL-LENGTH(v)))))FROM t CONNECT BY LEVEL<2*LENGTH(v)

```

Assuming that the value is in column `v` of table `t`:

SQL Fiddle

**Oracle 11g R2 Schema Setup**:

```
CREATE TABLE t ( v ) AS
  SELECT 'test' FROM DUAL;

```

**Query 1**:

```
SELECT TRIM(REGEXP_REPLACE(v,'(.)',LPAD('\1',1+LENGTH(v)-ABS(LEVEL-LENGTH(v)))))
FROM   t
CONNECT BY LEVEL<2*LENGTH(v)

```

**Results**:

(SQLFiddle prints the values right-aligned in the column for some reason... there are no leading spaces)

```
| TRIM(REGEXP_REPLACE(V,'(.)',LPAD('\1',1+LENGTH(V)-ABS(LEVEL-LENGTH(V))))) |
|---------------------------------------------------------------------------|
|                                                                      test |
|                                                                   t e s t |
|                                                                t  e  s  t |
|                                                             t   e   s   t |
|                                                                t  e  s  t |
|                                                                   t e s t |
|                                                                      test |

```
> 3 votes

# Answer
## Perl 5 \+ `-M5.010 -nlF`, 34 bytes

```
$,=$"x($#F-abs),say@F for-$#F..$#F

```

Try it online!
> 3 votes

# Answer
# Bash, ~~115~~, ~~109~~, ~~105~~, ~~100~~, ~~97~~, ~~96~~, ~~92~~, ~~91~~, ~~90~~, 82 bytes

-5 & -3 thanks to Kevin Cruissen -8 thanks to roblogic

```
for((c=f=1;f;c-=2*(f>=${#1}),f+=c))
{ printf '%-'${f}'.c' `grep -o .<<<"$1"`
echo
}

```

Try it online!

--- Note that since the `\` is a shell escape char, the test case `)}/\` should be entered with an extra `\` like this: `)}/\\`.
> 3 votes

# Answer
# Zsh, ~~95~~ 77 bytes

Try it online! ~~95 bytes~~

```
j=$[$#1-1];for i ({-$j..$j})echo&&for x (${(s::)1})printf %-$[$#1-${i#-}]s $x

```

Takes input from argument `$1`. Set `j` to `length-1`. Iterate `i` from `-j` to `j`. For each character `x` in the input string, print `x` and append a number of spaces equal to `length` minus the absolute value of `i`
> 3 votes

# Answer
# Pascal (FPC), ~~143~~ 135 bytes

```
var s:string;i,j,l:word;begin read(s);l:=length(s);repeat i:=i+1;for j:=1to l do write(s[j],'':l-abs(l-i)-1);writeln until i=l*2-1 end.

```

Try it online!

I will probably win only against Lenguage...
> 2 votes

# Answer
# PHP, ~~88~~ 89 bytes

```
for(;++$i<2*$e=count($a=str_split($argn));)echo join(str_pad("",~-$e-abs($i-$e)),$a),"\n";

```

requires PHP 5 or later for `str_split`. Run as pipe with `-nR` or try it online.
> 2 votes

# Answer
# K4, 23 bytes

**Solution:**

```
,/'(1+a,1_|a:!#x)$\:$x:

```

**Example:**

```
q)k),/'(1+a,1_|a:!#x)$\:$x:"Spaceship"
"Spaceship"
"S p a c e s h i p "
"S  p  a  c  e  s  h  i  p  "
"S   p   a   c   e   s   h   i   p   "
"S    p    a    c    e    s    h    i    p    "
"S     p     a     c     e     s     h     i     p     "
"S      p      a      c      e      s      h      i      p      "
"S       p       a       c       e       s       h       i       p       "
"S        p        a        c        e        s        h        i        p        "
"S       p       a       c       e       s       h       i       p       "
"S      p      a      c      e      s      h      i      p      "
"S     p     a     c     e     s     h     i     p     "
"S    p    a    c    e    s    h    i    p    "
"S   p   a   c   e   s   h   i   p   "
"S  p  a  c  e  s  h  i  p  "
"S p a c e s h i p "
"Spaceship"

```

**Explanation:**

Has trailing whitespace on each line.

```
,/'(1+a,1_|a:!#x)$\:$x: / the solution
                     x: / save input as x,                 e.g. "abc"
                    $   / string,                          e.g. (,"a";,"b";,"c")
                 $\:    / pad ($) right by each-left (\:)
   (            )       / do this together
              #x        / count length of input,           e.g. 3
             !          / range 0..length,                 e.g. 0 1 2
           a:           / save as a
          |             / reverse it,                      e.g. 2 1 0
        1_              / drop first,                      e.g. 1 0
      a,                / join to a,                       e.g. 0 1 2 1 0
    1+                  / add 1,                           e.g. 1 2 3 2 1
,/'                     / flatten each

```
> 2 votes

# Answer
# C (gcc), ~~131~~ ~~129~~ 111 bytes

```
i;x;f(k,j)char*k,*j;{x=strlen(k)-1;for(i=0;i<x-~x;i+=puts(""))for(j=k;*j;)printf("%c%*s",*j++,i<x?i:2*x-i,"");}

```

Try it online!

*-20 bytes thanks to ceilingcat!*

```
#import<string.h>
i;x;f(k,j)char*k,*j;{x=strlen(k)-1;for(i=0;i<x-~x;i+=puts(""))for(j=k;*j;)printf("%c%*s",*j++,i<x?i:2*x-i,"");}

```

Try it online!

Or, if length can be accepted as a parameter:

## C (gcc), ~~105~~ 102 bytes

*-1 byte thanks to ceilingcat!*

```
i;x;f(k,x,j)char*k,*j;{for(i=!x--;i<x-~x;i+=puts(""))for(j=k;*j;)printf("%c%*s",*j++,i<x?i:2*x-i,"");}

```

Try it online!
> 2 votes

# Answer
## C#, 113 105 98 bytes

```
s=>{for(int l=s.Length,i=-l;++i<l;)WriteLine(Join("",s.Select(c=>$"{c}".PadRight(i<0?l+i:l-i))));}

```

Try it online!
> 2 votes

# Answer
# **Scala**, **82 bytes**

```
for(i<-(0 to a.size)union(-a.size to 0))println(a.map(_+" "*Math.abs(i)).mkString)

```

Try it online

Scala has lot of shortcuts that are helping me here and that is quite readable! **Try Scala**
> 2 votes

# Answer
# 8086 machine code, ~~56~~ 53 bytes

```
00000000  bf 35 01 57 ba 01 00 52  be 82 00 b3 ff ac 59 51  |.5.W...R......YQ|
00000010  aa 3c 0d 74 07 b0 20 e2  f7 43 eb f1 b0 0a aa 59  |.<.t.. ..C.....Y|
00000020  00 d1 e3 08 38 cb d6 08  c2 51 eb dc c6 05 24 5a  |....8....Q....$Z|
00000030  b4 09 cd 21 c3                                    |...!.|
00000035

```

Assembled from:

```
org 0x100
use16
        mov di, buffer
        push di
        mov dx, 1
        push dx
nextl:  mov si, 0x82
        mov bl, -1
nextc:  lodsb
        pop cx
        push cx
stor:   stosb
        cmp al, 0x0d
        je cr
        mov al, ' '
        loop stor
        inc bx
        jmp nextc
cr:     mov al, 0x0a
        stosb
        pop cx
        add cl, dl
        jcxz done
        cmp bl, cl
        salc
        or dl, al
        push cx
        jmp nextl
done:   mov [di], byte '$'
        pop dx
        mov ah, 0x09
        int 0x21
        ret
buffer:

```

Test case:
> 2 votes

# Answer
## Haskell, ~~64~~ ~~60~~ 59 bytes

```
(""#)
a#s|l<-(:a)=<<s,w<-' ':a=l:[x|w<(' '<$s),x<-w#s++[l]]

```

Try it online!

```
a#s                         -- take a string of spaces 'a' and the input string 's'
 |l<-(:a)=<<s               -- let 'l' be the current line, i.e. the spaces in 'a'
                            -- appended to each char in 's'
  w<-' ':a                  -- let 'w' be 'a' with an additional space
 =l                         -- return that 'l'
   :[   |w<(' '<$s)   ]     -- and, if 'w' is shorter than 's',
     x  ,x<-w#s++[l]        -- followed by a recursive call with 'w'
                            -- and by another copy of 'l'

(""#)                       -- start with an empty 'a'

```
> 2 votes

# Answer
# PHP, ~~148~~ ~~146~~ ~~143~~ 141 Bytes

```
function s($s){for(;$i<strlen($s);++$i)f($i,$s);for(--$i;--$i>=0;)f($i,$s);}function f($i,$s){echo chunk_split($s,1,str_repeat(' ',$i))."
";}

```

You can test it like this:

```
<?php
error_reporting(0);

$s = 1234567890;
function s($s){for(;$i<strlen($s);++$i)f($i,$s);for(--$i;--$i>=0;)f($i,$s);}function f($i,$s){echo chunk_split($s,1,str_repeat(' ',$i))."
";}

```

Output

```
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0
1         2         3         4         5         6         7         8         9         0
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890

```

Sandbox

Expanded version

```
 function s($s){
    //loop upwards 0-10
    for(;$i<strlen($s);++$i) f($i,$s);
     //decrement so it's odd, from 9 loop downwards to 0
    for(--$i;--$i>=0;)f($i,$s);
 }
 //2nd function to save space
 function f($i,$s){
     //chunk it, split 1 char, insert $i number of spaces
     echo chunk_split($s,1,str_repeat(' ',$i))."
";}

```

**Attempt 2, 92 bytes**

after seeing @Titus answer I reduced mine to this:

```
for(;++$i<2*$e=strlen($s=$argn);)echo chunk_split($s,1,str_repeat(' ',~-$e-abs($i-$e)))."
";

```

I was trying to think of a way to use 1 loop, instead of 2... Believe it or not, I almost never use the `for` loop in "real" code. It was the `~` bitwise Not, that I was missing...

It's sill a tiny bit longer at `92` so I don't feel so bad. But I will put it in as a second attempt anyway.

`$argn` is the input from the command line

> Run as pipe with -nR or try it online.

Sandbox
> 2 votes

# Answer
# Perl 6, 43 bytes

```
{(0....comb-1...0)>>.&{join ' 'x$^a,.comb}}

```

Try it online!

Returns a list of lines.

### Explanation:

```
 {                                         }  # Anonymous code block
  (0....comb-1...0) # A list from
   0                  # 0
    ...               # to
       .comb-1        # the length of the input string -1
              ...     # back to
                 0    # 0
                   >>.&{                  }  # Map each number to
                        join        ,.comb   # Join the list of characters
                             ' 'x$^a         # With the number of spaces

```
> 2 votes

# Answer
# APL (Dyalog Extended), ~~28~~ 20 bytes

```
{↑x,1↓⌽x←∊¨↑¨∘⍵¨⍳≢⍵}

```

Try it online!

-8 bytes from Adám.

## Explanation

```
{↑x,1↓⌽x←∊¨↑¨∘⍵¨⍳≢⍵} ⍵ → input.
                ⍳≢⍵  range 1..length(input)
           ↑¨∘⍵¨     pad each input character with i spaces
         ∊¨          flatten each row
       x←            save that as x
  x,1↓⌽              join it with its reverse
 ↑                   convert to matrix(join with newlines)

```
> 2 votes

# Answer
# Thunno 2 `N`, 6 bytes

```
Żıṣj;Ɱ

```

Try it online!

#### Explanation

```
Żıṣj;Ɱ  # Implicit input
Ż       # Push [0..len(input))
 ı  ;   # Map over this list:
  ṣ     #  Push that many spaces
   j    #  Join input by this string
     Ɱ  # Then, palindromise
        # Join on newlines
        # Implicit output

```
> 2 votes

# Answer
# Python 2, 67 bytes

```
s=input()
r=range(len(s))
for i in r+r[-2::-1]:print(' '*i).join(s)

```

Try it online!
> 1 votes

# Answer
# C (gcc), ~~135~~ ~~133~~ ~~129~~ 112 bytes

```
#define L{for(k=0;s[k];)printf("%c%*s",s[k++],i,"");puts("");}
i;k;f(char*s){for(i=0;s[i];i++)L for(--i;~--i;)L}

```

Try it online!

-2 bytes from Kevin Cruijssen

-4 bytes from ceilingcat

-17 bytes from ceilingcat

Ungolfed:

```
int i, k;
int f(char *s){
    for(i = 0; s[i] != '\x00'; i++) {
        for(k = 0; s[k] != '\x00'; k++) {
            printf("%c%*s", s[k], i, "");
            // print the character followed by the empty string padded with i spaces
        }
        putchar('\n');
    }
    for(i = i-2; i > -1; --i) {
        for(k = 0; s[k] != '\x00'; k++) {
            printf("%c%*s", s[k], i, "");
            // print the character followed by the empty string padded with i spaces
        }
        putchar('\n');
    }
}

```
> 1 votes

# Answer
# Red, 86 bytes

```
func[s][repeat n l: 2 *(length? s)- 1[foreach c s[prin pad c min n l - n + 1]print""]]

```

Try it online!
> 1 votes

# Answer
# Clean, ~~87~~ 81 bytes

*-2 thanks to Kevin Cruijssen*

```
import StdEnv,Text
$s#l=length s
=[concat[rpad{c}(l-abs i)' '\\c<-s]\\i<-[~l..l]]

```

Try it online!
> 1 votes

# Answer
# Attache, 26 bytes

```
Bounce@{Join[_,Iota@_*sp]}

```

Try it online!

## Explanation

```
Bounce@{Join[_,Iota@_*sp]}

       {                 }    anonymous lambda. input: _ (character array)
        Join[_,         ]     join each character by (vectorizes)
               Iota@_           the indices of _ (0 ... #_)
                     *sp        repeat a space by each index
Bounce@                       bounce the results (append reverse, but middle only once)

```
> 1 votes

# Answer
# Brainbash, 142 bytes

```
-[-[-<]>>+<]>-<++++++++++>>*,+[~+~->,+]~[-*[.~>[-<<.>>>+<]>[<->+]<<~>]~>+<<<.>>]>--[->+<<+>]>[-<+>]<<+[-*[.~>[-<<.>>>+<]>[<->+]<<~>]~>-<<<.>>]

```

Try it online!

In one block:

```
-[-[-<]>>+<]>-<++++++++++>>*,+[~+~->,+]~[-*[.~>[-<<.>>>+<]>[<->+]<<~>]~
>+<<<.>>]>--[->+<<+>]>[-<+>]<<+[-*[.~>[-<<.>>>+<]>[<->+]<<~>]~>-<<<.>>]

```

## Explanation

```
-[-[-<]>>+<]>-          constant for 32
<++++++++++             constant for 10
>>                      move to counter
*                       swap tapes while retaining pointer
,+[~+~->,+]             take input in tape while keeping track of how many characters
~                       move to counter on other tape
[                       repeat counter times:
    -                       update counter
    *                       swap tapes
    [                       for each character:
        .                       output it
        ~>[                     repeat secondary counter times:
            -                       update secondary counter
            <<.                     output a space
            >>>+<                   make a copy of the secondary counter
        ]
        >[<->+]                 restore secondary counter
        <<~>                return to counter
    ]
    ~>+<<<.>>           update ternary counter and output a newline
]

>--                     fix offset

[->+<<+>]>[-<+>]<<+     various counter restoring

    [-*[.~>[-<
    <.>>>+<]>[
    <->+]<<~>]
    ~>-<<<.>>]          same as above but subtracting instead of adding

```
> 1 votes

# Answer
# T-SQL, ~~215~~ 214 bytes

```
DECLARE @v CHAR(32),@p VARCHAR(999),@ INT,@j INT,@k INT
SELECT @v=v,@=LEN(v),@j=-@+1FROM t
r:SET @p=''SET @k=1c:SET @p+=SUBSTRING(@v,@k,1)+SPACE(@+~ABS(@j))SET @k+=1
IF @k!>@ GOTO c
PRINT @p
SET @j+=1IF @j<@ GOTO r

```

Per our IO rules, input is taken from a pre-existing table **t** with varchar field **v**. Max size I've allowed is 32 characters, which tops out with the middle line being 32\*31=992 characters long.

I've used a pure brute force nested-loop (using `GOTO` which is shorter than `WHILE`) with manual string construction, not very SQL-like at all. Still the best I could do (MS T-SQL has no native support for REGEX, except using CLR assemblies and manually importing `System.Text.RegularExpressions`).

EDIT: Here's the output for input "test":

```
test
t e s t
t  e  s  t
t   e   s   t
t  e  s  t
t e s t
test

```

And here's a partial screenshot of the output for input "abcdefghijklmnopqrstuvwxyz":
> 1 votes

# Answer
# Pip `-l`, ~~14~~ 9 bytes

```
aJsXPZ,#a

```

Takes the input string as a command-line argument. Try it online!

*Note: the PZ operator is newer than this question.*

### Explanation

WIth example input `abc`:

```
           a is 1st cmdline arg; s is space (implicit)
      ,#a  Range(length(a))
           [0; 1; 2]
    PZ     Palindromize (append the reverse, but without doubling the center item)
           [0; 1; 2; 1; 0]
  sX       Repeat space that many times (vectorized)
           [""; " "; "  "; " "; ""]
aJ         Join a on those strings (vectorized)
           ["abc"; "a b c"; "a  b  c"; "a b c"; "abc"]
           Print (implicit)
           Each list element is printed on its own line, due to -l flag

```
> 1 votes

# Answer
Lua: 132 characters

```
a=io.read()s=' 'l=function(o,n,z)for j=o,n,z do c=''for _,i in ipairs(a)do
c=c..i..s:rep(j)end print(c)end end l(0,#a,1)l(#a-1,0,-1)

```

Long form:

```
a=io.read() -- using the input as a table, lua's version of arrays (and
-- using it like an array anyway) Not 100% sure this is how the input goes
space=' ' -- need to declare this it seems so we can repeat it a number of times
later
l = function(initialNumSpaces,maxNumSpaces,increment)
for j=initialNumSpaces, maxNumSpaces, increment do
  collector=''
  for _,i in ipairs(a)do  -- loop through the inputted string char by char
     collector=collector..i..space:rep(j) -- concat the char and spaces
  end
  print(collector) -- print the collector
end
end
l(0,#a,1) -- call the first half of the spaceship
l(#a-1,0,-1) -- call the second half of the spaceship

```
> 1 votes

# Answer
# JavaScript (Node.js), 102 100 98 96 bytes

```
f=(s,n=s.length,m=n+--n)=>[...Array(m)].map((_,i)=>[...s].join(` `.repeat(i<n?i:2*n-i))).join`

```

-2 by using \[...\]
-2 from @Kevin
-2 by tweak @Kevin

Try it online!
> 1 votes

# Answer
# Rockstar, ~~135~~ 133 bytes

```
listen to S
F takes X
cut S into L
join L with " "*X
say L

X's-1
while S at X+1
let X be+1
F taking X

while X
let X be-1
F taking X

```

Try it here (Code will need to be pasted in)
> 1 votes

---
Tags: code-golf, string, ascii-art
---