title: Rube Goldberg Hello World

text:
# Question
Title: Rube Goldberg Hello World
For this golf, you will need to use more than one language.

# The task

A Rube Goldberg machine is a contraption that takes an enormous number of complicated steps in order to execute a very simple task. The goal of this golf is to output `Rube Goldberg`... but not directly.

# The machine

Your "machine" is the source code that, once executed, will give another source code in another language that will output `Rube Goldberg` upon execution. Got it?

I rephrase: your initial code must give another code, that other code must output `Rube Goldberg`. Both codes must be written in different languages.

# The bonus which is more like the only fun way to do it

There is a bonus if your code outputs a code that will output a code that will ... that will output `Rube Goldberg`.

*NOTE:* any sort of output can be used (stdout, stderr, dialog box, ...)

# The points

The number of points is equal to the number of bytes used in your code, divided by the number of **distinct**, **extra** languages that you used.

*NOTE:* different languages use different encodings. The number of bytes is counted in the initial language with its own encoding.

### Examples

* `Pyth -> J -> Javascript -> output` in 30 bytes = 30/2 = **15 points** (J and Javascript are the extra languages)
* `Java -> C# -> C++ -> PHP -> output` in 36 bytes = 36/3 = **12 points** (More bytes and more languages can win over fewer bytes and fewer languages (I know there is no way that these languages do it in 36 bytes))
* `C -> output` in 10 bytes = 10/0 = **Infinity points** (No extra languages)
* `Python -> Perl -> Ruby -> Python -> Ruby` in 44 bytes = 44/2 = **22 points** (Perl and Ruby are the extra languages, the second Python is not counted as it is not an extra language, the second Ruby is not counted as it has already been used)

*NOTE:* Languages that output their input can't be used. That would be an extra language with absolutely no additional bytes.

# The answer

Please provide an answer that clearly states which languages you used and shows us the code at each step (i.e.: in each language).

# The winner

Of course, like usual, the lowest score wins.

*NOTE:* As usual, standard loopholes and "cheats" are not allowed.

# Answer
# 33 languages, 40 bytes, 1.25 points

