-14
\$\begingroup\$

As the title says, your task is to print the largest string using the shortest code without taking any input value.

Rules

  • The program must take no input and print the largest string to STDOUT

  • The string must contain only ASCII Characters. If you don't know the ASCII Characters, take a look at the table

  • No Loops are allowed

  • No multiplication, exponentiation or any kind of elevation is permitted.

  • The score is measured by subtracting the amount of bytes of your code to the amount of bytes of your string. Example. My code is 60 Bytes and it generates an string of 300 Bytes. My score will be 300-60=240

  • The highest score wins.

Example

try{a.b}catch(e){alert(e)}

The output of my program is ReferenceError: a is not defined = 32 bytes

My Score will be 32-26 = 6


Update

By Loops i mean any repetitive structure. For example for, while, do while, recursive functions etc..

asked Mar 14, 2018 at 18:22
\$\endgroup\$
20
  • 1
    \$\begingroup\$ Generating a 65535x65535 image and printing its content base64 encoded? Sounds allowed, but horribly boring. \$\endgroup\$ Commented Mar 14, 2018 at 18:29
  • 2
    \$\begingroup\$ That's still not an objectively observable requirement. \$\endgroup\$ Commented Mar 14, 2018 at 18:43
  • 6
    \$\begingroup\$ Might I suggest posting in the Sandbox to get feedback before posting challenges? This type of challenge is tough to specify, but it's possible it can be saved with some additional effort and requirements. \$\endgroup\$ Commented Mar 14, 2018 at 18:50
  • 4
    \$\begingroup\$ The shell utility yes by definition has ∞ output, though is not explicitly a loop in the shell language. Allowed? \$\endgroup\$ Commented Mar 14, 2018 at 18:52
  • 3
    \$\begingroup\$ If program P scores S, then you can construct a program that scores 2*S by repeating the source of P twice. \$\endgroup\$ Commented Mar 14, 2018 at 19:53

2 Answers 2

3
\$\begingroup\$

R, 541-9 = 532

When passing a built-in function name to R, the console describes it parameters. I'm sure there are longer ones, but I went for the low-hanging fruit

Code:

.packages

Output:

function (all.available = FALSE, lib.loc = NULL) 
{
if (is.null(lib.loc)) 
 lib.loc <- .libPaths()
if (all.available) {
 ans <- character()
 for (lib in lib.loc[file.exists(lib.loc)]) {
 a <- list.files(lib, all.files = FALSE, full.names = FALSE)
 pfile <- file.path(lib, a, "Meta", "package.rds")
 ans <- c(ans, a[file.exists(pfile)])
 }
 return(unique(ans))
}
s <- search()
invisible(.rmpkg(s[substr(s, 1L, 8L) == "package:"]))
}
<bytecode: 0x103fdf200>
<environment: namespace:base>

Edit: Thanks Giuseppe for the link

answered Mar 14, 2018 at 18:40
\$\endgroup\$
2
  • \$\begingroup\$ @dzaima seems right \$\endgroup\$ Commented Mar 14, 2018 at 18:43
  • \$\begingroup\$ You can add a link to Try it online so we can verify your results! And welcome to R golfing, by the way :) \$\endgroup\$ Commented Mar 14, 2018 at 18:47
1
\$\begingroup\$

Python 3, 937

help()

Try it online!

answered Mar 14, 2018 at 18:50
\$\endgroup\$
2
  • \$\begingroup\$ Wouldn't help() or import this have better code/output ratio? \$\endgroup\$ Commented Mar 14, 2018 at 18:53
  • \$\begingroup\$ @manatwork oh yeah thanks \$\endgroup\$ Commented Mar 14, 2018 at 19:18

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.