We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Rube Goldberg

From Esolang
Jump to navigation Jump to search

Rube Goldberg is a language created by the Code Golf Stack Exchange user Mega Man for the code golf challenge "Rube Goldberg". It is the ConstantLanguage("Rube Goldberg").

The challenge the language is based on involves writing a "machine" which is a program in an initial language that outputs a program in another language which outputs a program in another language... and so on until the final program which outputs "Rube Goldberg". Machines are scored by the byte count of the initial program divided by the amount of "extra languages", which refers to the amount of unique languages after the first language. For example, any of the programs below would have a score of infinity since there are 0 extra languages, while a Python -> C -> Lua chain would have 2 extra languages, and a C -> C++ -> C -> Python -> Rust -> Python chain would have 3 extra languages as C and Python are repeated. The machine with the lowest score wins the challenge.

Syntax

In this language, every program outputs "Rube Goldberg" (without the quotes).

Interpreters

///

Also a polyglot with flag and Text and is a cheating quine.

Rube Goldberg

Ada

with Ada.Text_IO; use Ada.Text_IO;
procedure RubeGoldberg is
begin
    Put_Line("Rube Goldberg");
end;

Assembly

NASM x86-64 Windows.

section .text
    extern GetStdHandle, WriteConsoleA
    global _main
_main:
    push rbp
    mov rbp, rsp
    sub rsp, 48
    mov rcx, 4294967285
    call GetStdHandle
    mov rcx, rax
    lea rdx, [rel msg]
    mov r8d, 14
    xor r9, r9
    mov [rsp + 32], 0
    call WriteConsoleA
    add rsp, 48
    pop rbp
    xor rax, rax
    ret
section .rodata
msg:
    db "Rube Goldberg", 10

Befunge-93 and Funge-98

"grebdloG ebuR">:#,_@

C

#include <stdio.h>
int main() {
    puts("Rube Goldberg");
}

C++

#include <iostream>
int main() {
    std::cout << "Rube Goldberg" << std::endl;
}

Using modules, introduced in C++23:

import std;
int main() {
    std::println("Rube Goldberg");
}

CMake

CMake is a build system so this will output some extra garbage. Put this in a CMakeLists.txt file.

cmake_minimum_required(VERSION 3.16)
project(RubeGoldberg)
message(STATUS "Rube Goldberg")

COBOL

IDENTIFICATION DIVISION.
PROGRAM-ID. RUBE-GOLDBERG.
PROCEDURE DIVISION.
MAIN.
    DISPLAY "Rube Goldberg".
    STOP RUN.

ConstantLanguage()

ConstantLanguage("Rube Goldberg")

Alternative

QuineAvoiding("Rube Goldberg", "Rube Goldberg")

Alternative 2

QuineInvoking("Rube Goldberg", "Rube Goldberg")

Cyclic Clockwise Rotating Contraption

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiOiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiOdddddddddddddddddddOiiiOdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddOiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiOiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiOdddOddddddddoddOiiiOiiiiiiiiiiiiiodddddddddddO(dZ)iiiiiiiiiiO]

deadfish

ASCII number output.

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddoiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiodddoddddddddoddoiiioiiiiiiiiiiiiiodddddddddddo

Entropy

Will not always print the exact message.

Program RubeGoldberg RubeGoldbergEntropy [
    print "Rube Goldberg";
]

FALSE

"Rube Goldberg"

flag

Also a polyglot with /// and Text.

Rube Goldberg

GDScript

Either attach this to a node in a scene or register it as an autoload.

extends Node
func _ready() -> void:
    print("Rube Goldberg")

GNU Make

Put this in a Makefile.

.PHONY: all
all:
    echo "Rube Goldberg"

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>Rube Goldberg</title>
  </head>
  <body>
    <h1>Rube Goldberg</h1>
  </body>
</html>

Lox

Probably works in Python 2.

print "Rube Goldberg";

Problemang Sikat

y машина C

Alternative

y ⇶(("Rube Goldberg" C) 0)

Alternative II

y ℃("ConstantLanguage(\"Rube Goldberg\")" C)

Python 2

Also works in Ruby.

print "Rube Goldberg"

Python 3

This is a really short interpreter in Python 3:

print("Rube Goldberg")

Also works in Ruby, Julia, and Lua.

Rust

fn main() {
    println!("Rube Goldberg");
}

Scratch

Text version

when flag clicked
say [Rube Goldberg]

Standard ML

print "Rube Goldberg\n";

Text

Also a polyglot with /// and flag and is a cheating quine.

Rube Goldberg

txeT

grebdloG ebuR

Usernames

User:I am islptng "Rube Goldberg" User:PrySigneToFry User:ais523

Vague

Requires a very unreasonably extremely strictly standards-compliant interpreter.

+++!++(<+>++++++!)<!0f* f2t<!=++=(-<_+=>-)=_!

Whitespace

   	 	  	 
	
     			 	 	
	
     		   	 
	
     		  	 	
	
     	     
	
     	   			
	
     		 				
	
     		 		  
	
     		  	  
	
     		   	 
	
     		  	 	
	
     			  	 
	
     		  			
	
     	 	 
	
  



Zig

const std = @import("std");
pub fn main(init: std.process.Init) !void {
    try std.Io.File.stdout().writeStreamingAll(init.io, "Rube Goldberg\n");
}