33.Bubblegum    : (hexdump) 3f1dbbbc87ebd1594f79fdbfa01c8a8ded64e1796d24d2f23e0115677f3cd9b3cd59c217c75a5c30
32.///          : "echo "B*"Rube Goldberg"+````{`]"print(%s)"e%}E*/
31.CJam         : "echo "B*"Rube Goldberg"+````{`]"print(%s)"e%}E*
30.Python       : (524,452 bytes)
29.Falcon       : (262,301 bytes)
28.Groovy       : (131,222 bytes)
27.JavaScript   : ( 65,679 bytes)
26.Julia        : ( 32,904 bytes)
25.Lua          : ( 16,513 bytes)
24.Move         : print("print(\"print(\\\"print(\\\\\\\"print(\\\\\\\\\\\\\\\"print(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"print(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"print(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\")\\\\\\\")\\\")\")")
20.Swift        : print("print(\"print(\\\"print(\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\")\\\")\")")
19.Yabasic      : print("print(\"print(\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\")\")")
18.MoonScript   : print("print(\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\")")
17.R            : print("\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"")
16.Arcyóu       : [1] "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\\\\\\\\\"\\\\\\\"\\\"\""
15.Convex       : "\"\\\"\\\\\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\\\\\"\\\"\""
14.GolfScript   : "\"\\\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\\\"\""
13.Pyth         : "\"echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg\""
12.Foo          : "echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg"
11.ash          : echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg
10.bash         : echo echo echo echo echo echo echo echo echo echo Rube Goldberg
09.csh          : echo echo echo echo echo echo echo echo echo Rube Goldberg
08.dash         : echo echo echo echo echo echo echo echo Rube Goldberg
07.fish         : echo echo echo echo echo echo echo Rube Goldberg
06.ksh          : echo echo echo echo echo echo Rube Goldberg
05.mksh         : echo echo echo echo echo Rube Goldberg
04.pash         : echo echo echo echo Rube Goldberg
03.rc           : echo echo echo Rube Goldberg
02.tcsh         : echo echo Rube Goldberg
01.zsh          : echo Rube Goldberg
00.OUTPUT       : Rube Goldberg

Takes advantage of the fact that many different languages share the same printing syntax, resulting in exponentially longer but highly compressible source code.

### Permalinks (incomplete, to be updated)
> 52 votes

# Answer
# Foogs2JellyRetinaAeolbonnParActuallySprectssedUniversal LambdaLines///m4: 19/13 ≈ 1.4615 points

```
"“GḋÞḊCøẉYỴ⁴ñ<ȯƥ»Ṿ¦

```

All answers are given in the Jelly code page. ¶ represents a newline.

# Mechanism

```
  Language      Code
 ——————————————————————————————————————
  Foo           "“GḋÞḊCøẉYỴ⁴ñ<ȯƥ»Ṿ¦
  gs2           “GḋÞḊCøẉYỴ⁴ñ<ȯƥ»Ṿ¦
  M             “GḋÞḊCøẉYỴ⁴ñ<ȯƥ»Ṿ
  Jelly         “¶:`".c Rube Goldberg#\/”
  Retina        ¶:`".c Rube Goldberg#\/
  Aeolbonn      :`".c Rube Goldberg#\/
  Par           `".c Rube Goldberg#\/
  Actually      ".c Rube Goldberg#\/
  Sprects       .c Rube Goldberg#\/
  sed           c Rube Goldberg#\/
  U.Lambda       Rube Goldberg#\/
  Lines         Rube Goldberg#\/
  ///           Rube Goldberg#/
  m4            Rube Goldberg#

```

EDIT: Oops, there was an error in the Pyth program. I replaced Pyth and GolfScript by Par.

EDIT 2: Added GNU m4.

EDIT 3: Added Foo and M.
> 55 votes

# Answer
# Jolf -\> Actually -\> Jelly -\> Pyth -\> Retina -\> /// -\> Golfscript: 15 / 6 = 2.5 points

5.4 points thanks to Martin Ender.

0.1 points thanks to Cᴏɴᴏʀ O'Bʀɪᴇɴ.

Note: both Actually and Jelly have their own code-page, so they could be transfered byte-by-byte, just not in the Online versions.

### Jolf

```
aq"“'ẉ'ɠ@ịQCṁỊ»

```

### Actually

```
"“'ẉ'ɠ@ịQCṁỊ»

```

Try it online!

### Jelly

```
“'ẉ'ɠ@ịQCṁỊ»

```

Try it online!

### Pyth

```
k"'Rube Goldberg'/

```

Try it online!

### Retina

```

'Rube Goldberg'/

```

Try it online!

### ///

```
'Rube Goldberg'/

```

Try it online!

### Golfscript

```
'Rube Goldberg'

```

Try it online!
> 32 votes

# Answer
# Python -\> Batch -\> Javascript -\> Java -\> PHP -\> C++ -\> Foo -\> Brainfuck 31.(142857) points

## Python

```
print'@echo alert`void f(){System.out.println("echo\"void f(){cout<<\\"\\\\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\\\\"\\"}\""`'

```

## Batch

```
@echo alert`void f(){System.out.println("echo\"void f(){cout<<\\"\\\\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\\\\"\\"}\""`

```

## JavaScript

```
alert`void f(){System.out.println("echo\"void f(){cout<<\\"\\\\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\\\\"\\"}\""`

```

## Java

```
void f(){System.out.println("echo\"void f(){cout<<\\"\\\\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\\\\"\\"}\""

```

## PHP

```
echo"void f(){cout<<\"\\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\\"\"}"

```

## C++

```
void f(){cout<<"\"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.\""}

```

## Foo

```
"-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------."

```

## BrainFuck

```
-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.

```
> 26 votes

# Answer
## JS -\> Cobol -\> Python -\> IBM 360 BAL

261 bytes/4 languages = 65.25 Points

*Was aiming to use difficult languages, with more obfuscation. Javascript converts the string from base64 into Cobol, which produces Python that decodes the BAL code from hex.*

**Javascript**

```
console.log(atob(' 1
    LH8T88d@05R850T8LT88!Q!R Cek*k{[~&vgm88yx9m4m6y6m8wx9m6}s}6Ovm9m6kg7m4m6x{m69x{6Ovm8wOxxg8Ovm9yOym4m6sv9x{6Ovm8km69Oxs}w}snxv86m69Ox7}m69x{49xyx}wws88wsg88oww}g4Ovkm4Oxyxww}}7g8{9swyyg9wyym6Ovm8Oxwxm6fm6gyxm8sox6m6gyxm6gkm6gLP');

```

**Cobol**

```
IDENTIFICATION DIVISION.
 PROGRAM-ID. Rube.
 ENVIRONMENT DIVISION.
 DATA DIVISION.
 PROCEDURE DIVISION.
    Display ' print bytearray.fromhex("202f2f204558454320415353454d424c5920092020535441525420204d41494e0942414c522020322c30200920205553494e47202a2c32200920204f50454e20205052494e54200920204d5643094255462c485720092020505554095052494e5420092020434c4f5345205052494e5420092020454f4a2020485709444309434c3133325c275255424520474f4c44424552475c27202042554609445309434c31333220205052494e5409445446505220494f41524541313d4255462c444556414444523d5359534c53542c424c4b53495a453d3133322c09092a2009094445564943453d333230332c434f4e54524f4c3d5945532c5052494e544f563d5945532020092020454e44094d41494e20202f2a20202f2f2045584543204c4e4b45445420202f2f204558454320202f2a20202f26").decode()'.
    STOP RUN.

```

**Python**

```
 print bytearray.fromhex("202f2f204558454320415353454d424c5920092020535441525420204d41494e0942414c522020322c30200920205553494e47202a2c32200920204f50454e20205052494e54200920204d5643094255462c485720092020505554095052494e5420092020434c4f5345205052494e5420092020454f4a2020485709444309434c3133325c275255424520474f4c44424552475c27202042554609445309434c31333220205052494e5409445446505220494f41524541313d4255462c444556414444523d5359534c53542c424c4b53495a453d3133322c09092a2009094445564943453d333230332c434f4e54524f4c3d5945532c5052494e544f563d5945532020092020454e44094d41494e20202f2a20202f2f2045584543204c4e4b45445420202f2f204558454320202f2a20202f26").decode()

```

**IBM 360 BAL**

```
 // EXEC ASSEMBLY
      START
 MAIN   BALR  2,0
      USING *,2
      OPEN  PRINT
      MVC   BUF,HW
      PUT   PRINT
      CLOSE PRINT
      EOJ
 HW DC  CL132'RUBE GOLDBERG'
 BUF    DS  CL132
 PRINT  DTFPR IOAREA1=BUF,DEVADDR=SYSLST,BLKSIZE=132,       *
        DEVICE=3203,CONTROL=YES,PRINTOV=YES
      END   MAIN
 /*
 // EXEC LNKEDT
 // EXEC
 /*
 /&

```

**Output**

```
RUBE GOLDBERG

```
> 21 votes

# Answer
# MATL -\> CJam -\> 05AB1E -\> Golfscript ~~21/2~~ ~~18/2~~ 22/3

*Thanks for Martin for 3 chars off!*

```
'"''Rube Goldberg''"`'

```

executed in MATL gives

```
"''Rube Goldberg''"`

```

which in CJam gives

```
"'Rube Goldberg'"

```

which in 05AB1E gives

```
'Rube Goldberg'

```

which in Golfscript gives

```
Rube Goldberg

```
> 17 votes

# Answer
# Reng -\> \>\<\> -\> Vitsy, 32 / 2 = 16 points

I wanted to do *only* 2D languages--on a single line!

```
{'Z"Rube Goldberg"'ol?!;f3+0.}n~

```

## Explanation

```
Reng sees:  {'Z"Rube Goldberg"'ol?!;f3+0.}n~
            <---------------------------->    code block
                                          n~  print that and stop

><> sees:   {'Z"Rube Goldberg"'ol?!;f3+0.}
            {                                 no-op?
             'Z"Rube Goldberg"'               push that string backwards
                               o              output a char
                                l?!;          terminate if none are left
                                    f3+0.     go to (0, 18) in the codebox

Vitsy sees: "grebdloG ebuR"Z
            "............."                   push that string
                           Z                  output it

```
> 5 votes

# Answer
## Perl -\> JavaScript (ES6) -\> Batch -\> sh, 39 / 3 = 13 points

## Perl

```
print 'alert`@echo echo Rube Goldberg`'

```

## JavaScript (ES6)

```
alert`@echo echo Rube Goldberg`

```

## Batch

```
@echo echo Rube Goldberg

```

## sh

```
echo Rube Goldberg

```
> 4 votes

# Answer
# Java-\>Thue-\>Javascript-\>Batch-\>Microscript II-\>Brainf\***, 236/5=47.2

```
interface J{static void main(String[]a){System.out.print("a::=~alert`echo \"+++++[>+A<-]>[>++>+++<<-]>++.>---.<++AA.+++.>>++++[>+A<-]>.[>++>+++>+++<<<-]>A.>+AA.---.>++++.--.+++.<<<<<---.>>>>>++.\"`\n::=\na".replaceAll("A","+++++++"));}}

```

---

Generated Thue program:

```
a::=~alert`echo "+++++[>++++++++<-]>[>++>+++<<-]>++.>---.<++++++++++++++++.+++.>>++++[>++++++++<-]>.[>++>+++>+++<<<-]>+++++++.>+++++++++++++++.---.>++++.--.+++.<<<<<---.>>>>>++."`
::=
a

```

Generated Javascript program:

```
alert`echo "+++++[>++++++++<-]>[>++>+++<<-]>++.>---.<++++++++++++++++.+++.>>++++[>++++++++<-]>.[>++>+++>+++<<<-]>+++++++.>+++++++++++++++.---.>++++.--.+++.<<<<<---.>>>>>++."`

```

Generated Batch program:

```
echo "+++++[>++++++++<-]>[>++>+++<<-]>++.>---.<++++++++++++++++.+++.>>++++[>++++++++<-]>.[>++>+++>+++<<<-]>+++++++.>+++++++++++++++.---.>++++.--.+++.<<<<<---.>>>>>++."

```

Generated Microscript II program:

```
"+++++[>++++++++<-]>[>++>+++<<-]>++.>---.<++++++++++++++++.+++.>>++++[>++++++++<-]>.[>++>+++>+++<<<-]>+++++++.>+++++++++++++++.---.>++++.--.+++.<<<<<---.>>>>>++."

```

Generated Brainf\*** program:

```
+++++[>++++++++<-]>[>++>+++<<-]>++.>---.<++++++++++++++++.+++.>>++++[>++++++++<-]>.[>++>+++>+++<<<-]>+++++++.>+++++++++++++++.---.>++++.--.+++.<<<<<---.>>>>>++.

```
> 4 votes

# Answer
# Jelly4DOS4OS2Almquist shellBourne shellBourne Again shellCOMMAND.COMC shellDebian Almquist shellDesktop Korn shellExtensible shellFriendly Interactive shellHamilton C shellIon shellInferno shellKornShellMirBSD Korn shellMKS Korn shellNDOSOpenBSD Korn shellOS/2 WindowPocket CMDPublic Domain Korn shellReactOS Command PromptRun CommandsSteve Koren shellThompson shellTake Command ConsoleTool Command Language KornShellTool Command Language shellTENEX C shellWindows Command PromptZ shell, \\$\frac{15}{32}=0.46875\\$

Beats all other answers. All it took was a couple centuries of looking for shells with `echo`.

1. **Jelly:** `“¡oġ»ẋ32“,oƝ+Ƈ»`
2. **4DOS:**  `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
3. **4OS2:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
4. **Almquist shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
5. **Bourne shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
6. **Bourne Again shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
7. **COMMAND.COM:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
8. **C shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
9. **Debian Almquist shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
10. **Desktop Korn shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
11. **Extensible shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
12. **Friendly Interactive shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
13. **Hamilton C shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
14. **Inferno shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
15. **Ion shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
16. **KornShell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
17. **MirBSD Korn shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
18. **MKS Korn shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
19. **NDOS:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
20. **OpenBSD Korn shell:** `echo echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
21. **OS/2:** `echo echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
22. **Pocket CMD:** `echo echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
23. **Public Domain Korn shell:** `echo echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
24. **ReactOS Command Prompt:** `echo echo echo echo echo echo echo echo echo echo Rube Goldberg`
25. **Run Commands:** `echo echo echo echo echo echo echo echo echo Rube Goldberg`
26. **Steve Koren shell:** `echo echo echo echo echo echo echo echo Rube Goldberg`
27. **Thompson shell:** `echo echo echo echo echo echo echo Rube Goldberg`
28. **Take Command Console:** `echo echo echo echo echo echo Rube Goldberg`
29. **Tool Command Language KornShell:** `echo echo echo echo echo Rube Goldberg`
30. **Tool Command Language shell:** `echo echo echo echo Rube Goldberg`
31. **TENEX C shell:** `echo echo echo Rube Goldberg`
32. **Windows Command Prompt:** `echo echo Rube Goldberg`
33. **Z shell:** `echo Rube Goldberg`
34. **Output:** `Rube Goldberg`
> 4 votes

# Answer
# Javascript -\> PHP -\> Foo 14 points

Javascript:

```
alert`echo'"Rube Goldberg"'`

```

PHP:

```
echo'"Rube Goldberg"'

```

Foo:

```
"Rube Goldberg"

```
> 3 votes

# Answer
# APL → J → K, 21 bytes/2 → 10.5

`'''"Rube Goldberg"'''`
on Dyalog APL gives
`'"Rube Goldberg"'`
which in J gives
`"Rube Goldberg"`
which in K gives
`Rube Goldberg`

If we allow even closer related languages we can get many more.
> 3 votes

# Answer
## /// -\> PowerShell -\> CJam -\> Foo -\> BASH, 24 bytes/4 = 6

```
'"echo Rube Goldberg"p'/

```

When executed in /// gives

```
'"echo Rube Goldberg"p'

```

which, when executed in PowerShell gives

```
"echo Rube Goldberg"p

```

which, when executed in CJam gives

```
"echo Rube Goldberg"

```

which, when executed in Foo gives

```
echo Rube Goldberg

```

which, when executed in BASH gives

```
Rube Goldberg

```
> 3 votes

# Answer
# Python → Ruby → Bash, score: 35 / 2 = 17.5

```
print"puts'echo \"Rube Goldberg\"'"

```

when executed in Python, gives

```
puts'echo "Rube Goldberg"'

```

with the `\"`s escaped. Next, this, executed Ruby gives

```
echo "Rube Goldberg"

```

and lastly, executing this in Bash gives

```
Rube Goldberg

```

which is the expected string.
> 1 votes

# Answer
# C → JS → Shell → \>\<\>: 68 / 3 = 22.67

### C

```
main(){puts("console.log(`echo '\"Rube Goldberg\"ar!;ooooooo|'`)");}

```

### Javascript

```
console.log(`echo '"Rube Goldberg"ar!;ooooooo|'`)

```

### Shell

```
echo '"Rube Goldberg"ar!;ooooooo|'

```

### \>\<\>

```
"Rube Goldberg"ar!;ooooooo|

```

Result:

```
Rube Goldberg

```

as required.
> 1 votes

# Answer
# Sprects///itflabtijtslwi → Python 2 → Pyth, 24 / 4 = 6

# Sprects

```
$print'"Rube Goldberg'\/

```

# ///

```
print'"Rube Goldberg'\/

```

# itflabtijtslwi

```
print'"Rube Goldberg'/

```

# Python 2

```
print'"Rube Goldberg'

```

# Pyth

```
"Rube Goldberg

```

# Output

```
Rube Goldberg

```
> 1 votes

# Answer
# /// -\> K -\> J -\> SX -\> Golfscript -\> Pyke -\> Lua -\> Moonscript -\> C -\> Pyth -\> Python -\> BrainF\*** -\> Bash -\> Ruby -\> Zsh, 554b/16= 34.625

## ///

```
"'我（\"\\\"print \\\\\"print(\\\\\\\"print \\\\\\\\\"#include<stdio.h>\\\\\\\\\nint main(){printf(\\\\\\\\\"\\\\\\\\\\\"print \\\\\\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\\\\\"\\\\\\\\\\\");}\\\\\\\\\"\\\\\\\")\\\\\"\\\"\"）'"/

```

## K

```
"'我（\"\\\"print \\\\\"print(\\\\\\\"print \\\\\\\\\"#include<stdio.h>\\\\\\\\\nint main(){printf(\\\\\\\\\"\\\\\\\\\\\"print \\\\\\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\\\\\"\\\\\\\\\\\");}\\\\\\\\\"\\\\\\\")\\\\\"\\\"\"）'"

```

## J

```
'我（\"\\\"print \\\\\"print(\\\\\\\"print \\\\\\\\\"#include<stdio.h>\\\\\\\\\nint main(){printf(\\\\\\\\\"\\\\\\\\\\\"print \\\\\\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\\\\\"\\\\\\\\\\\");}\\\\\\\\\"\\\\\\\")\\\\\"\\\"\"）'

```

## SX

```
我（\"\\\"print \\\\\"print(\\\\\\\"print \\\\\\\\\"#include<stdio.h>\\\\\\\\\nint main(){printf(\\\\\\\\\"\\\\\\\\\\\"print \\\\\\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\\\\\"\\\\\\\\\\\");}\\\\\\\\\"\\\\\\\")\\\\\"\\\"\"）

```

## Golfscript

```
"\"print \\\"print(\\\\\"print \\\\\\\"#include<stdio.h>\\\\\\\nint main(){printf(\\\\\\\"\\\\\\\\\"print \\\\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\\\"\\\\\\\\\");}\\\\\\\"\\\\\")\\\"\""

```

## Pyke

```
"print \"print(\\\"print \\\\\"#include<stdio.h>\\\\\\nint main(){printf(\\\\\"\\\\\\\"print \\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\\\"\\\\\\\");}\\\\\"\\\")\""

```

## Perl

```
print "print(\"print \\\"#include<stdio.h>\\\nint main(){printf(\\\\\"\\\\\\\"print \\\\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\\\"\\\\\");}\\\"\")"

```

## Lua

```
print("print \"#include<stdio.h>\nint main(){printf(\\\"\\\\\"print \\\\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\\\"\\\");}\"")

```

## Moonscript

```
print "#include<stdio.h>\nint main(){printf(\"\\\"print \\\\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\"\");}"

```

## C

```
#include<stdio.h>
int main(){printf("\"print \\\"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\\\"");}

```

## Pyth

```
"print \"--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\"

```

## Python 2

```
print "--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>."

```

## BrainF\***

```
--[----->+<]>-.--.+++++.+++++++.[--->+<]>-----.--[-->+++<]>.+[-->+++<]>.-[-->+<]>--.[-->+++++++<]>.+++++.-.-.+[---->+<]>+++.-[->+++<]>-.-[->++++++<]>.[->+++<]>-.--.+++++.+++++++.[--->+<]>-----.>-[--->+<]>---.----[-->+++<]>.+[->+++<]>.+++.--[--->+<]>-.+++[->++<]>+.[--->+<]>++.---.--------.--.+++.+++++++++++++.-----------.-----------.-[->++++++<]>.\

```

## Bash

```
echo -E puts \"echo Rube Goldberg\"

```

## Ruby

```
puts "echo Rube Goldberg"

```

## Zsh

```
echo Rube Goldberg

```

Obviously I could add a lot of echo's but it feels like it would copy Dennis' answer.
> 1 votes

# Answer
# sed -\> Pyth -\> Python -\> AWK -\> Make -\> Bash, 200/4 = 50

```
s/.*/=Z"echo"p"print(~BEGIN{print\\"r=S\\"Rube GoldbergS\\"Sntrue =;@Y"(){ Y" S\\"${r}S\\"|awk \\\\~$0=S\\"x:SSnSSt@Y" S\\"$0\\\\~;}Sntrue :SnSt@YdpZp" ${r}\\"}~)"p"/
s/S/\\\\\\\\/g;s/~/'/g;s/Y/"pZp/g

```

Try it online!

Not the shortest, or the most languages, but I enjoyed figuring this out. And the second to the last step in the chain is Make/Bash polyglot. If you run it as a Makefile, it generates a Bash script. If you run it as a Bash script, it generates a Makefile.

### Pyth

```
=Z"echo"p"print('BEGIN{print\"r=\\\\\"Rube Goldberg\\\\\"\\\\ntrue =;@"pZp"(){ "pZp" \\\\\"${r}\\\\\"|awk \\'$0=\\\\\"x:\\\\\\\\n\\\\\\\\t@"pZp" \\\\\"$0\\';}\\\\ntrue :\\\\n\\\\t@"pZpdpZp" ${r}\"}')"p"

```

The `p"` at the end is only necessary since I can't find a way to make `sed` leave off the trailing LF and Pyth really hates blank input source lines... At least the TIO version does. I found adding a print statement follow by an open string squelched the error.

### Python

```
print('BEGIN{print"r=\\"Rube Goldberg\\"\\ntrue =;@echo(){ echo \\"${r}\\"|awk \'$0=\\"x:\\\\n\\\\t@echo \\"$0\';}\\ntrue :\\n\\t@echo echo ${r}"}')

```

### AWK

```
BEGIN{print"r=\"Rube Goldberg\"\ntrue =;@echo(){ echo \"${r}\"|awk '$0=\"x:\\n\\t@echo \"$0';}\ntrue :\n\t@echo echo ${r}"}

```

### Make/Bash polyglot

```
r="Rube Goldberg"
true =;@echo(){ echo "${r}"|awk '$0="x:\n\t@echo "$0';}
true :
        @echo echo ${r}

```

Since that has to work as a Makefile, there are tabs in the original, which don't cut-n-paste into this page properly...

### Bash (if you treat the Make/Bash step as Make)

```
echo Rube Goldberg

```

### Make (if you treat the Make/Bash script as Bash)

```
x:
        @echo Rube Goldberg

```

And again, there's a tab in the original...
> 1 votes

# Answer
## Python -\> Ruby -\> Bash -\> JS -\> /// -\> m4, score: 54 / 5 = 10.8

```
Original  print"puts\"echo \'alert(\\\"Rube Goldberg#/\\\")'\""
Python    puts"echo 'alert(Rube Goldberg)'"
Ruby      echo 'alert("Rube Goldberg#/")'
Bash      alert("Rube Goldberg#/")
JS        Rube Goldberg#/
///       Rube Goldberg#
m4        Rube Goldberg

```

I've got the /// and m4 trick from the answer https://codegolf.stackexchange.com/a/83627/53416
> 0 votes

# Answer
## dc -\> Fortran -\> Basic -\> Vim, 59/3 = 19.(6) points

With this answer I wanted to contribute to the variety of languages already used in other answers.

**dc:**

```
[program P;write(*,*)"PRINT ""echo 'Rube Goldberg'""";end]P

```

**Fortran:**

```
program P;write(*,*)"PRINT ""echo 'Rube Goldberg'""";end

```

**Basic:**

```
PRINT "echo 'Rube Goldberg'"

```

**Vim:**

```
echo 'Rube Goldberg'

```

**Final output:**

```
Rube Goldberg

```
> 0 votes

# Answer
# GolfScript -\> Python -\> Bash -\> Ruby -\> ///, 49/4 = 12.25 points

**GolfScript:** `"print('echo puts \\\\\\'Rube Goldberg/\\\\'')"`

**Python:** `print('echo puts \\\'Rube Goldberg/\\\'')`

**Bash:** `echo puts \'Rube Goldberg/\'`

**Ruby:** `puts 'Rube Goldberg/'`

**///:** `Rube Goldberg/`

**Output:** Rube Goldberg
> 0 votes

---
Tags: code-challenge, hello-world, code-generation
---


title: Score a hand of Hearts

text:
# Question
Title: Score a hand of Hearts
Hearts is a trick-taking card game for 4 players. Each trick is taken by the player who played the highest card of the leading suit. At the end of each hand, the players incur a penalty score depending on the penalty cards they have taken; the task is to determine the scores under Microsoft Hearts rules.

## Input

Input is 4 lists (or delimited string, array, etc.) showing the penalty cards taken by each of the 4 players. The penalty cards are

```
2♥, 3♥, 4♥, 5♥, 6♥, 7♥, 8♥, 9♥, 10♥, J♥, Q♥, K♥, A♥, Q♠

```

which we shall represent as

```
2,  3,  4,   5,  6,  7,  8,  9,  10,  11, 12,  13,  1,  0

```

respectively.

## Output

Output is the 4 penalty points incurred by the 4 players (list, string, array etc.). Scoring is as follows:

* Each heart (, represented by integers `1` to `13` inclusive) incurs 1 point
* The queen of spades (`Q♠`, represented by `0`) incurs 13 points
* Exception: if a player has taken all of the penalty cards (called shooting the moon), then he incurs 0 points, while all other players incur 26 points.

## Test cases

```
[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]     -->  4,  2,  0, 20
[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1]   --> 25,  0,  0,  1
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], [], [] -->  0, 26, 26, 26

```

**Shortest code in bytes wins.**

# Answer
## CJam, ~~22~~ 20 bytes

*Thanks to jimmy23013 for saving 2 bytes.*

```
{{XD?}f%1fb_26&1bf^}

```

An unnamed block (function), which takes a list of 4 lists as input and returns the list of scores.

Try it online!

### Explanation

```
{      e# For each card...
  XD?  e#   Choose 1 if it's positive and 13 if it's zero.
}f%
1fb    e# Sum each hand.
_26&   e# Get the set intersection of the scores with 26. This gives [26]
       e# if someone shot the moon, and [] otherwise.
1b     e# Treat as base-1 digits, which gives 26 if someone shot the moon
       e# and zero otherwise.
f^     e# XOR each result with this number. This swaps zeros and 26s when
       e# someone shot the moon and does nothing otherwise.

```
> 3 votes

# Answer
## R, 85 77 74 bytes

```
function(x,z=sapply(x,function(x)sum(x>0)+any(x<1)*13))abs(z-any(z>25)*26)

```

Unnamed function that takes an R-list as input. Works by counting the number of elements `>0` and adds 13 if any element within each vector is `<1` (i.e. queen of spades) and store as `z`.

If any element in `z` is `>25`, return `26-z`, else return `z`.

Try it on R-fiddle
> 7 votes

# Answer
# C++14, 158 bytes

As unnamed Lambda:

```
[](auto c){typename decltype(c)::value_type r;int b=0;for(auto d:c){int q=0;for(auto i:d)q+=i?1:13;r.push_back(q);b+=q==26;}if(b)for(int&x:r)x=26-x;return r;}

```

Requires a `vector<vector<int>>` and returns `vector<int>`

Ungolfed:

```
[](auto c){
 typename decltype(c)::value_type r;   //result vector
 int b=0;                              //flag if one has all cards
 for(auto d:c){                        //over all decks
  int q=0;                             //count points
  for(auto i:d) q+=i?1:13;             //+13 for queen, +1 else
  r.push_back(q);                      //add to result
  b+=q==26;                            //possibly activate flag
 }
 if(b) for(int&x:r) x=26-x;            //if flag is set, mirror the results
 return r;
}

```

Few testcases for you:

```
 auto r = std::vector<std::vector<int>>{{2,8,7,1},{3,4},{},{9,5,6,0,10,11,12,13}};
 auto s = std::vector<std::vector<int>>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0},{},{},{}};
 auto t = std::vector<std::vector<int>>{{},{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0},{},{1}};

```
> 4 votes

# Answer
## Python 2, ~~75~~ ~~72~~ 71 bytes

```
i=[len(a)+12*(0in a)for a in input()]
print[[x,26-x][26in i]for x in i]

```

Takes input as `[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]`
> 4 votes

# Answer
# Haskell, ~~62~~ ~~59~~ 56 bytes

```
f x|all(<26)x=x|0<1=map(26-)x
f.map(sum.map((13^).(0^)))

```

Usage:

```
> f.map(sum.map((13^).(0^))) $ [[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1]]
[25,0,0,1]

```
> 3 votes

# Answer
# PHP, 113 bytes

```
function h($a){foreach($a as&$b)$b=count($b)+12*in_array(0,$b);if(max($a)>25)foreach($a as&$n)$n=26-$n;return$a;}

```

function takes an array of arrays, returns an array of values.

---

Marvel the other array mapping in PHP: loops with referenced items. Waaay shorter than `array_map`.
> 3 votes

# Answer
# 05AB1E, ~~26~~ ~~22~~ 21 bytes

Trailing whitespace must be removed from input so that it is interpreted as an array. The ending was inspired of the other answers when using (26-x) when a player gathered all penalty cards.

```
vy0å12*yg+})D26©åi(®+

v                    For each array
 y                   Push array on the stack
  0å                 Generate a boolean array indicating whether the queen of spades is at the same index in the original array
    12*              Multiply by 12 the value of the queen of spades
       yg+           Add the length of the array; the queen of spades gets her last point from this part
          }          End for
           )         Push an array of all evaluated scores
            D26©å    1 if there is a 26, 0 otherwise
                 i   If there is a 26
                  (®+ Mirror the array: for each element yield 26-element
                      Implicit end if
                      Implicitly print the score array

```

Try it online!

It still looks pretty golfable, with duplicated constants and conditional statements.

# Former version, 26 bytes

(One byte for each point in maximal penalty value)

I decided to keep it as its length fits best this challenge in my opinion :) .

```
vyD0å12*sg+})D26©QDOi_®*ë\

```

Try it online!
> 2 votes

# Answer
## JavaScript (ES6), ~~82~~ ~~80~~ ~~77~~ ~~72~~ ~~70~~ ~~69~~ 67 bytes

*Saved 2 bytes thanks to @Neil*

```
f =
s=>s.map(c=>c.map(t=>r+=t?1:13,r=0)|(b|=r>25,r),b=0).map(c=>b*26^c)

console.log(f.toString().length)
console.log(f([[2, 8, 7, 1], [3, 4], [], [9, 5, 6, 0, 10, 11, 12, 13]]));
console.log(f([[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [], [1] ]));
console.log(f([[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [], [1], [] ]));
console.log(f([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], [], []]));
console.log(f([[],[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0], [], []]));
```

### Breakdown

```
s=>s.map(                              // for each hand
 c=>c.map(                             // for each card
  t=>r+=t?1:13,                        // add value of card
 r=0)|(
  b=b|r>25,r                           // set flag if any hand scores 26 points
 ),
 b=0)
.map(c=>b?                             // for every card if a hand scored 26
  c?0:26                               // set every 0 hand to 26 and the 26 hand to 0
:c)                                    // otherwise do nothing

```
> 2 votes

# Answer
# Python 3, 101 bytes

```
def s(a):r=[sum([(1,13)[c==0]for c in h])for h in a];s=(r,[(26,0)[s==26]for s in r]);return s[26in r]

```

Full code:

```
def score(hands):
    result = [sum([(1, 13)[card == 0] for card in hand]) for hand in hands]
    results = (result, [(26, 0)[score == 26] for score in result])
    return results[26 in result]

```
> 2 votes

# Answer
# Ruby, 59 bytes

```
->a{a.map{|h|a.max.size>13?h.min||26:h.size+12*h.count(0)}}

```

Or, alternatively,

```
->a{a.map{|h|a.count([])>2?h.min||26:h.size+12*h.count(0)}}

```

If only one hand has any cards, we want the empty hands to get a value of 26, and the hand with cards to get a value of 0. I do this by calling `min` on the hands - this returns `nil` for an empty array, and then I `||` it into 26. In other cases, I count the number of cards in a hand and then add 12 to the Queen of Spades.
> 1 votes

# Answer
## Pip, 28 bytes

27 bytes of code, +1 for `-p` flag.

```
Y{$+1+12*!*a}M Va26Ny?26-yy

```

Takes input on the command-line as a string representing a nested list, like `"[[2 8 7 1] [3 4] [] [9 5 6 0 10 11 12 13]]"` (quotes not needed on TIO). Try it online!
> 1 votes

# Answer
# Vyxal, 18 bytes

```
ƛ0c12*nL+;:26c[26꘍

```

Try it online or run all the test cases.

## How?

```
ƛ0c12*nL+;:26c[26꘍
ƛ                   # For each inner list in the (implicit) input:
 0c                 # Does it contain a zero (the queen of spades)?
   12*              # Multiply this by 12 (aka if it contains a zero, then 12, otherwise 0)
      nL+           # Add the length of the inner list to this
         ;          # Close map lambda
          :         # Duplicate
           26c      # Does it contain 26? (aka someone shot the moon)
              [26꘍  # Then bitwise XOR each with 26 (swapping 26 and 0)

```
> 1 votes

# Answer
# Scala, 93 bytes

```
a=>{val% =a.map(_.map{case 0=>13;case _=>1}sum)
if(%toSet 26)%map{case 0=>26;case _=>0}else%}

```

Usage:

```
val f:(Seq[Seq[Int]]=>Seq[Int])=...
f(Seq(Seq(2, 8, 7, 1), Seq(3, 4), Seq(), Seq(9, 5, 6, 0, 10, 11, 12, 13)))

```

Explanation:

```
a=>{           //define an anonymou function with a parameter a
  val% =         //define % as...
    a.map(         //map each element of a...
      _.map{         //to each of the card
        case 0=>13     //replaced with its value
        case _=>1
      }
      sum            //and the sum of the values
    )
  if(            //if
    %toSet 26      //one player has all cards
  )
    %map{          //return % with...
      case 0=>26     //each 0 replaced with 26
      case _=>0      //and everything else (aka the 26) replaced 0
    }
  else           //else
    %              //return %
}

```

I could use `%toSet 26` instead of `% contains 26` because `Set`'s `apply` method is `contains` and not get-at-index like `Seq`'s
> 0 votes

---
Tags: code-golf, card-games
---


title: Is It A Rainbow Color?

text:
# Question
Title: Is It A Rainbow Color?
## Challenge:

The challenge is to determine whether or not a color, given it's name, is one of the colors in the rainbow.

When supplied with a color, your program should output a truthy value if it is a color in the rainbow, and a falsy one otherwise.

## Rules:

1. The possible input options are exhaustive, and defined in the test cases. You can assume that you will not receive any other input than the ones defined
2. Character casing for inputs can be one of: UPPER, lower, or Title Case, but must be consistent
3. Standard loopholes not allowed

## Test Cases:

**Truthy:**

* `red`
* `orange`
* `yellow`
* `green`
* `blue`
* `indigo`
* `violet`

**Falsy:**

* `purple`
* `brown`
* `pink`
* `cyan`
* `maroon`

### Leaderboard:

```
var QUESTION_ID=214678;
var OVERRIDE_USER=97730;
var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;function answersUrl(d){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(d,e){return"https://api.stackexchange.com/2.2/answers/"+e.join(";")+"/comments?page="+d+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){answers.push.apply(answers,d.items),answers_hash=[],answer_ids=[],d.items.forEach(function(e){e.comments=[];var f=+e.share_link.match(/\d+/);answer_ids.push(f),answers_hash[f]=e}),d.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(d){d.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),d.has_more?getComments():more_answers?getAnswers():process()}})}getAnswers();var SCORE_REG=function(){var d=String.raw`h\d`,e=String.raw`\-?\d+\.?\d*`,f=String.raw`[^\n<>]*`,g=String.raw`<s>${f}</s>|<strike>${f}</strike>|<del>${f}</del>`,h=String.raw`[^\n\d<>]*`,j=String.raw`<[^\n<>]+>`;return new RegExp(String.raw`<${d}>`+String.raw`\s*([^\n,]*[^\s,]),.*?`+String.raw`(${e})`+String.raw`(?=`+String.raw`${h}`+String.raw`(?:(?:${g}|${j})${h})*`+String.raw`</${d}>`+String.raw`)`)}(),OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(d){return d.owner.display_name}function process(){var d=[];answers.forEach(function(n){var o=n.body;n.comments.forEach(function(q){OVERRIDE_REG.test(q.body)&&(o="<h1>"+q.body.replace(OVERRIDE_REG,"")+"</h1>")});var p=o.match(SCORE_REG);p&&d.push({user:getAuthorName(n),size:+p[2],language:p[1],link:n.share_link})}),d.sort(function(n,o){var p=n.size,q=o.size;return p-q});var e={},f=1,g=null,h=1;d.forEach(function(n){n.size!=g&&(h=f),g=n.size,++f;var o=jQuery("#answer-template").html();o=o.replace("{{PLACE}}",h+".").replace("{{NAME}}",n.user).replace("{{LANGUAGE}}",n.language).replace("{{SIZE}}",n.size).replace("{{LINK}}",n.link),o=jQuery(o),jQuery("#answers").append(o);var p=n.language;p=jQuery("<i>"+n.language+"</i>").text().toLowerCase(),e[p]=e[p]||{lang:n.language,user:n.user,size:n.size,link:n.link,uniq:p}});var j=[];for(var k in e)e.hasOwnProperty(k)&&j.push(e[k]);j.sort(function(n,o){return n.uniq>o.uniq?1:n.uniq<o.uniq?-1:0});for(var l=0;l<j.length;++l){var m=jQuery("#language-template").html(),k=j[l];m=m.replace("{{LANGUAGE}}",k.lang).replace("{{NAME}}",k.user).replace("{{SIZE}}",k.size).replace("{{LINK}}",k.link),m=jQuery(m),jQuery("#languages").append(m)}}
```

```
body{text-align:left!important}#answer-list{padding:10px;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}
```

```
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/primary.css?v=f52df912b654"> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table>
```

# Answer
> 48 votes
# Haskell, 28 bytes

```
(`elem`"albedo").(!!8).cycle

```

Try it online!

If we wrap the input and index at position `8`, the rainbow colors all yield a letter among `"albedo"`, but the non-rainbow colors do not (they yield a letter among `"rwpc"`).

```
redredre d red
orangeor a nge
yellowye l low
greengre e ngr
blueblue b lue
indigoin d igo
violetvi o let

purplepu r ple
brownbro w nbr
pinkpink p ink
cyancyan c yan
maroonma r oon

```

# Answer
> 11 votes
# Retina 0.8.2, 7 bytes

```
A`p
d|e

```

Try it online! Link includes test cases. Assumes input in lower case. Outputs non-zero for rainbow colours, zero for the other inputs. Explanation: Simply checks that the colour contains the letters `d` or `e` but not `p`.

64-byte version to check against the 21 specific cases of rainbow colours in three different capitalisations:

```
T`L`l`^[A-Z]+$|^.
^(red|orange|yellow|green|blue|indigo|violet)$

```

Try it online! Link includes test cases. Explanation: Either an uppercase input or the leading character is lowercased, after which the exact colours are matched.

# Answer
> 10 votes
# K (oK), ~~23~~ ~~19~~ ~~18~~ 12 bytes

```
^"rwpc"?*|9#

```

Try it online!

Assumes input in lower case; based off of a flipped version of @Lynn's Haskell answer.

* `9#` repeating-take 9 characters of the input, e.g. "purplepur"
* `*|` first-reverse, i.e. last
* `"rwpc"?` lookup character in the string "rwpc", returning either the index of the match, or a null if not present
* `^` check if `null`, i.e. convert nulls to `1` and actual indices to `0`

# Answer
> 9 votes
# Jelly, 6 bytes

```
,2ḥ93Ḃ

```

Try it online!

Uses the Jelly hashing function. 5 might be possible.

# Answer
> 7 votes
# 05AB1E, 7 bytes

Takes input in lower case.

```
CƵl%3%È

```

Try it online! or Verify all cases!

`C` converts the color from binary. This allows digits higher than `1`, where upper case characters are `10` to `35` and lower case `36` to `61`:

```
C("red") = "r"*2**2 + "e"*2**1 + "d"*2**0 = 53*4 + 40*2 + 39 = 331

```

`Ƶl` is the compressed integer `148`, the code computes

```
is C(color)%148%3 Èven?

```

# Answer
> 7 votes
# C (gcc), ~~22~~ 21 bytes

```
f(int*s){s=*s/203&1;}

```

Try it online!

Inspired by ErikF's answer. I wrote a little program to brute-force the constants.

# Answer
> 6 votes
# , ~~41~~ 33 bytes

```
sd(utf8ToInt(scan(,"")))%%.195<.1

```

Try it online!

Less elegant than Giuseppe's solution, but ~~3~~ 11 bytes shorter.

Converts the (lowercase) input to ASCII codepoints, takes the standard deviation of the resulting integers, then takes that modulo `0.195` (found by a grid search). The result is less than `0.1` iff the input is truthy.

# Answer
> 5 votes
# Python 2, 22 bytes

```
lambda s:hash(s)%683%2

```

Try it online!

-1 thanks to ovs, who used the extra degree of freedom afforded by the flexible input casing to save a byte.

# Answer
> 4 votes
# Jelly, ~~21~~ ~~14~~ ~~12~~ 10 bytes

```
“dʋ»e€µṪ<Ẹ

```

Try it online!

Takes input in lowercase. Adaption of Neil's method

Golfs:

## How it works

```
“dʋ»e€µṪ<Ẹ - Main link. Takes S on the left
“dʋ»       - Compressed string; Yield "dep"
     €     - For each character in "dep":
    e      -   Is it in S?
      µ    - Use this triplet as the new argument
       Ṫ   - Take the final element (1 if p is present, else 0)
         Ẹ - Are either "d" or "e" in S?
        <  - The tail is 0 and either "d" or "e" are in S

```

# Answer
> 4 votes
# Jelly, ~~8~~ 7 bytes

```
9ịe“\Ṙ»

```

Try it online!

Get the ninth character (wrapping) and check if it's in the compressed string `“\Ṙ»` = `“albedo”`.

Port of my Haskell answer. caird saved a byte: the coincidence that *albedo* is an English word actually wins bytes over `9ịe“albedo` or `9ịḟ“rwpc`, owing to Jelly's compression dictionary.

# Answer
> 4 votes
# , ~~35~~ ~~28~~ ~~27~~ 26 bytes

*Edit: -1 byte thanks to Dom Hastings, and -1 byte thanks to caird coinheringaahing*

```
!grepl("ro|p|c",scan(,''))

```

Try it online!

Regular-expression check.
'maroon' + 'brown' both contain `'ro'`, 'purple' and 'pink' both contain `'p'`, and 'cyan' contains `'c'`.

# Answer
> 3 votes
# , ~~60~~ 44 bytes

```
!scan(,"")%in%colors()[c(547,32,536,68,455)]

```

Try it online!

-13 thanks to Robin Ryder.

Takes input as all lowercase. Checks to see if the color is *not* one of the excluded colors.

Outgolfed by Robin Ryder and Dominic van Essen.

# Answer
> 3 votes
# Perl 5, ~~13~~ 12 bytes

*Edit: -1 byte by returning null string as falsy, thanks to Nahuel Fouilleul*

```
$_=!/ro|p|c/

```

Try it online!

Same approach as my R answer (with help from Dom Hastings + Caird Coinheringaahing), but probably better suited to \[Perl\]...

(Edit: realized that porting Neil's Retina answer is ~~actually shorter at~~ ~~also only~~ now slightly longer at 13 bytes)

# Answer
> 3 votes
## WebAssembly Text Format, 111 bytes

```
(func(result i32)i32.const 0 i32.load i32.const 8 i32.load i32.add i32.const 13 i32.rem_s i32.const 7 i32.le_s)

```

This function operates on an integer memory array, that should start pre-filled with the chosen color (in Title Case) as a list of ascii code points. (strings can't be provided as normal function arguments in webassembly). The function will return 1 if its a rainbow color, or 0 if its not.

The actual logic behind the function is effectively the following: `return (mem[0] + mem[8]) % 13 <= 7`. (each character of the color takes 4 bytes in the memory array so byte-index 8 refers to a character-index 2). The actual WebAssembly Text Format is designed to feel like a stack machine, so instructions like `i32.const 8` puts an 8 onto the stack while `i32.add` will take two items off the stack, add them, and put the result back on.

The following is a complete WebAssembly file with the above function embedded inside.

```
(module
    (import "api" "mem" (memory 1))
    (func(result i32)i32.const 0 i32.load i32.const 8 i32.load i32.add i32.const 13 i32.rem_s i32.const 7 i32.le_s)
    (export "check" (func 0))
)

```

This can be compiled to a WebAssembly binary (a binary wasm file can be generated and downloaded through online wat to wasm conversion tools like this one).

The following javascript runs the compiled binary. It contains the logic to create the memory array, pre-filled with a color. For convenience, it has the binary WebAssembly embedded in it.

```
// Byte array generated by putting the WAT text into https://mbebenita.github.io/WasmExplorer/
// then downloading the resulting wasm file
// then running [...require('fs').readFileSync('path/to/file.wasm')]
const bytes = new Uint8Array([0,97,115,109,1,0,0,0,1,133,128,128,128,0,1,96,0,1,127,2,140,128,128,128,0,1,3,97,112,105,3,109,101,109,2,0,1,3,130,128,128,128,0,1,0,6,129,128,128,128,0,0,7,137,128,128,128,0,1,5,99,104,101,99,107,0,0,10,153,128,128,128,0,1,147,128,128,128,0,0,65,0,40,2,0,65,8,40,2,0,106,65,13,111,65,7,76,11])
// Alternativly, you can read from the raw wasm file after generating it.
// const bytes = require('fs').readFileSync('./output.wasm')

async function initWaModule() {
  const mem = new WebAssembly.Memory({initial:1})
  const { instance } = await WebAssembly.instantiate(bytes, { api: {mem}, })

  return {
    isRainbowColor(color) {
      // Insert color param into memory
      const i32Array = new Uint32Array(mem.buffer);
      i32Array.fill(0)
      const colorAsCodePoints = [...color].map(c => c.charCodeAt(0))
      i32Array.set(colorAsCodePoints)

      // Run webassembly function
      return !!instance.exports.check()
    }
  }
}

const TRUE_COLORS = ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet']
const FALSE_COLORS = ['Purple', 'Brown', 'Pink', 'Cyan', 'Maroon']

;(async () => {
  const { isRainbowColor } = await initWaModule()
  console.log('These should be true')
  TRUE_COLORS.forEach(color => console.log(color, isRainbowColor(color)))
  console.log('These should be false')
  FALSE_COLORS.forEach(color => console.log(color, isRainbowColor(color)))
})()
```

# Answer
> 3 votes
# 05AB1E, ~~14~~ 8 bytes

*-6 bytes thanks to @ovs.*

```
'•³€å¤-à

```

Try it online!

```
'•³€å¤-à  # full program
      -   # subtract...
     ¤    # last element of...
    å     # is...
   €      # each character of...
          # implicit input...
    å     # in...
'•³       # "deep"...
       -  # from...
          # (implicit) each element of...
    å     # is...
   €      # each character of...
          # implicit input...
    å     # in...
'•³       # "deep"
       à  # greatest element of list
          # implicit output

```

# Answer
> 2 votes
# Japt `-!`, ~~13~~ ~~9~~ 8 bytes

```
g8 k`Ã¾

```

Try it

# Answer
> 2 votes
# Charcoal, ~~10~~ 9 bytes

```
›⁶³﹪⍘Ｓβ⁹⁴

```

Try it online! Link is to verbose version of code. Takes input in lower case. Output is a Charcoal boolean, i.e. `-` if rainbow, nothing if not. Explanation:

```
     Ｓ      Input word
    ⍘ β     Decoded as base 26 using lowercase alphabet
   ﹪   ⁹⁴   Modulo literal 94
›⁶³         Check whether 63 is greater than the result
            Implicitly print

```

# Answer
> 2 votes
# JavaScript (ES9), 23 bytes

Similar to Neil's Retina answer, but with a negative lookbehind to prevent `pur**ple**` from being matched.

```
s=>/d|(?<!pl)e/.test(s)

```

Try it online!

---

# JavaScript (ES6), 25 bytes

The case doesn't matter. Returns a Boolean value.

```
s=>parseInt(s,35)%385%3>1

```

Try it online!

# Answer
> 2 votes
# Python 3, ~~71~~ ~~56~~ 44 bytes

-15 bytes thanks to @Scott

-12 bytes thanks to @ovs

```
lambda s:(s[0]<'c'<'r'==s[1])==(s[0]in'pcm')

```

Try it online!

# Answer
> 2 votes
# Pyth, 9 bytes

```
%%Cz283 2

```

Try it online!

*Answering my own question now that others have me beat... (FYI I solved this after posting)*

Explanation:

1. Converts to int with base 256
2. Modulo that by 283
3. Modulo by 2.

1 if rainbow color, 0 if not.

# Answer
> 2 votes
# Ruby `-n`, 18 bytes

```
p 255969480%$_.sum

```

Try it online!

Input in Title Case, output is either a truthy integer or falsey zero.

---

\\$255969480\\$ is the lowest common multiple of the sums of all of the Title Cased truthy strings, which is also not a multiple of any of the sums of the Title Cased falsey strings. The reason I use Title Case is because the sums share a lot of common factors, reducing the length of the number. This could definitely be ported to various golfing languages to save lots of bytes, ~~which I might do.~~ see below!

---

# 05AB1E, ~~14~~ 10 bytes

```
ÇO•F;_â•s%

```

Try it online!

Same method as the above - input in Title Case, output as either 0 for false or a positive integer for true

# Answer
> 2 votes
# Python 3.8 (pre-release) `PYTHONHASHSEED=2537`, 18 bytes

```
lambda x:hash(x)%2

```

Try it online!

I'm pretty sure this is allowed. An environment variable is just like a command-line option, so this is considered a separate programming language to normal Python. Input in lowercase, outputs `1` or `0`.

# Answer
> 2 votes
# C (gcc), 34 bytes

Function takes a lowercase colour and returns `1` if it is rainbow colour, otherwise `0`.

To save space, I hash the first four characters of the colour with modulo 81 (the first number that didn't have collisions and had all printable remainders) and search for that in the list of hashes for the non-rainbow colours. If there is no match, then it is a rainbow colour.

```
f(int*s){s=!index("D@M1&",*s%81);}

```

Try it online!

I could save two bytes if returning `0` for a rainbow colour and non-zero for a non-rainbow was allowed:

```
f(int*s){!index("D@M1&",*s%81);}

```

Try it online!

# Answer
> 2 votes
# JavaScript (ES6), 20 bytes

```
s=>!/ro|p|c/.test(s)

```

Try it online!

How it works: Get a truthy value if `ro` is present, `p` is present, or `c` is present, then inverts that value so if they are present, the result is falsey, otherwise the result is truthy

Look at the regex here (Regex101.com)

# JavaScript (ES6), 22 bytes

```
s=>!/p|[^e]n$/.test(s)

```

Try it online!

How it works: Get a truthy value if it starts with `p` or ends in `n` without an `e` before it. The `!` inverts that value so it returns true if no match and false if there is a match. I've tried multiple other regex's that end up being the same length, so i went with this one since it's easy enough to explain.

Look at the Regex here (Regex101.com)

# Answer
> 2 votes
# Python 3, ~~38~~ 31 bytes

-7 thanks to DLosc

```
lambda s:s[-2]in'egou'>'a'<s[1]

```

Try it online!

Just tests the second and second-to-last characters. Takes a different approach to aidan0626's submission and doesn't rely on custom hash seeds like pxeger's.

# Answer
> 2 votes
# Scala, 17 bytes

```
_.product%237<132

```

Computes the product of the characters' ASCII values modulo 237 and checks whether the result is smaller than 132. Expects its input in title case.

Try it online!

# Answer
> 1 votes
# C (gcc), ~~46~~ ~~42~~ 41 bytes

Saved 4 bytes thanks to gastropner!!!
Saved a byte thanks to Samathingamajig!!!

```
f(char*s){s=*s-80&&*s-77&&*s-67&s[3]-87;}

```

Try it online!

Inputs the colour all in caps and return \\$1\\$ for a colour of the rainbow or \\$0\\$ otherwise.

# Answer
> 1 votes
# Canvas, 12 bytes

```
｛ｃ］∑“Ｎ＊.［„；％

```

Try it here!

same method as pxeger's answer.

# Answer
> 1 votes
# GAWK, 18 16 bytes

(*-2 thanks to Dominic van Essen*)

```
2>$0=/[de]/*!/p/

```

Try it online!

Translation of Neil's `has "d" or "e" but not "p"` logic. Uses `"2>"` to make sure the condition is always true for any input, and sets `$0` to truthy/falsey so that the default action, which is `print $0`, will output the result.

# Answer
> 1 votes
# x86 machine code, 8 bytes

Hexdump:

```
6b 01 e7 c1 e8 0a d6 c3

```

Multiplies the 32-bit value at string start by `-25`, and extracts bit 9 from the result. Returns `al = -1` for rainbow colours, and `al = 0` for non-standard ones.

Disassembly:

```
6B 01 E7             imul        eax,dword ptr [ecx],0FFFFFFE7h
C1 E8 0A             shr         eax,0Ah
??                   ?? ??
C3                   ret

```

Here, `?? ??` represents the "undocumented" `SALC` instruction.

# Answer
> 1 votes
# Emmental, 77 bytes

```
;#35^#49#!;#35#53#57v^:#65!A82!A79!A89!A71!A73!A86!A75!;#44v#49#45#63#66!#,?.

```

Try it online!

# Answer
> 1 votes
# Vyxal, 7 bytes

```
C₈β⁺µ%∷

```

Try it Online!

## How?

```
C₈β⁺µ%∷
C       # Character codes of (implicit) input
  β     # Convert from base...
 ₈      # ...256
   ⁺µ   # Push 283
     %  # Modulo
      ∷ # Parity (a % 2)

```

# Answer
> 1 votes
# brainfuck, ~~370~~ 337 bytes

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

```

Works by taking input, and returning `0` if it is `p`, `c`, or `m`, if it is `b` it takes input again to differentiate between `blue` and `brown`. Otherwise, it returns `1`.

Try it online!

# Answer
> 1 votes
# Wolfram Language (Mathematica), 31 bytes

```
StringPosition[#,"ro"|"p"|"c"]&

```

Try it online!

Boring, but valid.

# Answer
> 0 votes
# 05AB1E, 16 bytes

```
.•4W'bÓ´€‚Γ•I2£å

```

Try it online!

This uses the fact that there is a fixed set of possible inputs.

# Answer
> 0 votes
# TI-Basic, 25 bytes

```
inString(Ans,"D") or inString(Ans,"E") and not(inString(Ans,"P

```

Port of this answer. Takes input in uppercase in `Ans`. Output is stored in `Ans` and displayed.

# Answer
> 0 votes
# batch 38 bytes

```
@Echo(%1|findstr/li "e i"|find/v /i"p"

```

run from cmd.exe, input via parameter 1 is case insensitive.

Pipes input through findstr matching against `e` or `i`, pipes matches to find, rejecting any input matching `p`. outputs the input color if a rainbow color, nothing if the input is not a rainbow color. Also returns `1` false or `0` true in the errorlevel.

# Answer
> 0 votes
# APOL, 42 bytes

Uses Neil's answer's formula

`v(0 i);!(&(|(⌕(⁰ \d) ⌕(⁰ \e)) !(⌕(⁰ \p))))`

---
Tags: code-golf, string, decision-problem
---


title: center a matrix

text:
# Question
Title: center a matrix
The words "center a" probably give flashbacks to any decent HTML developer. Luckily, we are not working with divs, we are working with matrices.

Given a matrix where w=h, and given a "length" to extend it by, make a new matrix and center the old one in it, populating blank squares with the length. For example:

```
m = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
l = 1

OUT = [
[1, 1, 1, 1, 1],
[1, 1, 2, 3, 1],
[1, 4, 5, 6, 1],
[1, 7, 8, 9, 1],
[1, 1, 1, 1, 1]]

```

```
m = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
l = 2

OUT = [
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 2, 3, 1, 1],
[1, 1, 4, 5, 6, 1, 1],
[1, 1, 7, 8, 9, 1, 1],
[1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1]

```

I would do more examples but they are tough to type out :/

Notice that each dimension has length\*2 added to it. And that the "empty" space (the new matrix) is populated with the length. Here are the parameters and rules:

**Params**

* vars / method can be named whatever you want
* 0 \< m.length \< 11
* -1 \< m\[x\]\[y\] \< 11
* 0 \< l \< 11

**Rules**

* Input will be `f(int[][] m, int l)`
* Output will be `int[][]`
* Use the closest thing to a matrix if not available in your language
* Standard rules apply
* This is `code-golf`, so shortest code per language wins!

Good luck :)

# Answer
> 4 votes
# BQN, 10 bytesSBCS

Port of my APL answer.

Anonymous tacit infix function taking taking `l` as left argument and `m` as right argument.

```
∾˘⟜⌽⟜⍉⍟4⍟⊣

```

Run online!

`⍟⊣` repeat `l` times:

…`⍣4` repeat 4 times:

…`⟜⍉` transpose, then:

…`⟜⌽` flip upside-down, then:

…`∾˘` concatenate `l` to each row of that

**Alternatively:**

`∾˘` concatenate `l` to each row of…

`⟜⌽` the flipped upside-down…

`⟜⍉` transpose

`⍟4` done four times

`⍟⊣` done `l` times

# Answer
> 3 votes
# Pyke (non-competing), 5 bytes

```
VQA.X

```

Since the integers are guaranteed to be single digits, I/O are multi-line strings (since the challenge asks for a strict integer-matrix I/O, I've marked it as non-competing).
Takes the length as first input, and matrix-string as second.

Try it online.

**Explanation:**

```
V      # Loop the (implicit) first input amount of times:
       #  (use the implicit second multi-line input-string)
 Q     #  Push the first input again
  A    #  Deep apply the following command:
   .X  #   Surround the string with this character around it
       # (after which the result is output implicitly)

```

# Answer
> 3 votes
# Wolfram Language (Mathematica), 15 bytes

```
##~ArrayPad~#2&

```

Try it online!

Built-in. Input `[m, l]`.

# Answer
> 2 votes
# Python 3.8 (pre-release), 64 bytes

```
lambda n,l:(c:=[[l]*(l+l+len(n))]*l)+[l*[l]+e+l*[l]for e in n]+c

```

Try it online!

It's been a while since I posted a working answer...so feel free to suggest golfs. There are probably plenty of them... ;)

Sure enough... thanks @Jitse for -2 bytes.

# Explanation

Constructs a matrix.

First `l` rows: `l` repeated `l+l+len(n)` times (length of n plus the extra, twice).

Next `len(n)` rows: `l` repeated `l` times, plus the current row of the matrix, plus `l` repeated `l` times.

Final `l` rows: same as first `l` rows.

Then I use the walrus operator to save bytes.

# Answer
> 2 votes
# 05AB1E, ~~8~~ 7 bytes

```
·FøXδ.ø

```

First input is the length, second the matrix.

-1 byte thanks to *@emanresuA*.

Try it online. (Footer  added to pretty-print the output, feel free to remove it to see the actual matrix result.)

**Explanation:**

```
·         # Double the (implicit) input
 F        # Loop that many times:
   ø      #  Zip/transepose the matrix; swapping rows/columns
          #  (which will use the second implicit input in the first iteration)
     δ    #  Map over each row:
      .ø  #   Surround the row with a trailing/leading
    X     #   1 (as integer, a literal `1` would add strings `"1"`,
          #      so with this the output is cleaner)
          # (after which the result is output implicitly)

```

If the filler character should be the input-length (as the challenge spec says, but the second test case contradicts), it would still be 7 bytes by replacing the `X` with `¹` (first input): Try it online.

# Answer
> 2 votes
# , ~~55~~ 48 bytes

```
f=function(m,l)"if"(l,f(t(rbind(1,m,1)),l-.5),m)

```

Try it online!

-7 bytes thanks to pajonk.

+6 bytes if padding with `l` rather than `1`.

# Answer
> 1 votes
# APL (Dyalog), ~~16~~ 14 bytes

Anonymous infix lambda taking `l` as left argument and `m` as right argument.

```
{⍺⌽⍤⍉⍤,⍣4⍣⍺⊢⍵}

```

Try it online! (Uses Extended because TIO's plain Dyalog is outdated)

`{``}` "dfn";  is left argument and  is right argument.

`⊢⍵` on the argument…

…`⍣⍺` repeat `l` times:

…`⍣4` repeat 4 times:

`⍤,` prepend `l`, then:

`⌽⍤⍉` mirror the transpose

# Answer
> 1 votes
# Wolfram Language (Mathematica), 39 bytes

```
Nest[Thread@*Reverse@*Append[#],#2,4#]&

```

Try it online!

-15 bytes from ATT

---

Explanation:

`Nest[` Repeat the following process

`Thread@*Reverse@*` Transpose and reverse (rotate clockwise) our matrix

`Append[#],` with the padding variable appended.

`#2,` Start with our original matrix

`4#]&` and do this four times the padding amount times.

Longer version that doesn't rotate the matrix:

# Wolfram Language (Mathematica), 98 bytes

```
f[m_,l_]:=Nest[{v}~Join~Append[#,v=Array[l&,a+l]]&,PadLeft[PadRight[#,a=Tr[1^m]+l,l],a+l,l]&/@m,l]

```

Try it online!

Wouldn't be surprised if this gets golfed significantly further than its current state (I suspect it would involve either MovingMap or just Transposing the matrix to do the sides instead of PadLeft/Right), but it works.

---

Explanation:

`f[m_,l_]:=` Create a function (because of slot collisions)

`Nest[` that will repeatedly apply

`{v}~Join~` prepending v to our list

`Append[#,v=` and appending it, where v is

`Array[l&,a+l]]]&` a list of the padding amount, of a size equal to a plus the padding amount.

`PadLeft[` Our starting input will be padding the left of

`PadRight[#,a=` the right-padded version of the list, padded to length a,

`Tr[1^m]+l,` where a is the length of the matrix plus the padding amount,

`l],` using l as the element to pad with.

`a+l,` The left padding will be padded to length a+l,

`l]&` still using element l.

`/@m,` Do this padding to each row of our input matrix.

`l]` Finally, do the repeated application of the first step l times.

# Answer
> 1 votes
# JavaScript (ES6), 71 bytes

*(-6 bytes if we always fill with 1's instead)*

Expects `(length)(matrix)`.

```
(n,N=n)=>g=m=>n--?g([q=(m=m.map(r=>[N,...r,N]))[0].map(_=>N),...m,q]):m

```

Try it online!

# Answer
> 1 votes
# Vyxal, 8 bytes

```
d(∩ƛ¹p¹J

```

Try it Online! Port of @Kevin Cruijssen's 05AB1E answer.

If it should be filled with `1`s instead (like in the test cases), then swap the tiny `¹` with a full-size `1` for the same byte count.

**How it works:**

```
d(∩ƛ¹p¹J
d(         # Repeat 2*(length) times:
  ∩        #   Transpose
   ƛ       #   For each row:
    ¹p     #     Prepend length
      ¹J   #     Append length

```

# Answer
> 1 votes
# Haskell, 75 bytes

```
f m l=let r=replicate;b=r l$r(length m)1;a=r l 1in map(\x->a++x++a)$b++m++b

```

# Answer
> 0 votes
# Factor \+ `combinators.extras`, 51 bytes

```
[ dup <array> '[ [ _ 1surround ] map flip ] twice ]

```

Requires modern Factor for `1surround`, so have a picture:

Here is a version that works on TIO for 3 more bytes:

Try it online!

## Explanation

* `dup <array>` Create an array of \\$l\\$ \\$l\\$s.
* `[ ... ] twice` Call a quotation two times.
* `[ _ 1surround ] map` Append and prepend a copy of the array to each row of the matrix.
* `flip` Transpose.

# Answer
> 0 votes
# Julia 1.0, 46 bytes

```
m>n=0<n ? [(a=ones(size(m,2));) m' a]>n-.5 : m

```

Try it online!

* can take non-square matrices
* recursive function. At each half-step, adds a column of ones to each side of the matrix
* output is with floats, +1 byte to have ints Try it online!

# Answer
> 0 votes
# Charcoal, 25 bytes

```
Ｆ⁴«ＦηＦθ⊞κθ≔Ｅ§η⁰Ｅ⮌η§μλη»Ｉη

```

Try it online! Link is to verbose version of code. Does not require the matrix to be square. Takes `l` as the first argument for consistency (see below). Explanation:

```
Ｆ⁴«

```

Repeat four times.

```
ＦηＦθ⊞κθ

```

Append `l` to each row `l` times. (`ＦθＦη⊞λθ` also works of course.)

```
≔Ｅ§η⁰Ｅ⮌η§μλη

```

Rotate the matrix.

```
»Ｉη

```

Output the matrix in Charcoal's default format (each element on its own line and rows double-spaced).

String-based version inspired by @KevinCruijssen's Pyke answer for 19 bytes:

```
ＮηＷＳ⊞υιＵＯ⁺⊗ηＬυθＭηηυ

```

Try it online! Link is to verbose version of code. Takes `l` as the first argument. Explanation:

```
Ｎη

```

Input `l` as an integer (`θ` still contains `l` as a character).

```
ＷＳ⊞υι

```

Input the matrix.

```
ＵＯ⁺⊗ηＬυθ

```

Draw an expanded matrix filled with the character `l`.

```
Ｍηηυ

```

Output the input matrix in the middle.

# Answer
> 0 votes
# Perl 5, 66 bytes

```
sub f{my$f=[1,(1)x@_];($l=pop)?f($f,(map[1,@$_,1],@_),$f,$l-1):@_}

```

Try it online!

---
Tags: code-golf, array, matrix
---