# Question
Title: Create output twice the length of the code
# The Challenge

Write a complete program that writes twice as many bytes to standard output as the length of the program.

# Rules

* The program must write ASCII characters to the standard output.
* The contents of the output doesn't matter.
* The output, measured in bytes, must be *exactly* twice the length of the program, also measured in bytes, unless you fulfill the bonus.
* **Any trailing newline is included in the output's byte count.**

# Bonus

Your program can optionally take a number, *`n`*, as input. If so, the output must be exactly `n * program length` bytes. You can assume that *n* will always be a positive integer. If no input is provided, *`n`* must default to 2.

If you do this, you can subtract 25 bytes from your score.

Shortest program wins.

# Restrictions

* No standard loopholes.
* The program must be at least 1 byte long.
* No adding unnecessary whitespace to the source code to change its length. Similarly, comments don't count.
* Unless you fulfill the bonus, the program must accept no input. If you do fulfill the bonus, the integer must be the only input.

Lowest score (program length in bytes - bonus) wins.

The shortest answer for each language wins *for that language*.

## Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```
# Language Name, N bytes

```

where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:

```
# Ruby, <s>104</s> <s>101</s> 96 bytes

```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:

```
# Perl, 43 + 2 (-p flag) = 45 bytes

```

You can also make the language name a link which will then show up in the leaderboard snippet:

```
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

```

```
var QUESTION_ID=59436,OVERRIDE_USER=41505;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&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(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\-?\d+/);answer_ids.push(s),answers_hash[s]=e}),e.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(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\-?\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```

```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;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="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <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><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><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```

# Answer
> 149 votes
# HQ9+, 2 bytes

```
QQ

```

outputs

```
QQQQ

```

I think it is not forbidden here.

# Answer
> 110 votes
# Shakespeare, 768

Yeah, Shakespeare's not much of a golfing language. Outputs 1,536 spaces.

```
Rosencrantz and Guildenstern: A Series of Tedious Events.

Rosencrantz, a count of extraordinary determination.
Guildenstern, a spacy character.

Act I: The Long Conversation

Scene I: A Tortured Friendship

[Enter Rosencrantz and Guildenstern]

Rosencrantz:
 You are a gentle, noble, valiant, loyal, loving companion.

Guildenstern:
 You are nothing!

Scene II: Asking the Hard Questions

Rosencrantz:
 Speak your mind.

Guildenstern:
 You are as fair as the sum of yourself and a daisy. Are you as
 daring as the sum of a big, bold, fiery, feisty, rough, rowdy,
 ham-fisted, hawk-eyed, broad-shouldered, bright-eyed lad and a
 large, yellow, vicious, hairy, wild, scary, long-tailed,
 sharp-clawed, small-eared lion?

Rosencrantz:
 If not, let us return to scene II.

```

# Edit: 256

Okay, I'll actually golf it. Note that the above does not compile in any existing Shakespeare implementation because I wrote it painstakingly by hand (but am prepared to defend its correctness.)

The below translates to C with one warning in spl-1.2.1, and outputs 512 spaces:

```
Ummm.Ajax,1.Puck,2.Act I:I.Scene I:A.[Enter Ajax and Puck]Ajax:You old old old old old cow.Puck:You are zero!Scene II:B.Ajax:Speak thy mind.Puck:You are the sum of you and a red cat.Are you as big as the square of me?Ajax:If not, let us return to scene II.

```

# Answer
> 74 votes
# Recall, 17 bytes

```
................!

```

16 NOOPs. Then the debugger `!` is invoked and dumps the memory to the console. The memory is empty, but the header is 34 bytes long:

```
-- STATE DUMP --
----------------

```

Try it here.

# Answer
> 72 votes
# Mathematica REPL, 1 byte

```
#

```

Prints `#1`.

# Answer
> 66 votes
# CJam, -17 bytes

```
r2e|i8,*

```

The source code is **8 bytes** long and qualifies for the **-25 bytes** bonus.

Try it online in the CJam interpreter.

### How it works

```
r         e# Read a token from STDIN.
 2        e# Push 2.
  e|      e# Logical OR; keep the token if it's not empty, 2 otherwise.
    i     e# Cast to integer.
     8,   e# Push [0 1 2 3 4 5 6 7].
       *  e# Repeat the array the corresponding number of times.

```

# Answer
> 51 votes
## Python 2.6, 10

```
print`-.1`

```

Prints `-0.10000000000000001`, which is 20 chars.

Note that the string repr shows more precision. `print-.1` just gives `-.1`, and `print.1/3` gives `0.0333333333333` for only 13 digits of accuracy.

# Answer
> 47 votes
# Seed, 10 bytes

```
4 56111240

```

This compiles to the Befunge program (found by brute force)

```
9k.@

```

which produces the following 20 bytes when run (tested in CCBI, note the trailing space):

```
0 0 0 0 0 0 0 0 0 0

```

Being unfamiliar with Befunge 98, I had to double check the spec a few times for this one:

* `k` seems pretty broken to me, executing one more time than intended due to the IP moving into the repeated instruction
* Befunge 98's stacks have infinite zeroes at the bottom
* `.` outputs as a number, followed by a space

# Answer
> 46 votes
# R, ~~3~~ 2 bytes

### Code

```
!0           # NOT FALSE

```

Outputs

```
TRUE

```

Wow, finally R, finally.

It seems that `{}` work too, it outputs `NULL`

## Bonus ~~33~~ 16 bytes:

### Code

```
rep(1,number*16)

```

Outputs

```
# if number is not defined
> rep(1,number*16)
> Error: object 'number' not found     # output is 32 (or 2*16) bytes long error

# if number is defined
> number = 3
> rep(1,number*16)                     # output is 16*number bytes long
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

```

# Answer
> 31 votes
# JavaScript, 2 bytes!

Even shorter than the 3 bytes solution:

```
!0

```

Returns `true` after running.

# Answer
> 28 votes
# Matlab, 8 bytes

```
1234;'5'

```

Output:

The output contains *`newline`*, `ans =`, *`newline`* twice, *`space`* four times, `'5'`, *`newline`*, so 16 bytes.

# Answer
> 21 votes
## Python 2, 11

```
print`id`*1

```

Print the string representation of the built-in `id`, which is 22 chars:

```
<built-in function id>

```

The `*1` is to get the code to 11 chars. You could also do `print id;00`.

More boring alternative 11's are:

```
print'1'*22
print 9**21

```

# Answer
> 20 votes
# dc, 10 - 25 = -15

```
2?A*Ar^1-n

```

Takes a blank line for "no input".

Calculates 10 ^ (10 * n) - 1, where n is the input, or 2 if input is empty. Prints a string of `9`s of the required length.

* `2` push 2 to the stack in case input is empty
* `?` push input to the stack
* `A` push 10 to the stack (dc has shortcuts `A`-`F` for 10 - 15)
* `*` pop twice and multiply (multiply input by 10)
* `A` push 10 to the stack
* `r` reverse top two stack elements
* `^` exponentiate 10 ^ (10 * input)
* `1-` subtract 1 from the top of stack
* `n` print with no newline.

# Answer
> 18 votes
# Brainfuck, 14 bytes

```
+++++++[....-]

```

This is a little mathematical exercise. Let's denote the number of `+` characters in the code by `a`, and the number of `.` characters by `b`.

The code outputs `a*b` bytes, with values from `a` down to `1` (these are non-ASCII bytes, but it seems OK according to the spec). The code's length is `a+b+3`. So we have

```
a*b = 2 * (a+b+3)

```

Trying different values for `a` and `b`, we see that the minimum for `a+b+3` is achieved for

```
a = 4       or       a = 7
b = 7                b = 4

```

# Answer
> 17 votes
# TI-Basic, 3 bytes

```
1ᴇ5

```

Prints `100000`.

# Answer
> 17 votes
# gs2, -18 bytes

CP437: `W↕0!↨.2`

Hex dump: `57 12 30 21 17 2e 32`

`W` reads numbers from STDIN into a list. `↕0` appends a 2 to the list, and `!` extracts the first element. Then `↨.` (the list `[0,1,2,3,4,5,6]`) is repeated (`2`) this many times.

This is very similar to Dennis's CJam answer -- gs2 just combines `r` and `i` into one byte.

**Note**: I had to fix a bug in the `gs2` implementation for this to work: previously, each program had a hidden newline appended to its output, which was entirely unintentional. It only surfaced after I tried to solve this program (the language was designed for anarchy golf, which ignores trailing newlines in all problems), and I only pushed a fix to master just now, so feel free to take this answer with a grain of salt.

# Answer
> 16 votes
# Pyth, ~~10~~ 9 - 25 = -16

*-1 by Dennis*

```
**N9?zvz2

```

Prints \[input\]\*9 quote characters, or 2\*9 if the input is empty.

**isaacg has a shorter answer here**

# Pyth, 1 byte

```
T

```

Prints `10`. It's a built in variable that initializes to 10.

# Answer
> 14 votes
# Perl 5, 16 bytes - 25 = -9

```
$_ =$]x($_*2||4)

```

This is an oddball approach to the problem.

Run with the `-p` command line argument.

I saw a Perl answer below that used a special variable to print more text - and thus shorten their byte count. So I used a much more verbose special variable. It prints 8 characters with a 2 character variable name. Thus, with a byte count of 16 (padded with one whitespace character to make it 16), it prints `2 * $]`, where `$]` is the Perl version printed as `5.xxxxxx`, dependent upon your Perl version. Without input it prints it four times, equaling `8*4` or `32`, which is double the byte count of the code.

I love Perl.

# Answer
> 10 votes
# JavaScript, 4 bytes

```
+1/0

```

Prints `Infinity`

I think this is the shortest possible JS solution without ES6 :P

# Answer
> 9 votes
# C, ~~27~~ 25

```
main(){printf("%50f",0);}

```

---

*Thanks @Titus for knocking off 2 bytes*

---

# And for my *non-competing* **16 byte** solution in C, go here: https://codegolf.stackexchange.com/a/111330/16513

^I say non-competing because the error code could possibly depend on your compiler, Also note I'm using GCC in that solution. Also I'm not certain if it breaks rule 1 or not, I think it probably does so I went ahead and labeled it non-competing

# Answer
> 9 votes
## Macaroni 0.0.2, 23 chars

```
print tobase pow 32 9 2

```

Prints 329 in binary, which happens to conveniently turn out to be 46 characters long (it's `1000000000000000000000000000000000000000000000`), without a trailing newline.

# Answer
> 8 votes
# , 2 Bytes

This outputs

```
ÿÿÿÿ

```

Try it online!

Explanation

This is a really hacky answer, and it works by abusing the internals of V. Essentially how it works is that `ÿ` is a command in V that signals the program is over, and any pending commands must complete. Otherwise, some implicit endings would not work, and the interpret would hang more often. This command is automatically sent several times at the end of the program, and most of the time has no effect on the output.

`é` is a command that inserts a single character. However, it does it by grabbing a raw byte, so it doesn't interpret `ÿ` as "end", it interprets it as "this is the character you need to insert."  makes it insert this character 4 times instead of one.

# Answer
> 7 votes
# JavaScript ES6, 33 - 25 = 8

```
(a=2)=>Array(a*33).fill(0).join``

```

Try it online!

# Answer
> 7 votes
# bash, 11 bytes

Here's a pleasingly ironic usage of a data compression tool :) ...

`gzip -f<<<2`

Here's a hex dump of the output (22 bytes)...

```
0000000: 1f 8b 08 00 e3 ce 32 59 00 03 33 e2 02 00 90 af  ......2Y..3.....
0000010: 7c 4c 02 00 00 00                                |L....

```

# Answer
> 6 votes
# CJam, -9

```
q_,{i}{;2}?G*'X*

```

# Explanation

* `q_,`

Reads the entire input and pushes it, then pushes the length.

* `{i}{;2}?`

If the length of the input is over zero, convert it to an integer. Otherwise, pop the input and push 2.

* `G*`

Pushes 16 (the program length), then multiplies it by 2 if there is no input, or by the input.

* `'X*`

Pushes X and multiplies it by the top of the stack.

# Answer
> 6 votes
# \>\<\>, 19 + 2 (-v flag) - 25 = -4 bytes

```
l?!2f4+*v
-1o;!?::<

```

test it here!

Thanks Cole and Sp3000

First checks the stack length, if it's 0 put 2 on the stack. Multiplies it by 21 (code length), then outputs the unicode representation of that number and decrements it by 1, loops until 0. (you'll have to inspect the output to see the characters, since the browser won't display them)

# Answer
> 6 votes
# dc, 19 - 25 = -6

```
2?19*[1n1-d0<l]dslx

```

Takes a number (2 is pushed to the stack as backup) and multiplies it by 19. Prints a `1` (no newline) and decrements the number. Loops while the number is greater than 0.

# Answer
> 6 votes
# C++, 80 bytes

```
#include<iostream>
int main(){int i=0;while(i<20){std::cout<<&i;i++;}return 0;}

```

note the newline character is two characters. (if you don't want it to be, change i\<20 to i\<=19 to get back to the same byte count.)

Sample output (will change every time)

```
0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C0088FA0C

```

same 8 character memory address 20 times.

# Answer
> 6 votes
# JavaScript (ES5), 68 bytes - 25 bonus = 43

```
alert(Array(1+(+prompt()||2)).join(document.scripts[0].textContent))
```

(in case your browser won't allow for the snippet to run for security reasons, try this fiddle http://jsfiddle.net/thePivottt/c3v20c9g/ )

This script only works in a browser following at least DOM3 (with `Node.textContent`) and ECMAScript 5 (or perhaps an older version). I tried to make is as standard conforming and compatible as possible. It also assumes that the script is in the first `script` element of the document.

It actually concatenates multiple copies of the script itself, which is **pretty awesome**. Note that the snippet tool on SE puts extra whitespace around the script. We could ignore that whitespace with `.trim()` but I don't find it necessary considering the program is perfect without SE's meddling. Just save this HTML5 file if you want to see it run perfectly.

```
<!DOCTYPE html>
<html>
  <head>
    <title>Minimalist HTML5 page</title>
    <script>alert(Array(1+(+prompt()||2)).join(document.scripts[0].textContent))</script>
  </head>
</html>

```

This script uses `prompt` and `alert` because `console.log` is not part of any standard, even if most modern browsers use it. If the number of repetitions passed is not a valid number or is empty, it defaults to 2. If the input is a decimal number, the program crashes due the the invalid array length.

The code uses a few interesting features of JavaScript:

* `Array(1+(+prompt()||2))`

+ `Array(INT)` creates an Array of INT cells.
    + `+prompt()` takes an input and turns it into a number. If we passed the input as a string, the `Array` function would simply wrap it in a one-element array.
    + `+prompt()||2` returns the input if it is *truthy*, else it returns 2.
    + This whole code creates an array of N empty elements, where N is one more than the amount of repetitions asked.
* `.join(document.scripts[0].textContent)`

+ The array's `join(STRING)` method creates a string by concatenating all the cells, putting the provided STRING between values. In this program, there are N+1 **empty** elements in the array, or exactly N in-between spots. The result will be a string containing N times the provided STRING.
    + `document.scripts[o]` is the first `<script>` element of the document.
    + The `textContent` of `Node` instances returns the whole text found inside them and their child nodes, including scripts.

# Answer
> 5 votes
# Julia, 42 bytes - 25 = 17

```
print("@"^42((r=readline())>""?int(r):2))

```

This reads a line from STDIN using `readline()`. If it's empty, i.e. no input has been provided, then *n* is defined to be the input converted to an integer. Otherwise *n* is 2. We then print 42*n* `@`s to STDOUT.

# Answer
> 5 votes
# Perl, 18 - 25 = -7

```
print$=x(<>*9||18)

```

The special variable `$=`, a.k.a. `$FORMAT_LINES_PER_PAGE`, begins its life as `60`, and therefore only needs to be duplicated half as many times as byte output needed.

# Answer
> 5 votes
# TI-BASIC, 1 byte

```
0

```

Output:

```
0    ;there is a newline; counts as char

```

Thanks to Thomas Kwa for his spectacular observation. The i/o looks as thus:

```
0
               0   ;right-aligned, but newline is part of output.

```

# Answer
> 5 votes
# Python 2.7, ~~26~~ 24 - 25 = -1 byte

```
def s(c=2):print'A'*24*c

```

24 characters long, prints twice its length on no input:

```
>>> s()
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

```

prints `n*length` for any other input:

```
>>> s(1)
AAAAAAAAAAAAAAAAAAAAAAAA
>>> s(3)
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

```

# Answer
> 5 votes
# Shakespeare Programming Language, ~~216 192~~ 191 bytes

```
Twice the source.Ajax,.Puck,.Act I:.Scene I:.[Exeunt][Enter Ajax and Puck]Ajax:Open heart!You big big big big big big big cat!Puck:You is the sum ofyou a cat!Be you worse I?If solet us Act I!

```

Try it online!

Prints a `0` followed by 128 `128`s.

# Answer
> 4 votes
# Ruby, 24 - 25 = -1

```
$><<?x*24*(gets||2).to_i

```

# Answer
> 4 votes
# Bubblegum, 1 byte

```
Ä

```

prints

```
!#

```

### Test run

```
$ echo -en '\xc4' > double.bg
$ bubblegum double.bg
!#

```

# Answer
> 4 votes
# Self-modifying Brainfuck, 31 - 25 = 6 bytes

Checking for no input is a hassle...

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

```

### Explanation:

See the `If(x==0)` algorithm I used (the one by Ben-Arba).

```
>,                      Take a byte of input x
>+<[>-]>[<++>->]<<      If x == 0 (no input), x++ (add 2 :D)
[<<[.<]>>-]             Print the program's source code in reverse x times

```

### Without the bonus (10 bytes):

```
<[.<]>[.>]

```

### Wishful thinking:

If we didn't have to default the input to two (13 - 25 = -12 bytes):

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

```

# Answer
> 4 votes
## Python, 15 bytes

```
print 'aaaaa'*6

```

Prints:

```
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

```

Which is 30 bytes.

# Answer
> 4 votes
# Java 8, 82 Bytes

```
interface A{static void main(String[]s){for(A a:new A[164])System.out.println();}}

```

Prints out 164 empty lines.

# Answer
> 4 votes
# C, 36 bytes

`main(a){for(a=4;a--;)puts(puts);}//!`

Really hacky stuff here. The implementation of `puts` on my machine (gcc 6.3) has 16 bytes before it hits a null, and adds a newline and SOH (18 bytes total). Run four times, and it's 72 (or 0x48) chars. I padded mine with a 3-char comment to fit that. Most of the chars are unreadable, so here's a hexdump of the output.

```
0000000 5541 5441 8949 55fc 4853 ec83 e808 76ae
0000010 0a01 5541 5441 8949 55fc 4853 ec83 e808
0000020 76ae 0a01 5541 5441 8949 55fc 4853 ec83
0000030 e808 76ae 0a01 5541 5441 8949 55fc 4853
0000040 ec83 e808 76ae 0a01
0000048

```

# Answer
> 4 votes
## , -22 bytes

The program is 3 bytes long and qualifies for the -25 byte bonus. (Okay. One-digit problem fixed!)

```
 0M

```

## Explanation

```
   % Filler space
 M % Map: (implicitly) generate a list from 1 to the input
   % There is an implicit 0, so the 0-input
   % will produce the output [0, 1], which is
   % 6 bytes by default.
 M % Map every item in that list ...
0  % .. with the numeric constant 0

```

# Answer
> 4 votes
# Vim, ~~26~~ 25 - 25 = 0 bytes

*-1 thanks to Aaron Miller*

```
:s/^$/2
C<c-r>=<c-r>"*26
<esc>|D@"ix<esc>

```

Try it online!

### Explained:

```
:s/^$/2<cr>           Substitute blank line with 2. This is the case when no input is given.
C                     Cut the input line and enter insert mode
 <c-r>=               Enter expression mode
       <c-r>"         Paste input
             *26      Multiply by code length
                <cr>  Evaluate
<esc>                 Return to normal mode (from insert mode)
     |                Move to the beginning
      D               Delete the line (which is the number of characters to output)
       @"             Paste the deleted line as the count argument to `i'
         ix           Insert `x'
           <esc>      Exit insert mode and repeat that many times

```

# Answer
> 4 votes
# Hexagony, 3 bytes

```
?"&}>'!_!!}(\\2"^$\<_!\@

```

Try it online! Note: For some reason, the special Unicode character my code uses (, 0x10f447) seems to break TIO's link generator. So to make a linkable version, I replaced the character with `X`. Unfortunately, to run the code properly you'll have to copy and paste the character into the code in place of the `X`. Sorry about that.

Expanded:

```
    ? " & }
   > '  ! _
  ! ! } ( \ \
 2 " ^ $ \ < _
  ! \ @ . . .
   . . . . .
    . . . .

```

Whoops, thought I had a -3 but looked back over the problem and realized I missed that `n` defaults to 2 for an empty input. So here's 28 bytes, qualifies for 25 byte bonus. Works for values of `n > 0`, and defaults to `n = 2` for empty input.

Explanation:

The first bit of code thats run is `?"&}2"^`. `?` reads `n` from input. Then `"&}2"` populates the cell to the right of `n` with a copy of itself, and the cell to the left with `2`. This sets up for `^`, which copies the value to the left of the current cell if the current cell is non-positive or empty, or the value to the right if it is positive. So if `n` does not exist or is non positive it is replaced with 2, otherwise it keeps its current value. After that, its just a matter of running through a simple for loop which decrements n until it reaches 0, each time printing the Unicode character 0x10f447 4 times using `!`. `!` prints the decimal representation of a character, and 0x10f447 is 7 digits long, so in total 28 bytes are printed for each decrement it takes n to reach 0. The Unicode character is arbitrary, any with 7 digits in decimal would work (there are no 8 decimal digit characters.)

Edit: 5 byte bonus answer (doesn't qualify for answer bonus):

```
!<gg@

```

4 byte bonus answer, but it doesn't terminate:

```
!<)0

```

# Answer
> 3 votes
# Mouse, 21 bytes

```
1I:(I.43<^9!1I.+I:)$

```

Ungolfed:

```
1 I:                  ~ Begin a loop index at 1
( I. 43 < ^           ~ While I < 43...
  9 !                 ~ Print 9 to STDOUT
  1 I. + I:           ~ Increment I
)$

```

# Answer
> 3 votes
# q, ~~10~~ 3 bytes

```
3#0

```

Outputs 6 bytes: "0 0 0\n".

# Answer
> 3 votes
# JavaScript (ES6), ~~24~~ 30 - 25 = 5 bytes

```
alert('s'.repeat(30*prompt()))

```

# Answer
> 3 votes
# C, 23 (without bonus)

```
main(){printf("%46d");}

```

Outputs an uninitialized value, padded by spaces to 46 bytes. Trying to do it with a bonus, I arrived to a tie. I don't know whether it's unfortunate or cool.

# C, 23 (with bonus)

```
main(x){printf("%*d",(~scanf("%d",&x)?x:2)*48);}

```

The code has 48 bytes. I use bit-complement `~` to check whether `scanf` returned `-1`.

# Answer
> 3 votes
# Python 2, 11 bytes

```
print 9**21

```

displays `109418989131512359209\n` (22 chars)

# Answer
> 3 votes
# Funciton, 78 bytes

Not very advanced. Just output 156 `A`s. Of course you can change `65` to any two-digit ASCII code. If *non-printable* characters are allowed as well, you could shorten it by 6 bytes by outputting character #1 144 times.

```
╔═══╗┌─╖╔══╗
║156╟┤…╟╢65║
╚═══╝╘╤╝╚══╝

```

# Answer
> 3 votes
# Vitsy, ~~14~~ 11 - 25 = -14 Bytes

Note: This language was made after this question was asked, but it was not created for this task.

```
2a{b*\[DO];
```

I'm pretty sure this can be golfed down a little more, but here you go:

```
2a{b*\[DO];
2              Push 2 to the stack as the backup value - if input is pushed, then it will already exist in the stack.
 a             Push "\n" (the literal) to the stack as an integer - this will be our output.
  {            Rotate the stack to the left
   b*          Multiply the top value (used to be the back-most (2 or input) value) by 11.
     \[..]     Repeat as many times as the top item of the stack specifies for all instructions within []
       DO      Duplicate the top value, then output it.
          ;    End execution.

```

# Answer
> 3 votes
# Common Lisp REPL, 9

```
(write -)

```

`-` is a variable that holds the currently evaluating expression in the REPL, while `write` returns whatever it writes. So it writes `(write -)` then returns `"(write -)"` which is printed by the REPL without the quotes. (If this was done in an REL instead of an REPL, then it'd be a quine instead.)

# Answer
> 3 votes
# , ~~6~~ ~~5~~ ~~3~~ 2 bytes (bonus: -11 bytes) (try it online)

Program:

```
%4

```

Output:

```
0.25

```

Explanation: The reciprocal of 4.

Bonus:

```
10,1$~_1+7*]/2

```

Testcases:

```
10,1$~_1+7*]/2    :10 1 1 1 1 1 1 1 1 1 1 1 1 1
10,1$~_1+7*]/2 2  :10 1 1 1 1 1 1 1 1 1 1 1 1 1
10,1$~_1+7*]/2 3  :10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

```

Explanation:

```
10,               NB. prepend 10 to
   1$~            NB. the "~" reverses the arguments.
                  NB.    e.g. 1 $~ 5 becomes 5 $ 1.
                  NB.    5 $ 1 means create an array of size 5,
                  NB.    using the number 1. The number is
                  NB.    recycled because there is not enough number.
                  NB.    For example, 5$1 2 3 would produce 1 2 3 1 2.
      _1+         NB. add negative one to
         7*       NB. seven multiplied by
           ]/2    NB. if the input is 5, then this part
                  NB.    becomes 2]5, which evaluates to 5.
                  NB.    if there is no input, then this
                  NB.    part is only 2.

```

---

3-byte attempt:

```
7^7

```

Output:

```
823543

```

Explanation: `7` raised to the power `7`.

Notes: Looks like I am not the first one to discover this.

---

5-byte attempt:

Program:

```
*:i.5

```

Output:

```
0 1 4 9 16

```

Explanation: `*:` means square. `i.5` means generate a list from `0` to `4`

---

6-byte attempt:

Program:

```
10,5$5

```

Output:

```
10 5 5 5 5 5

```

Explanation:

`5$5` means create an array of size `5` (on the left of `$`), using the number `5` (on the right of `$`). The number is recycled because there is not enough number.

For example, `5$1 2 3` would produce `1 2 3 1 2`.

# Answer
> 3 votes
# Jelly, -21 bytes

```
o2⁴x

```

The source code is **4 bytes** long and qualifies for the **-25 bytes** bonus. Output is a list of **16**'s.

Try it online! without input or with input.

### How it works

```
o2⁴x  Main link.
      If there's input, the left argument is set to that input.
      Otherwise, it defaults to 0.
o2    Logical OR of the left argument and 2.
      The return value is now either the input or 2.
  ⁴x  Repeat 16 that many times, creating an array.

```

`16` is two bytes long, and **n** copies are separated by **n - 1** instances of . That, plus the two bytes of `[` and `]` gives **2n + 2(n - 1) + 2 = 4n** bytes of output.

# Answer
> 3 votes
# Desmos, 3 bytes

```
9^6

```

Equals 531441

# Answer
> 3 votes
# \[Non-Competing\] C, 16

Code:

```
//score=16 bytes

```

---

Outputs: `error: ld returned 1 exit status` (32 bytes)

# Answer
> 3 votes
# 05AB1E, 6 - 25 = -19 bytes (noncompeting)

```
VžOY×?

```

Try it online!

```
VžMY×?  Argument n
V       Assign n to Y, if n is empty Y defaults to 2
 žO     Push 'aeiouy' to stack (has same length as program)
   Y×   Repeat the string Y times
     ?  Print top of stack without newline

```

# Answer
> 3 votes
# Bash, 5 bytes

```
seq 5

```

Output (with a newline char on the end of each gives 10 bytes)...

1
2
3
4
5

# Answer
> 3 votes
# Whitespace, ~~38~~ 36 bytes

```
SSTTTSTTNNSSNSNSTNSTSSSTNTSSSSNSNTTN
```

Try it online!

Prints "-27-26-25-24-23-22-21-20-19-18-17-16-15-14-13-12-11-10-9-8-7-6-5-4-3-2-1". Whitespace doesn't have optional input so I can't go for the bonus.

# Answer
> 3 votes
# PowerShell, 3 bytes

```
1e4

```

Try it online!

# PowerShell, 1 byte

Thanks to @mazzy for pointing this one out!

```
1

```

Try it online!

Both programs' outputs includes a trailing newline!

# Answer
> 3 votes
# Perl 6, 17 - 25 = -8 points

```
print e x(get||2)

```

Try it online!

Prints the builtin constant `e` (\\$2.718281828459045\\$) either input or 2 times. Luckily, the precision of the constant is 17 bytes long, exactly the same as my code length.

### Explanation:

```
print              # Print without newline
      e            # The constant e (2.718281828459045)
        x(      )  # String multiplied by
          get      # The input
             ||2   # Or two if the input does not exist

```

# Answer
> 3 votes
# Husk, 13 bytes - 25 = -12

```
R'A*13→←`↓ΘN←

```

Try it online! (Try it with no arguments!)

(Both TIO links use capital xi instead of A because it looks cooler, but since I just realized that output has to be ASCII and xi isn't exactly ASCII although it is one byte in Husk's code page, the "canonical" program here uses A instead.)

I tried to come up with a well-thought-out and enlightening explanation of why Husk's overload resolution for built-ins doesn't support distinguishing type signatures by number of arguments alone, but I couldn't quite get it right and it took long enough just to write the solution. Suffice it to say, it doesn't, so I had to get a bit creative.

The first part functions the same with and without an input:

```
R           Repeat
 'A         capital A (could be any character)
    13      (thirteen
   *         times
      →      (one plus
       ←      the first element of
              whatever expression we get to the right of this))
R           times.

```

The rest of the program handles the defaulting behavior, by exploiting 's possession of overloads for using either a function or a number to drop a prefix from a list.

Explained with an input:

```
   N     The infinite list of the natural numbers
  Θ      with a zero tacked on to the beginning
`↓       with the first
         (input
    ←     minus one)
`↓       elements removed.

```

Without an input:

```
   N     The infinite list of all natural numbers
  Θ      with a zero tacked on to the beginning
`↓       without the largest prefix every element of which
    ←    is not equal to 1.

```

A version which elects to not take the bonus:

# Husk, 2 bytes

```
←.

```

Try it online!

Husk assumes that, in the absence of any digits on the left of the radix point, a single `0` is meant, and in the absence of any on the right, a single `5` is meant. So, it is possible to write `0.5` as just `.`. `0.5`, as a string, is three bytes long (and so is `1/2`, which is what actually gets printed), so to add a byte, subtract 1 for `-0.5` (although what we actually print is `-1/2`).

```
←     Subtract 1 from
 .    0.5.

```

A longer and sillier no-input version:

# Husk, 3 bytes

```
ss"

```

Try it online!

Prints `"\"\""`.

```
s      The string representation of
 s     the string representation of
  "    the empty string.

```

A version which *must* take input, having no valid type if it doesn't take an input, and thus neither does nor doesn't take the bonus, failing to comply with the challenge at all:

# Husk, 4 bytes (invalid but here anyways, would be -21 with bonus)

```
*s"¨

```

Try it online!

Prints *n* copies of `"\""`.

```
 s      The string representation of
  "     the string containing
   ¨    a single "
*       repeated n times.

```

# Answer
> 3 votes
# Deadfish~, 5 bytes

You expected a worthwhile submission, but it was ***ME:***

```
{dio}

```

Try it online!

Prints the number "1" ten times.

# Answer
> 3 votes
# APL (Dyalog Classic), 5 bytes

```
⎕←1e9

```

Try it online!

## Explanation

Not very interesting... but I hope this hasn't been posted before.

```
   1e9 ⍝ This returns the constant 1000000000
⎕←    ⍝ Move this to the output buffer

```

# Answer
> 3 votes
# Flobnar, 27 - 25 = 2 bytes

```
*< _.v\@
 *:|\<>
9&- <
3210

```

Try it online!

The decimal input command `&` defaults to its south (`2`) if it fails to read a number. Prints 27 times input copies of `0`.

# Flobnar, 8 bytes

```
0.!____@

```

Try it online!

Prints 16 copies of `0`.

# Answer
> 3 votes
# Python 3 (PyPy), 13 bytes

```
print('h'*26)

```

Try it online!

# Answer
> 3 votes
# ForWhile 6 bytes

`6(9##)`

prints 12 tabs

online interpreter

# Explanation

```
6(   \ start for-loop with 6 iterations
9##  \ print tab twice
)    \ end for-loop

```

# Answer
> 2 votes
# Ruby, 6 bytes

```
p ?a*9

```

Prints `"aaaaaaaaa"` (including the quotes) and a newline.

# Answer
> 2 votes
# JavaScript (ES6), 23 bytes - 25 = -2

```
(n=2)=>'x'.repeat(23*n)

```

Just for fun here's a quine version with a score of 27 bytes -25 =2

```
a=(n=2)=>`a=${a}`.repeat(n)

```

# Answer
> 2 votes
# JavaScript (ES6), 50-25=25

```
a=prompt();alert("0".repeat(48*(isNaN(a|0)?2:+a)))

```

# Answer
> 2 votes
# Element, 16 bytes - 25 bonus = -9

```
_2:1<[2]16*'[X`]

```

Explanation:

```
_2:1<[2]16*'[X`]
_                  take input
 2:                duplicate it
   1<              test "if less than one" (like an empty input)
     [2]           FOR/IF push 2 if true
        16*        multiply by 16
           '       move result to control stack
            [  ]   FOR
             X`    output the letter X

```

# Element, 6 bytes

```
9 12^`

```

prints `282429536481`

Explanation:

```
9       push 9
  12^   to the twelfth power
     `  output

```

# Answer
> 2 votes
# PHP 7, 9 Bytes

```
<?=str_repeat(1,($argv[1]??2)*34);

```

Uses the short opening tag with echo `<?=` and the null coalesce operator `??` which falls back to 2 if `$argv[1]` is not set, without throwing an error.

# Answer
> 2 votes
# Pyth, 8 - 25 = -17 bytes

```
mU2?zvz2

```

Demonstration

Note: This only works in the online compiler, because it removes the trailng newline.

Output form:

```
[[0, 1], [0, 1], [0, 1]]

```

# Answer
> 2 votes
# Haskell, 19 bytes

```
main=print[92..102]

```

Outputs: `[92,93,94,95,96,97,98,99,100,101,102]` and a NL.

# Answer
> 2 votes
# GolfScript, 1 byte

```
1

```

At the end of a GolfScript program, the interpreter outputs everything that's on the stack, and a trailing newline. So the output of the above program is `1` with a trailing newline, two bytes.

# Answer
> 2 votes
# PHP, 56-25 = 31 bytes

I wanted one where **size of the code doesn't matter**:

```
<?=str_repeat(file_get_contents(__FILE__),$n!=''?$n:2)?>

```

Or a more modern version:

```
<?=str_repeat(file_get_contents(__FILE__),$argv[1]?:2)?>

```

# Answer
> 2 votes
# Retina, ~~25~~ 24 - 25 = -1 bytes

```
^$
11
1
11111111!
&!`111

```

Use the `-s` flag to run the code from a single file. Input is in unary.

For reference, without the bonus, there's a 1-byte solution:

```
!

```

Really any single character would do, so long as it's a valid regex (so an unmatched parenthesis wouldn't). This will just print the number of matches (zero in this case) followed by a newline, which makes two bytes.

## Explanation

A translation of the sed answer, requires 25 bytes (computed as 5x5) instead of 40 (see revision history). However, we can do better in Retina:

First, we default the input to (unary) `2` if it's empty with:

```
^$
11

```

Now we turn each `1` into eight `1`s and an exclamation mark with:

```
1
11111111!

```

What we ultimately want is to print 24 bytes for each of those chunks. The idea is to get a "free" multiplication by using Match mode's options to a) print all matches and b) consider overlapping matches. We also note that each match is terminated by a linefeed. So if each match is 3 bytes, we'll get 4 bytes per line, and need 6 lines. How many possible 3-byte matches are there in a string of 8 ones?

```
11111111
111
 111
  111
   111
    111
     111

```

Six. How convenient :). So we the final stage is simply:

```
&!`111

```

Which means that for each unit of source code length requested, we print:

```
111
111
111
111
111
111

```

with a trailing newline, which is exactly 24 bytes.

Note that this is why we needed to append the exclamation mark to each line: it ensures that we don't get additional matches which are shared between chunks.

# Answer
> 2 votes
# T-SQL, 16 bytes

```
SELECT SPACE(32)

```

This returns a string of 32 spaces. Can't think of anything fancier at the minute.

# Answer
> 2 votes
# SWI-Prolog, 3 bytes

```
nl.

```

This outputs:

```
\n
true.

```

(the `\n` is printed as an actual linefeed, not the two characters).

# Answer
> 2 votes
# PHP, 34 bytes - 25 = 9

```
$i=34*$argv[1];while($i--)echo"x";

```

34 bytes generating 34 * `$argv[1]` characters

### 2x version, 25 bytes

```
$i=50;while($i--)echo"x";

```

25 bytes generating 50 characters

# Answer
> 2 votes
## Brian & Chuck, 9 bytes

```
{?
#.{-?

```

Try it online! There's a single unprintable `\x12` (code point 18) before the first `{` which gets decremented each iteration, giving an output of 18 `?`s.

# Answer
> 2 votes
# Batch, 17 bytes

```
@type %0 %0 2>nul

```

This one does not require a special locale (as the `date` solution does)

And it does not require `%PATH%` to be set. (No environment at all, for that matter)

`2>nul` is required to supress `type` to output the filenames on *stderr* (which it does when more than 1 file is printed)

---

Currently I couldn't conjure up a `f(x)=x*N` solution that is shorter than 17+25 bytes

This is the best I could come up with:

```
@if !%1 == ! (call %0 2) else (for /l %%x in (1,1,%1) do @type %0 2>nul)

```

Which has a score of (72-25) **45 bytes**

# Answer
> 2 votes
# JavaScript, 2 bytes

```
f=(n=2)=>("f="+f).repeat(n)

```
* **+27** bytes source code
* **-25** bytes bonus

# Answer
> 2 votes
# Brain-Flak, 128 bytes

Try it online!(You probably wont be able to finish it before the universe ends)

```
(((((((((((((()()()){}){}){}){}()){}){({}[()])}{}){({}[()])}{}){({}[()])}{}){({}[()])}{}){({}[()])}{}){({}[()])}{}){({}[()])}{})

```

## How it works

It starts simply by pushing ninety-eight to the stack:

```
((((((()()()){}){}){}){}()){})

```

It then implements my Triangulation algorithm:

```
(*push n*{({}[()])}{})

```

seven times.

This results in

```
1447283887869053957595051227533274962011504066726596247765427442496031260270109555118382532157345193860142997726793245725173763195275989332247013823819162395404940274645651775376645319691872778284304403703355308050412897911161964450479105938633399903762942

```

The program then terminates and spits the contents of the stack to the terminal. Since *insert atrociously huge number here* is 256 characters long in base 10, the output is exactly twice the source code's length.

As one might tell I used a computer aided search to find this solution. This is almost certainly the shortest solution using the triangulation method I outlined.

# Answer
> 2 votes
# PHP no bonus, ~~19~~ ~~17~~ ~~16~~ ~~14~~ 9 bytes

```
<?=99**9;

```

prints `913517247483640899`

longer versions:

* `echo date(Mc);` **14 bytes** print the first three letters of the month name followed by
an ISO-8601 formatted date (like `2017-01-26T21:57:38-08:00` \- length=25)
* `var_dump([01]);` 15 bytes print `array(1) {\n [0]=>\n int(1)\n}\n`
* `echo decbin(~0);` 16 bytes print 32 ones (on a 32 bit machine)
* `echo md5(12345);` 16 bytes print `827ccb0eea8a706c4c34a16891f84e7b`
* `<?=str_pad(_,34);` 17 bytes print one underscore and 33 spaces.
* `<?=decbin(2**33);` 17 bytes print a `1` and 33 zeroes
* `printf("%34d",0);` 17 bytes print 33 spaces and a `0`
* `echo date(uuuuuu);` 18 bytes print 6\*6 zeroes
* `<?=date(uuuuYY);` 16 bytes print 6 zeroes four times and the current year twice

close but no cigar:

* `<?=pi();` 8 bytes print `3.1415926535898` (15 characters; 64 bit machine)
* `<?=log(2);` 10 bytes print `0.69314718055995` (16 chars; 64 bit)
* `<?=date(wc);` 12 bytes print 26 chars
* `var_dump(_.pi());` 17 bytes print 30 chars (64 bit)

# Answer
> 2 votes
# Excel,10 Bytes

```
=pi()&1234

```

prints `3.141592653589791234`

# Answer
> 2 votes
# Carrot, 4 bytes

```
.^*7

```

Prints `........` (8 `.`s).

Try it online!

### Explanation

```
.^                        Sets the stack-string to "."
  *7                      Append seven duplicates of the stack-string to itself
                          Implicit output

```

# Answer
> 2 votes
# VBA, ~~2~~ ~~1~~ ~~-3~~ 20 - 25 = -5 Bytes

```
?Spc([Max(A1,2)*20])

```

Which outputs `[A1]` (analagous to `n`) else `1` times `22` (length of the code) spaces

### Previous Version 1 Byte

```
?

```

Output

```

```

# Answer
> 2 votes
# TI-Basic, 2 bytes

```
::

```

(Ab)uses the fact that programs output `Done` when nothing is evaluated on the last line.

# Answer
> 2 votes
# Pyth, 3 - 25 = -22 bytes

This was an accident, but it magically works, however, to make this work, I had to waste a byte.

```
yDQ

```

This returns a range between 0-input. The brackets, commas, and spaces add up to `Q` times 3.

I honestly can't quite tell you how or why this works.

Test Suite

# Pyth, 1 byte (no bonus)

```
d

```

Returns a space and a newline, which is 2 characters.

Test Suite

# Answer
> 2 votes
# dc, 4 bytes

```
1dff

```

prints

```
1
1
1
1

```

TIO

# Answer
> 2 votes
# LibreLogo, 21 bytes

**Code:**

```
input_half_the_length

```

**Result:**

```
Unknown name: ‘input_half_the_length”.

```

# Answer
> 2 votes
# Minecraft Functions (18w15a, 1.13 snapshots), 26 bytes

Uses one function named `ab`

ab

```
function ab
tp @e ~0 ~0 ~0

```

It just recurses until it hits the default limit of 65536, at which point it outputs `Executed 65536 commands from function 'minecraft:ab'`

# Answer
> 2 votes
# Perl 5, 17 - 25 = -8

Tip of the hat to primo for getting me to reread perlvar

```
die$/x(<>*17||34)

```

Try it online!

# Answer
> 2 votes
# Brachylog, 10 bytes - 25 = -15

```
{2|};Ṿj₍jw

```

Try it online!

```
         w    Print
     Ṿ        "aeiou"
      j       concatenated with itself
 2            two
{ |}          or whatever else the input is
    ;  ₍      times
        j     concatenated with itself again.

```

A version without the bonus:

# Brachylog, 3 bytes

```
ẈẈw

```

Try it online!

Bypasses the ban on unnecessary whitespace by using unnecessary variable unification instead.

```
  w    Print
 Ẉ     the built-in constant "aeiouy" which is
Ẉ      the built-in constant "aeiouy".

```

A version without any silly redundancy:

# Brachylog, 4 bytes

```
1j₈w

```

Try it online!

```
   w    Print
1       the digit 1 (could be any digit other than 0)
 j      repeated
  ₈     eight times.

```

# Answer
> 2 votes
# Runic Enchantments, 10 bytes -25 = Score: -15

```
"9q2i{S*$;

```

Try it online!

Program reads a string literal (effectively its own source), concats a `9`, pushes a literal `2`, and attempts to read input.

Reading input and there being no input to read causes the next two commands, `{S`, to be NOP. This leaves the literal 2 on top of the stack. If there was input, the input ends up on top and the literal 2 on the bottom. Non-numerical input has undefined behavior.

Then multiplication between the integer on the top of the stack with the next item (the string) duplicates it `n` times (Python style). String is exactly the length of the program, being almost a quine, with `9q` putting a `9` on the end substituting for the missing `"` from the beginning. `$;` prints only the resulting string and terminates (discarding any remaining literal `2` if input was taken).

# Answer
> 2 votes
# INTERCAL, 32 bytes

```
PLEASE,1<-#64DOREADOUT,1DOGIVEUP

```

Try it online!

Prints 64 null bytes and takes no input. If you like your output printable, the next version is for you:

# INTERCAL, 45 bytes

```
PLEASE,1<-#90DO,1SUB#1<-#4DOREADOUT,1DOGIVEUP

```

Try it online!

This is one of those rare cases where C-INTERCAL’s “Turing Tape” I/O is actually helpful. Essentially, what it does is for each value in an array, rather than directly print the corresponding character, is subtract the value from the previous value (starting at 0) mod 256, reverse the bits, and then print that, for every value up to the end of the array. So to print a string of a certain length, you just need to `READ OUT` an array of that size, and to make it more than just a bunch of null bytes, you only need to set the first element of the array and it’ll print a bunch of something else instead: here, setting the first value to 4 prints 90 question marks, since 0 - 4 mod 256 ≡ 252 = 0b11111100 which is 0b00111111 = 63 backwards, and since every cell in the array after the first has a 0 in it the byte which gets printed never changes on account of that 252 - 0 is still 252.

A version with the bonus which prints null bytes:

# INTERCAL, 67 bytes - 25 = 42 (except it can't default to 2)

```
DOWRITEIN.1DO.2<-#67DO(1530)NEXTPLEASE,1<-:1DOREADOUT,1PLEASEGIVEUP

```

Try it online!

A version which prints question marks instead:

# INTERCAL, 80 bytes - 25 = 55 (except it can't default to 2)

```
DOWRITEIN.1DO.2<-#80DO(1530)NEXTPLEASE,1<-:1DO,1SUB#1<-#4DOREADOUT,1PLEASEGIVEUP

```

Try it online!

Uses a call to syslib for multiplication of the input with 80 into `:1`. (Also note that INTERCAL’s native number input format is the digits of a number spelled out with a trailing newline.)

# Answer
> 2 votes
# Boolfuck, 21 bytes

```
+[[>+>+[<;;;]<]>+>>]>

```

This program outputs 330 bits (41.25 bytes) which get buffered to 42 bytes. I found it by systematically (but not quite exhaustively) searching through several million possible candidates.

Here is a hexdump of the output:

```
00000000: fc0f ffe3 ffc7 ffff ff1f fe3f ffff f8ff  ...........?....
00000010: ffff ffff c0ff fe3f ffff ff1f ffff ffff  .......?........
00000020: ff1f ffff ffff ffff fe00                 ..........

```

Try it online!

I also recommend taking a look at this in fatiherikli's Brainfuck visulizer (optimized and with minimal delay of course).

# Answer
> 2 votes
# Guile (5)

`"oof"` outputs `$1 = "oof"`

# Answer
> 2 votes
# Bash, 10 bytes

```
yes|head -

```

outputs 10 lines of `y`s for 20 total bytes output.

# Answer
> 2 votes
# Triangular, ~~10~~ ~~8~~ 7 bytes

```
tdC%.`y

```

Try it online!

Prints odd numbers from 11 to 1 descending, twice each.

Triangular executes as if written in the shape of a triangle. For example, if your program was `123456`, the triangle representing your program would be drawn like this:

```
  1
 2 3
4 5 6

```

The program executes starting from 1, and has a Southeast direction (I.e., the above would run as 1, 3, 6). This explanation is for its actual execution order, which is why it doesn't visually look the same as the submission.
**Ungolfed/Directional**

```
   t
  d C
 % . `
y

-------------------------------------------------------------------

t             - If ToS != 0, set direction to SouthEast
 C            - Push 12
  `           - Set direction to NorthWest (This means we hit "t" with ToS > 0)
   d          - Decrement the top value of the stack
    %y        - Print the top value of the stack, then change direction to NorthEast if ToS != 0

```

---

**Previous Version (8 bytes):**

```
Dn,%d./<

```

# Answer
> 2 votes
# MathGolf, 2 bytes

```
7!

```

Outputs `5040`, which is 4 bytes.

Try it online!

# Answer
> 2 votes
# MathGolf, 5 - 25 = -20 bytes

```
╜2╩[*

```

Try it online!

## Explanation

```
╜2      If not implicit input, push 2
  ╩[    Push dictionary word "great"
    *   Repeat string

```

To make it work, I just had to find a word within the top 256 lines of the dictionary which had the same length as the code.

## Almost working 3-byter with 25 byte bonus

```
╜2r

```

Try it online!

Basically the same as Stan Strum's Pyth answer. If (implicit) input is equal to 0, push 2. Then create a range using either the 2, or the implicit input. The length of the output is the length of the string representation of the array, which is 3 times the length of the array. This only works for input \\$\leq 10\\$.

# Answer
> 2 votes
# GolfScript, 18 - 25 = -7

```
.!35 n*{~18*(n*}if

```

Try it online!

Prints \\$input * 6 - 1\\$ newlines if there is an input else 35 newlines, plus one trailing newline.

```
                if           If
.!                           input is empty:
  35 n*                      35 newlines
       {       }             Else:
        ~18*(n*              18 * input - 1 newlines
                             Trailing newline

```

# Answer
> 2 votes
# GolfScript, 13-25 = -12 bytes

```
.~13*(25if n*

```

Try it online!

## Explanation

```
        if     # If
.              # Input is not a null string:
 ~             # Evaluate the input
  13*(25
           n*

```

# Answer
> 2 votes
# Flurry, 28 bytes, no bonus

```
({<(({})){}{}>})({}){({})}{}

```

### Verification

```
$ echo -n "({<(({})){}{}>})({}){({})}{}" | wc -c
28
$ ./flurry -iin -c "({<(({})){}{}>})({}){({})}{}"
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3
$ ./flurry -iin -c "({<(({})){}{}>})({}){({})}{}"  | wc -c
56

```

Uses `3 ** 3 = 27`, and enables both stack output and return value output so that `3` is printed `27 + 1` times.

```
(
 {<(({})){}{}>}  Literal 3
)              Push and return 3
({})           Pop, push and return 3; 3 3 -> 27
{({})}         Push&return function
{}             Pop 3; 27 push&return 3 -> push 27 copies of 3 and return 3

```

---

# Flurry, 32 bytes, no bonus

```
<(({<({}){}>})({})){}{}>{({})}{}

```

### Verification

```
$ echo -n "<(({<({}){}>})({})){}{}>{({})}{}" | wc -c
32
$ ./flurry -inn -c "<(({<({}){}>})({})){}{}>{({})}{}"
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
$ ./flurry -inn -c "<(({<({}){}>})({})){}{}>{({})}{}" | wc -c
64

```

### How it works

In order to increase the output size, it is easiest to push numbers to stack and print them in integer mode. Basically the program follows the structure of `n push&return m`, where `n` is the repeat count, `push&return` is a function that, given an argument, pushes it and returns it unchanged, and `m` is the number to push. Then the stack contains `n` copies of `m` at the end, giving the output size of `(length of m + 1) * n`.

The second part of the challenge is to generate high enough numbers. Flurry uses Church numerals to represent natural numbers, so multiplication (`<abc...>` evaluates to `a * b * c * ...`) and exponentiation (`ab` evaluates to `b**a`) is much golfier than number literals (except 1), successor `<><<>()>`, and addition (which is defined via successor). So I tried various powers and products until I got the solution, where 32 is `4 * 4 * 2`.

```
<
 (
  ({<({}){}>})  Push and return 2
  ({})          Pop 2, push back and return 2
 )            Push and return 2 ** 2 = 4
 {}{}         Pop 4 and Pop 2
>           Product; return 4 * 4 * 2 = 32
{({})}      Function: push&return
{}          Pop from empty stack, which gives I = 1
32 push&return 1 -> Push 1 to stack 32 times and return 1

```

# Answer
> 2 votes
# Factor, 7 bytes

```
42 2^ .

```

Try it online!

2^42 is a 13-digit number. `.` outputs this number plus a newline.

# Answer
> 2 votes
# Crystal, 9 bytes

```
print 5/7

```

Try it online!

# Answer
> 2 votes
# Risky, 1 bytes

```
*1

```

Try it online!

(Prints `10`, by doing `10 ** 1`)

# Answer
> 2 votes
# Desmoslang Assembly, 11 - 25 = -14 Bytes

```
[1...11*IOT

```

Note that you can't not give input.

# Answer
> 2 votes
# Python REPL, 4 Bytes

```
9**8

```

# \\$9^8=43046721\\$

# Answer
> 2 votes
# C, ~~47 - 25 = 22~~ 46 - 25 = 21 bytes

```
x=2;main(){scanf("%d",&x);printf("%*x",x*46);}

```

Try it online!

Works by printing an uninitialised int, padded to the specified size. Credit to anatolyg's answer.

# Answer
> 2 votes
# AArch64 machine code + Linux syscalls, 56 - 25 = 31 bytes

```
00: 4f03e7c0  movi  v0.16b, #126      // v0 / q0 = '~' * 16
04: ad0003e0  stp   q0, q0, [sp]      // stack   = '~' * 32
08: ad0103e0  stp   q0, q0, [sp, #32] // stack   = '~' * 64
0c: 52800048  mov   w8, #2            // default to 2
10: 71000409  subs  w9, w0, #1        // argc - 1
14: 1a890109  csel  w9, w8, w9, eq    // argc - 1 ?: 2
18: 910003e1  mov   x1, sp            // pointer to '~' * 64
1c: d2800702  mov   x2, #56           // 56 bytes
20: d2800808  mov   x8, #64           // 64 = write()
24: d2800020  mov   x0, #1            // 1 = stdout (loop starts here)
28: d4000001  svc   #0                // syscall, write(stdout, '~' * 64, 56)
2c: 51000529  sub   w9, w9, #1        // loop countdown
30: 35ffffa9  cbnz  w9, 0x24          // loop
34: d65f03c0  ret                     // return result of last syscall

```

Should be linked as `main`.

The input is the number of command line arguments.

---

If it needs to be linked as `_start` and isn't allowed to segfault out:

# AArch64 machine code + Linux syscalls, 60 - 25 = 35 bytes

```
00: 4f03e7c0  movi  v0.16b, #126      // v0 / q0 = '~' * 16
04: ad0003e0  stp   q0, q0, [sp]      // stack   = '~' * 32
08: ad0103e0  stp   q0, q0, [sp, #32] // stack   = '~' * 64
0c: 52800048  mov   w8, #2            // default to 2
10: 71000409  subs  w9, w0, #1        // argc - 1
14: 1a890109  csel  w9, w8, w9, eq    // argc - 1 ?: 2
18: 910003e1  mov   x1, sp            // pointer to '~' * 64
1c: d2800782  mov   x2, #60           // 60 bytes
20: d2800808  mov   x8, #64           // 64 = write()
24: d2800020  mov   x0, #1            // 1 = stdout (loop starts here)
28: d4000001  svc   #0                // syscall, write(stdout, '~' * 64, 56)
2c: 51000529  sub   w9, w9, #1        // loop countdown
30: 35ffffa9  cbnz  w9, 0x24          // loop
34: d2800ba8  mov   x8, #93           // 93 = exit()
38: d4000001  svc   #0                // syscall, exit(result of last syscall)

```

---

If the input number being the number of command-line arguments doesn't count, here's one with no bonus:

# AArch64 machine code + Linux syscalls, 40 bytes

```
00: 4f03e7c0  movi  v0.16b, #126      // v0 / q0  = '~' * 16
04: ad0003e0  stp   q0, q0, [sp]      // stack    = '~' * 32
08: ad0103e0  stp   q0, q0, [sp, #32] // stack    = '~' * 64
0c: 3d8013e0  str   q0, [sp, #64]     // stack    = '~' * 80
10: 910003e1  mov   x1, sp            // pointer to '~' * 80
14: d2800a02  mov   x2, #80           // 80 bytes
18: d2800808  mov   x8, #64           // 64 = write()
1c: d2800020  mov   x0, #1            // 1 = stdout
20: d4000001  svc   #0                // syscall, write(stdout, '~' * 80, 80)
24: d65f03c0  ret                     // return result of last syscall

```

---

And for both of the above conditions:

# AArch64 machine code + Linux syscalls, 44 bytes

```
00: 4f03e7c0  movi  v0.16b, #126      // v0 / q0  = '~' * 16
04: ad0003e0  stp   q0, q0, [sp]      // stack    = '~' * 32
08: ad0103e0  stp   q0, q0, [sp, #32] // stack    = '~' * 64
0c: ad0203e0  stp   q0, q0, [sp, #64] // stack    = '~' * 96
10: 910003e1  mov   x1, sp            // pointer to '~' * 96
14: d2800b02  mov   x2, #88           // 88 bytes
18: d2800808  mov   x8, #64           // 64 = write()
1c: d2800020  mov   x0, #1            // 1 = stdout
20: d4000001  svc   #0                // syscall, write(stdout, '~' * 80, 80)
34: d2800ba8  mov   x8, #93           // 93 = exit()
38: d4000001  svc   #0                // syscall, exit(result of last syscall)

```

# Answer
> 2 votes
# Python 3, 28 bytes - 25 bonus = 3 bytes

```
lambda n=2:print(*[9]*14*n,)

```

Try it online!

Takes in an int as input and outputs \[9\] (the 9 is an arbitrary one-byte number) times 14, which is the length of the input (28) divided by 2. The star expansion operator `*` makes `print` print the contents of `[9]*14*n` as a space-separated string, which results in `2*14*n-1` characters. With the newline (+1 byte) that becomes `2*14*n`=`28*n` characters printed.

# Answer
> 1 votes
## \>\<\>, 29 + 2 (-v flag) - 25 = 6

```
l0=?21-:0(?;fe+1-ao:0=f*e+0.~

```

Takes input on the stack, which I believe is populated through `-v` on the official interpreter. Prints newlines only.

# Answer
> 1 votes
# Befunge-98, 26-25=1

```
&:#v_v>1.1-v
*d2<2<^_@#:<*

```

~~Run it in this interpreter.~~ Apparently, it can't take input.

# Befunge-93, ~~30 - 25 = 5~~ 27-25=2

```
&:#v_v>1.1-v
*93<2<^_@#:<*

```

There is a trailing space on the first line, and this is done because it's shorter to make 27 than it is to make 26 with Befunge-93. This outputs `27*n` 1s in a row.

# Answer
> 1 votes
## Microscript, 1

```
0

```

Prints the digit 0, followed by a newline.

# Answer
> 1 votes
# q (bonus), 27 bytes

```
1#[;"x"]27*2^first"J"$.z.x;

```

# Answer
> 1 votes
# C#, 104 bytes (79 point with bonus)

```
class a{static void Main(string[] p){System.Console.Write(new System.String('1',104*int.Parse(p[0])));}}

```

you can run the program by using an argument for example `test.exe 2` prints 208 character '1'

# Answer
> 1 votes
# awk, 29 - 25 = 4 bytes

```
{printf"%0"($0?$0:2)*29"d",0}

```

Prints the wanted number of zeros.

# Answer
> 1 votes
# Bash + GNU coreutils, ~~26~~ 24 - 25 = ~~1~~ -1 byte

The `x` file:

```
yes|head -c$[24*${1:-2}]

```

(no trailing newline)

Running:

```
$ bash x 1 | wc -c
24
$ bash x | wc -c
48
$ bash x 3 | wc -c
72

```

---

Old version with 26 bytes:

The `x` file:

```
yes|head -c$((26*${1:-2}))

```

(no trailing newline)

# Answer
> 1 votes
## Perl, 10 9 bytes

Uses @primo's suggestion of `$=`.

```
print$=x9

```

`$=` is a shortcut for `$FORMAT_LINES_PER_PAGE`, which defaults to 60.

Example:

```
$ cat doubler.pl
print$=x9
$ perl doubler.pl
606060606060606060

```

# Answer
> 1 votes
## Julia, 9

```
warn(⊆)

```

prints

```
"WARNING: issubset\n"

```

# Answer
> 1 votes
# Stuck, -13 Bytes

```
i_0>;2?12*N*

```

This prints a bunch of newlines (`N`). Empty input is considered to be 0 (or anything less than 0). So, if 4 was given, it will print 48 newlines.

**Old Answer - 3 Bytes**

```
6Rj

```

will output

```
123456

```

Will be giving the bonus a shot.

# Answer
> 1 votes
# Pyth, 4 bytes

```
*8"1

```

will print out

```
11111111

```

# Answer
> 1 votes
# C, 25

```
main(){printf("%*p",50);}

```

This makes use of UB, but it should work. At least it works with gcc 5.2.0

# Answer
> 1 votes
# MSM, 12 bytes

```
'...;.;.;...

```

Outputs `........................`

# Answer
> 1 votes
# Lua, 35 - 25 = 10 bytes

Takes input from the command line, which is in the varargs.

```
print(("n"):rep(35*(...or 2)-1))

```

# Answer
> 1 votes
## R, 3 bytes

```
10;

```

will print

```
[1] 10

```

# Answer
> 1 votes
# QBasic, 2 bytes

```
?1

```

Nonnegative numbers in QBasic are output with both a leading and a trailing space. The `PRINT` command (for which `?` is a shortcut) outputs a newline by default. Thus, I count 4 bytes of output: `space` `1` `space` `newline`.

# Answer
> 1 votes
# Insomnia, 1

```
7

```

Output:

```
00

```

`8`, `A`, `B` are 3 other programs that satisfy the requirement. Their output contains `NUL` characters, though.

# Answer
> 1 votes
# MUMPS, 4 bytes

```
w ?8

```

Well, I'm not sure if this really counts. What this program does is advance the output cursor 8 characters to the right. On every terminal I've used, this is indistinguishable from outputting 8 spaces, but is it *really* the same thing? I dunno.

# Answer
> 1 votes
# C, 82 bytes (with bonus)

```
main(int a,char**b){b&&b[1]&&(a=atoi(b[1])-1);a&&main(a-1,0),printf("%.80f",.0);}

```

Usage:

```
$ wc main.c
       1       2      82
$ ./a.out | wc
       0       1     164
$ ./a.out 4 | wc
       0       1     138
$ ./a.out 133475 | wc
       0       1 10944950

```

# Answer
> 1 votes
# DOS, 7 bytes

```
date /t

```

outputs *di 06-10-2015* (and a newline) on my system, but I'll admit it's locale dependent. So my second best is:

```
echo %PATH:~0,33%

```

which outputs *C:\WINDOWS\system32;C:\WINDOWS;C:* (and a newline).

# Answer
> 1 votes
# Bash + GNU coreutils, -1 byte

```
printf %24s `seq ${1-2}`

```

Score is **24-25**

A non-bonus version for +5:

```
seq 5

```

which produces `1` *nl* `2` *nl* `3` *nl* `4` *nl* `5` *nl*.

# Answer
> 1 votes
# Javascript, 3 bytes!

```
1e5

```

Returns `100000`. Y'all JS golfers are overthinking it!

# Answer
> 1 votes
# POSIX bc, 4 bytes

```
10^7

```

This creates the output `10000000`.

# Answer
> 1 votes
# CJam, 1 byte

```
A

```

Prints 10. Very straightforward.

# Answer
> 1 votes
# APL, -8 bytes

```
'*'⍴⍨17×{0::2⋄⎕}⍬

```

Explanation:

* `{0::2⋄⎕}⍬`: Try to read a number from the keyboard. If the user entered a valid number, return it; if not, return `2`.
* `17×`: multiply it by 17 (the length of the code)
* `'*'⍴⍨`: output that many asterisks.

# Answer
> 1 votes
> # \[this is a sticky note\] This answer has multiple versions.
>
> Due to the fact that I honestly am not quite sure what "input" means here. The first is the one I would use to score myself. Go down to the second to find an explanation. For scoring 1 point, do I tie with the Matmematica one? Or for scoring -1 (-5?) points, do I win? Hmm.
>
> Anywho, this was quite a fun challenge. Maybe I can make my answer a bit better but anyways.

# Python 2.7, 26 - 25 = 1

If input means input from stdin:

```
print("|"*26*input())[:-1]

```

# Python 2.7, 24 - 25 = -1

If input means a variable:

```
n=2;print("|"*24*n)[:-1]

```

Wuut?

```
n=2                   # Set a variable n to 2
;                     # Separate statements (like a line break)
print                 # Print..
(                     # This is in 2.7, not 3, where print is a
                       # statement, not function
  "|"                 # Any character works here
  *24                 # Multiply said character by 24
  *n                  # Multiply resulting string by n
)
[:-1]                 # Remove one character due to the line break
                       # automatically created by print.

```

---

# Python 2.7, 20 - 25 = -5.

If input means a variable, and you don't count `n=2;` as part of the program:

Simply change `24` to `20`:

`print("|"*20*n)[:-1]`

# Answer
> 1 votes
## Burlesque - 7 Bytes

```
blsq ) '*14.*Q
**************

```

It just prints 14 asteriks, while the length of the program is 7 bytes. As for the bonus:

```
ri12.*'*j.*Q

```

is 12 bytes long and prints 12\*n (number provided on STDIN) asteriks.

# Answer
> 1 votes
## Minkolang 0.9, 11-25 = -14 bytes

This language was created after this challenge, but not *for* it.

```
nd1+?2["d].

```

Try it here.

### Explanation

This takes an integer from input, pushing a 2 on the stack if it's -1 (i.e., the input is empty). Then I use the clever quine trick: the `"` pushes the whole program (except the `"`) onto the stack. To make up for the `"`, I duplicate the top of stack with `d`. This is printed out `n` or `2` times and then the program stops. In the case where there is no input, there is indeed a `-1` on the stack. However, Minkolang outputs nothing for negative numbers, so it does not add anything.

# Answer
> 1 votes
## Perl 6, 3 points

```
say 'a'x 21 # 11
# say adds a newline

```

```
print 'a'x 28*(@*ARGS[0]//2)
# 28 - 25 = 3

```

# Answer
> 1 votes
# Sass, 30 bytes

```
codegolf is absolutely awesome

```

if you try to compile this with sass the result is the following error

```
Invalid CSS after "...olutely awesome": expected "{", was ""
/* 60 bytes */

```

# Answer
> 1 votes
# **PlatyPar**, 1 byte

```
#

```

`#` starts a number, but since no number is found after it, it is substituted with `59`. Here's a "real" answer:

```
77^

```

Prints the result of `7^7`, or `823543`, which is of length 6.

Try it online!

# Answer
> 1 votes
# Z80 machine code, 16 bytes

```
3E 1F 0E 02 1E 2A F5 CD 05 00 F1 3D F2 02 01 C7

```

This was made on an Osborne Executive running CP/M version 3.0 using SID. Here is a disassembly (with comments following `#` characters for readability)

```
MVI A,1F     # Set register A equal to 0x1F (iterations-1)
MVI C,2      # Write is BDOS call 2 (CP/M's system calls)
MVI E,2a     # I'm writing '*' as output. Its ASCII value is 0x2a
PUSH PSW     # Push operates on register pairs. This pair contains A.
CALL 5       # Do the BDOS call (which destroys some registers)
POP PSW      # But we can get A back from the stack.
DCR A        # Decrement the loop counter
JP 102       # If last result is non-negative, go to address 0x102
RST 0        # Otherwise, exit

```

All programs are loaded at a fixed address of 0x100, so the jump to 0x102 is well-defined. After running this, CP/M wants to print a newline character. If we count that as output from the program, change the second byte from `1F` to `1E`.

# Answer
> 1 votes
# Fuzzy Octo Guacamole, 8 bytes

```
42*![o;]

```

Also could use:

```
8  ![o;]

```

Or

```
81*![o;]

```

But that is cooler.

Prints 8 "8"s and 8 newlines, including a trailing one.

### Explanation:

`4`: Push 4 to the stack.

`2`: Push 2 to the stack.

`*`: Pop and multiply the top 2 items on the stack and push the result (8)

`!`: Set the loop counter to the top. Is now 8.

`[`: Start a loop that lasts 'loopcounter' (8) iterations.

`o`: Peek at the top of the stack and push it to the temp variable.

`;`: Print the temp var.

`]`: End the loop.

# Answer
> 1 votes
# Java, 90 bytes

```
class T{public static void main(String[]a){for(int i:new int[90])System.out.print("##");}}

```

# Answer
> 1 votes
# Pylongolf, 2 bytes

```
.;

```

`.` \- Reset the stack
`;` \- Debugally print both the stack and the variables.

The interpreter I use prints debugally by converting an 2 arrays into a string which has that string begin with `[` and end with `]` which prints:

```
[][]

```

# Answer
> 1 votes
## Labyrinth, 10 bytes - 25 = -15

Another Labyrinth collaboration with Sp3000.

```
?02
`\
~"@

```

This prints `10n` linefeeds to STDOUT.

Try it online!

### Explanation

The most interesting part is probably how the default value of `2` is handled.

If an input number is given, the following code is executed:

```
?   Read integer from STDIN.
0   Multiply by 10. This is because digits in Labyrinth work by multiplying the top of
    the stack by 10 and then adding themselves, such that multi-digit numbers can be
    written into the code more easily.
    The top of the stack is now positive (and contains the number of characters to be
    printed) so the instruction pointer (IP) turns right/south towards the \.

```

If no input number is given, `?` pushes a `0` instead, and this happens:

```
?   Push 0.
0   Multiply by 10, which is still 0. Since the top of the stack is now 0, the IP
    keeps moving forward/east instead.
2   Multiply by 10, add 2, which sets the top of the stack to 2. The IP hits a
    dead end so it turns around.
0   Multiply by 10 to give 20. Now the top of the stack is positive and IP
    turns left/south towards the \. Again, the top of the stack is the number
    of characters to be printed.

```

Now all we need to do is print one character each while decrementing the top of the stack to zero. The cheapest character to be printed in Labyrinth is a linefeed, because `\` prints one without affecting the stack at all. As an additional trick, we decrement via `multiply by -1`, `bitwise NOT`, to ensure that the top of the stack is negative in the top left corner of the loop (otherwise the IP would move towards the `?` again).

The loop is then simply:

```
\   Print linefeed.
`   Multiply by -1.
~   Bitwise NOT.
"   No-op. This cell acts a junction. While the top of the stack is positive
    the IP will turn left/north, otherwise it will move forward/east.

```

When the IP leaves the loop it hits the `@` which terminates the program.

---

For completeness, here are also two 7-byte versions without the bonus:

```
7:(
@`!

```

prints

```
-7-6-5-4-3-2-1

```

Try it online!

And

```
>11!:
@

```

prints

```
11001011111011

```

Try it online!

The former is a very simply (but compact) loop which prints `-n` while decrementing `n` from `7` down to `0`.

The latter is a simple modification of Sp3000's solution to this challenge (which makes the execution a little bit crazier though).

# Answer
> 1 votes
## Hexagony, 6 bytes

```
o!!!!@

```

Prints

```
111111111111

```

Try it online!

### Explanation

Probably one of the simplest Hexagony programs I've written. The unfolded code is

```
 o !
! ! !
 @ .

```

and is simply executed in reading order. `o` sets the current memory edge to `111` (any letter from `d` to `z` would do). Then the `!` print that four times and `@` terminates the program.

I might try for the bonus later, but I have some doubts that it will fit in side-length 4 (and side-length 5 might end up costing more than the bonus gives).

# Answer
> 1 votes
## APL, 3 bytes

```
1e5

```

Print `100000`...

# Answer
> 1 votes
# dc, 7 bytes

```
2oFddnf

```

---

```
2o         Set the output radix to 2: write to stdout using the binary digits [01]
  F        Push 0xF on the stack, equivalent to 1111b
   dd      Duplicate the top-of-stack, then duplicate the top-of-stack: 1111b, 1111b, 1111b
     n     Pop the topmost item from the stack (1111b) and write it (using binary, per
               the above) to stdout. Do not follow with a newline.
      f    Dump the contents of the stack (1111b, 1111b), following each item with a
               newline.

```

Visible characters comprise 12 bytes; add two (2) newlines for a total of 14.

Edit: Since I'm the only `dc` answer with a natural number for a score, why not post the following?

# dc, 8 bytes

```
cccccccP

```

Clears the stack seven times, then attempts to pop the top (non-existent) value and print it as text (i.e., a number with output-radix `UCHAR_MAX+1`). Since the stack is empty, this results in a fifteen-byte error message followed by a single newline. (Works for GNU dc 1.2)

# Answer
> 1 votes
# PD, 204 bytes

```
#N canvas 1 7 1 1 1;
#X obj 1 6 loadbang;
#X msg 1 1 \; pd quit;
#X obj 2 5 print;
#X obj 2 2 metro 10;
#X obj 1 7 del 340;
#X connect 0 0 3 0;
#X connect 0 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;

```

run with `pd -nogui patchname.pd 2>&1`. The program will print the String `print: bang` (12 bytes including the newline) every 10ms. Then the program terminates after 340ms which will result in the string being printed 34 times (34 * 12 = 408 Bytes output).

# Answer
> 1 votes
# Ruby, 24 bytes (with bonus)

```
->m{m.to_i.times {49.times {print "a"}}}[gets||2]

```

# Answer
> 1 votes
## Python, 24-25= 0 -1 bytes

```
print'a'*int(input())*24

```

It takes input, converts it to an integer, multiplies it by 24 (the length of my code) and multiplies the character `a` by it

Thanks to @EamonOlive for reducing 1 byte

# Answer
> 1 votes
# Cubix, 10 bytes

Cubix is a 2D esolang with a twist: the source code is wrapped around the outside of a cube.

```
>..(NU@?O/

```

**Test it online!** This maps to the following cube:

```
    > .
    . (
N U @ ? O / . .
. . . . . . . .
    . .
    . .

```

The output is

```
10998877665544332211

```

Don't even ask how it works... though if you'd like to watch it in action, run it here.

# Answer
> 1 votes
# 05AB1E, 7 - 25 = -18 bytes

Saved a byte thanks to *Okx*.

```
YI7*ð×?

```

Try it online!

**Explanation**

```
Y       # push 2
 I      # push input
  7*    # multiply top of stack with 6 (program length)
    ð×  # repeat <space> that many times
      ? # print top of stack

```

# Answer
> 1 votes
# PHP, ~~32~~ 30 bytes -25 = 5

```
<?=str_pad(_,30*$argv[1]?:60);

```

prints an underscore, fills up with spaces

fancier, but longer (38 bytes):

```
<?=date(str_pad(r,3*$argv[1]?:6,MYr));

```

gives (`"rMY"` repeated `N` times) as argument to `date()`, which returns an RFC 2822 formatted date (e.g. `Thu, 26 Jan 2017 23:32:31 -0800`, length=31) followed by 3 letters of the month name and the 4 digit year - repeated `N` times. `<?=` prints the result.

# Answer
> 1 votes
# SmileBASIC, ~~24~~ 18-25= -7 bytes

```
N=2INPUT N?@A*N*9;

```

In SmileBASIC, labels (`@LABEL`) are treated as string literals in expressions, so you can make a 2 or more character long string without any quotes. Then it just has to print `@A` `N*9` times to get the correct length.

Without bonus, ~~6~~ 4 bytes

```
?1E7

```

There is a line break after the output, but technically no *character* is printed to the screen (it is different than if you just printed `CHR$(10)`)

# Answer
> 1 votes
# Pushy, 2 bytes

```
H#

```

**Try it online!** \- this prints `100` followed by a trailing newline, 4 bytes of output.

```
H  \ Push 100 to the stack
 # \ Print with a trailing newline

```

# Answer
> 1 votes
## Haskell, 25-25 = 0 bytes

```
f n=putStr$[1..25*n]>>"*"

```

prints n\*25 Asterisks

# Answer
> 1 votes
# PHP, 45 bytes

```
<?php print number_format(pow(10,66))."a"; ?>

```

output:

```
1,000,000,000,000,000,132,394,543,446,603,018,655,781,305,157,705,474,440,625,207,115,776a

```

---

```
<?php              //PHP start tag
print              //Prints what's ahead
number_format(arg) //format what's inside the parentheses as a number, with separators. (Used as escape function for having scientific notation result
pow(base,exp)      //Gets the value of the `base` raised to the power of `exp`
.                  //Concatenation operator
"a"                //String of "a"
?>                 //End tag for PHP

```

# Answer
> 1 votes
# Windows Batch, ~~148 144 73~~ 30 bytes

```
@echo %OS%%OS%%OS%%OS%%OS%%OS%

```

The `%OS%` system variable should be `Windows_NT` on most Windows NT systems.

6 of this `%OS%`(i.e. `Windows_NT`) is exactly 60 character, which is `codeLength * 2`.

# Answer
> 1 votes
# Japt, 1byte

My previous solution-with-bonus was invalid as I missed the requirement that input should default to `2`. This is a stop-gap until I have a few minutes to come up with something better.

```
A

```

Output: `10`

Try it online

`B-G` would also work, outputting `11-16` respectively, as would `H` (32), `I` (64) & `J` (-1).

*Slightly* less trivial solutions include  (1000) and `8³²` (262144), among many others.

# Answer
> 1 votes
# Python 3, ~~26~~ 25 Bytes

```
lambda n=2:print(n*26*'-')

```

Improved thanks to @JoKing

# Answer
> 1 votes
# Forth (gforth), 36 - 25 = 11 bytes

```
: x depth 0= if 2 then 36 * spaces ;

```

How it works:

Checks if no value is on the stack (`depth 0=`). If that is the case, push 2. Then just print n * 36 spaces.

# Forth (gforth), 2 bytes

```
.S

```

Only works if the stack is empty. Prints `<0>` (`<`, `0`, `>` and space)

# Answer
> 1 votes
# Braingolf, 1 byte

Prints 0 and a newline.

```
l

```

Try it online!

## Explanation

```
l

l      push length of the stack to the stack
       implicit output
       implicit newline printed at end of program

```

# Answer
> 1 votes
## \>\<\>, 15 + 2 (-v flag) - 25 = -8 bytes

```
2{f*:?!;0n1-30.

```

**Explanation:**

`2{` puts 2 at the bottom of the stack. If no input was provided, this means it is at the top. Otherwise, the provided input will be at the top.

`f*` multiplies the input by 15 (the length of the program)

We then go into a loop: `:?!;0n1-30.`

`:?!;` ends the program if the counter is 0.

Otherwise, `0n` prints 0, `1-` decrements the counter, and then `30.` goes back to the start of the loop.

# Answer
> 1 votes
# 05AB1E, -23 bytes

Try it online!

# Answer
> 1 votes
# Java 8, ~~16~~ 15 bytes

Golfed a byte by using a `for` loop instead of a `while` loop. (back to where I was before :P)

```
u->{for(int x=0;++x<40*u;)out.print(1);}

```

Using a static import to reduce the code by 7 bytes, this prints out `1` 40u times, where u is the integer taken from input. Since the program code is 40 bytes long and I incorporated the bonus, that leads me with 40 - 25 = 15 bytes.

Try it online!

# Answer
> 1 votes
# Ly, 17 - 25 = -8 bytes

```
"9>n[<&s&ol>1-]<;

```

Try it online!

A simple quine variant. Outputs `9>n[<&s&ol>1-]<;` *input* times. (there's a tab at the end)

## 3 bytes, no bonus

```
"&|

```

Outputs:

```
38 124

```

Try it online!

# Answer
> 1 votes
# TI-BASIC, -20 bytes

```
10^(5Ans-1

```

As Julian Lachniet mentioned in a comment on his answer, TI-BASIC does not accept empty input, so I guess this is TECHNICALLY 5 bytes.

Note that `10^(` is only one byte, as is `Ans`.

All this does is print a power of ten with `5Ans` digits.

# Answer
> 1 votes
# Pyke, 1 byte

```
T

```

Try it here!

Outputs `10`

# Answer
> 1 votes
# Pyke, 5 bytes -25 = -20

```
2|}hV

```

Try it here!

# Answer
> 1 votes
# Pyke, 3 bytes -25 = -22

```
2|S

```

Try it here!

```
2|  -  input or 2
2|S - range(1, ^)

```

# Answer
> 1 votes
# BASH + coreutils, 22 (-25) = -3 bytes

```
printf %$[${1:-2}*22]d

```

Pass repeat count as 1st argument. Omit argument to default to 2 repeats.

# Answer
> 1 votes
# Scala, 35 bytes

```
object X extends App{print("X"*70)}

```

Try it online!

# Answer
> 1 votes
# Fission, ~~7~~ 6 bytes

```
'#ORR"

```

This is a variation on a standard Fission quine. With two `R`'s it creates two atoms and reads through the program twice.

Outputs `''##OORRRR##`

Try it online!

-1 byte thanks to Jo King

# Answer
> 1 votes
# Befunge-98, 12 - 25 = -13 bytes

```
j& 6*1-k.@>2

```

Try it online!

Prints the correct amount of `0`s, each with a trailing space.

### How It Works:

```
j  No effect
 & Gets input. If no input, reflect
         >2 If it reflected put two 2s on the stack
j  Use one of the 2s to jump past the &
  6*1- Multiply by 6 (length/2) and subtract 1 because it prints an extra 0 later
      k.@ Print that many 0s and end the program

```

# Answer
> 1 votes
# C (gcc), ~~35 - 25 = 10~~ 34 - 25 = 9 bytes

-1 byte thanks to PrincePolka

Input is in the form of number of command-line arguments. No arguments counts as no input.

```
main(i){printf("%*d",34*--i?:68);}

```

Try it online!

# Answer
> 1 votes
# Attache, 11 bytes

```
10^20|Print

```

Try it online!

# Attache (bonus), 36 - 25 = 11 bytes

```
(Safely[ReadInt][]or 2)*36*$x|Output

```

Try it online!

---

Uh. Both come out to be the same byte count. So there's that.

# Answer
> 1 votes
# Rebol, 24 bytes

```
copy/part mold system 48

```

Prints the first 48 characters of the system object.

Also works with the Red language

# Answer
> 1 votes
# Wolfram Language (Mathematica), 17 bytes - 25 = -8

```
Echo[10^(17#-5)]&

```

Try it online!

Assuming giving a function is OK. Prints `>> 1`, then `(17 * input - 5)` `0`s, then a trailing new line, thus making the output `17 * input` bytes long.

# Answer
> 1 votes
# Hummus, 20 bytes (non-competitive)

```
().(rep('xx',20)).()

```

### Explanation:

```
().(rep('xx',20)).()   //Empty anonymous function

().                   //Empty parameter declaration
   (rep('xx',20))     //Repeat 'xx' 20 times
                 .()  //Empty value declaration

```

In contrast, a non-empty, anonymous function would look like this:

```
(x).(x*x).(2)

(x).          //Defines x as parameter
    (x*x)     //Defines the output to be x*x or x²
         .(2) //Defines the input of the anonymous function to be 2 (hence the output is 4)

```

### Alternative, 2 bytes:

```
!0

```

This works as well and outputs `true` but since this was posted multiple times already, I found it to be quite a boring solution.

# Answer
> 1 votes
# Slashalash, 15 bytes

```
/o/ttttt/oooooo

```

Try it online!

# Answer
> 1 votes
# Z80Golf, 14 bytes - 25 bytes of bonus = 11 anti-matter bytes (-11 classic bytes)

```
00000000: 3e02 cd03 8006 0eff 10fd 3d20 f876       >.........= .v

```

Try it online!

Takes input as a byte value.

```
    ld a, 2
    call $8003
outer:
    ld b, 14
inner:
    rst $38
    djnz inner
    dec a
    jr nz, outer
    halt

```

# Answer
> 1 votes
# Come Here, 39 bytes

```
CALL"9999999999999"iTELLi i i i i iNEXT

```

# Answer
> 1 votes
# 8088 machine code, IBM PC DOS, 35 bytes

Unassembled listing:

```
        _LOOP:
AC          LODSB               ; load byte [SI] into AL, increment SI
8A F0       MOV  DH, AL         ; save original byte in DH
B9 0204     MOV  CX, 0204H      ; set up nibble counter and shift count
D2 C0       ROL  AL, CL         ; reverse nibbles (display high order first)
        _NIB:
24 0F       AND  AL, 0FH        ; mask low nibble
3C 0A       CMP  AL, 0AH        ; is < 10?
72 02       JC   _ASC           ; if so, is a numeric digit
04 07       ADD  AL, 07H        ; otherwise adjust for A-F hex ASCII
        _ASC:
04 30       ADD  AL, '0'        ; ASCII convert
B4 0E       MOV  AH, 0EH        ; BIOS output char function
CD 10       INT  10H            ; display char
8A C6       MOV  AL, DH         ; restore original nibble to AL
FE CD       DEC  CH             ; decrement nibble counter
75 EC       JNZ  _NIB           ; if > 0, repeat
81 FE 0123  CMP  SI, OFFSET _EF ; is SI < last byte?
7C DE       JL   _LOOP          ; if so, keep looping
C3          RET                 ; return to DOS
        _EF EQU $               ; get program size

```

This is a complete IBM PC DOS executable that displays itself as ASCII hex, so will always output as twice the program size.

**Output**

Download and test SELF.COM!

# Answer
> 1 votes
# Excel Formula, 23 - 25 = -2 bytes

```
=REPT("A",MAX(A1,2)*23)

```

However, this doesn't work for `A1 (n) = 1`(!)

## Version supporting N=1, 28 - 25 = 3 bytes

```
=REPT("A",(A1=0)*56+(A1*28))

```

# Answer
> 1 votes
# TinCan, 122 bytes

```
# 62367, A, &                          #
# -256, A, -1                          #
# 0, A, 1                              #

```

Outputs 244 'a's.

```
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

```

Try it online!

**Explanation**:

Lines have a minimum length of 40 characters in TinCan, and there is only one instruction, so 40 bytes would be the shortest feasible TinCan program other than an empty file.

TinCan's interpreter is written in PHP and uses the PHP `chr` function to output the character value of each number on the stack when the program ends. This also works for values outside the range of 0 to 255, using bitwise and with 255 to get the result.

For this program, I multiplied the length of the program (122 bytes) times two, minus one for the positive case, times 256 and added (256 - 97), 97 being the ASCII value of 'a'. This gives 62367.

The loop then generates a sequence of values starting at -62367 and counting upwards by 256 each iteration. Each value in sequence when processed by `chr` produces another 'a'. When the variable A becomes positive, the program exits and prints 244 'a's.

With the fixed line length, golfing this down would require removing one whole instruction, which I don't believe is possible. But I'd be happy to be proven wrong!

# Answer
> 1 votes
## Keg, ~~6~~ 2 bytes

```
(|A,)

```

It loops 12 times printing 12 A's to the console, which is double the size of the program. There is a control character (`0x0C`) between the `(` and `|`, which makes this 6 bytes.

Another shorter version:

```
A

```

This prints A plus a newline, which contains 2 characters.

Worth a mention(3 bytes):

```
5/

```

TIO

# Answer
> 1 votes
# Aheui (esotope), 87 bytes

```
삭밦밢따밥다사바바바바바바우a
샥ㅇ뱟ㅇ탸ㅇ뺘소처희ㅇㅇ아멍a

```

Try it online!

output is 174 bytes of `0`. Aheui program is written in Korean, so one character is 3 bytes, and question said `measured in byte`, so 174. Trailing `a` is for making program to proper bytes.

# How does this work?

`삭밦밢따밥다` : to stack , then put 58. (28 Korean characters. Aheui cannot put 1 to stack, so I'll subtract 2 instead of 1 when counting loop.)

`사바바바바바바우` : to stack (`Nothing`), put 6 zeros, than move downside.

`아멍` : print from current stack till nothing left. if nothing left, move to start of the line.

`샥ㅇ뱟ㅇ탸ㅇ뺘소처희` : to stack , subtract 2, check if zero, halt if zero, to stack (`Nothing`) and move to `사바바바바바바우` again.

`a` : At first, I thought this code would work just fine, but something went wrong. I used online character counter, and I got 29, so I made code with that. But code was 85 bytes and output was 174 bytes. I found the reason of this error : newline character. So I added 2 bytes to my code, than everything works fine. Aheui don't evaluate non-Korean characters, so `a` is just blank.

# Answer
> 1 votes
# Befunge-93, 25 - 25 = 0 bytes

```
&+:0\`3*+::%+"CG"*:*:.:*.

```

Try it online!

Uses no control flow instructions! This code is implicitly looped `n` amount of times.

To get the `n` as input once and not have it interfere with subsequent iterations, we use Befunge-93's feature of returning -1 for input if the input stream is empty. At the start of each iteration, the top of the stack is the loop counter. It starts off at 0 (the default value on the stack). `&+` gets a value from input and adds it to the counter. Conveniently, this sets the counter to the received input on the first iteration, and subtracts 1 on every subsequent iteration, creating a `for (i = input();; i--)` loop. `:0\`3*+` computes `(counter < 0) * 3` and adds it to the counter. This has the effect of adding 3 if the counter is negative (which happens if there was no input and we want to set n to -1+3=2), and otherwise adding 0 (if the input was positive or this is not the first iteration).

`::%+` simply calculates `counter % counter` and discards the result, so as to halt when the counter reaches 0.

At the end, we output two large numbers by repeatedly squaring the product of two ASCII characters. Note that after each outputted number there is a trailing space.

# Answer
> 1 votes
# Underload, 10 bytes

```
()aaaaa:*S

```

I'm pretty sure this is unimprovable, since I made a python script to test all possible combinations of instructions. However, I did only include the instructions `a:*S` in it, and made it so it always starts with `()`, so there could be a crazy solution involving `^` or `~`. Also, for those curious, there are actually 5 other valid 10 byte solutions:

```
()aaaaa:SS
()aa:a*:*S
()aa:a*:SS
()aa:*a:*S
()aa:*a:SS

```

Try it Online

# Answer
> 1 votes
# naz, 2 bytes

```
4o

```

Outputs `0000`.

**Explanation**

The default value of the register is 0; if the register's value is between 0 and 9 inclusive, use of the `o` instruction will output that number as an ASCII character.

# Answer
> 1 votes
# TlanG 3 bytes

`.*6`

Out: `......`

Explainations in the readme on the TlanG github.

# Answer
> 1 votes
# Python - (32 bytes - 25) = 7

```
k="1"*32
n=int(input())
print(k*n)

```

So close :(. This code takes a string k (which is 32 chars long, same as this code), takes n as an input, and prints k repeated n times.

## Python - 16 bytes (no bonus)

```
k="1"*32
print(k)

```

Same as above, but without taking input, and thus, the code is only 16 bytes long.

# Answer
> 1 votes
# BRASCA, 2 bytes

```
CK

```

Try it!

## Explanation

```
C   - Output implicit output as number
 K  - Push 1000

```

# Answer
> 1 votes
# Pxem, 30 bytes (Filename) + 0 bytes (Content) - 25 bytes (bonus) = 5 bytes, requires nonprintable character, does not deal with default.

* Filename (nonprintable is escaped): `._.c.w.tXXX.eX.eX.e.p.m\001.-.c.a`
* Content is empty.

Try it online! (with pxem.posixism)

## With comments

```
XX.z
# read integer and push it (pxem.posixism errors when not given)
.a._XX.z
# dup; while pop!=0; do
.a.c.wXX.z
  # heap=pop
  .a.tXX.z
  # .e command actually stands for calling content as
  # subroutine BUT content is empty so it stands for
  # duplicating entire stack
  # also non-command substrings stand for literals
  # so stack would have (3*2+1)*2+1*2=30 X's
  .aXXX.eX.eX.eXX.z
  # pop all to output each of them
  .a.pXX.z
  # push heap; push 1; push abs(pop-pop); dup
  .a.m\001.-.cXX.z
# done
.a.a

```

---

# Pxem, 12 bytes (Filename) + 0 bytes (Content) = 12 bytes.

* Filename: `XX.eXX.e.e.p`
* Content is empty.

It outputs 24 X's without trailing LF.

Try it online!

## How it works

```
XX.z
# push two X's
.aXXXX.z
# call content (as subroutine), pushing final result
## NOTE if original stack was 1,2,3 from top,
## the subroutine stack is also intialized with 1,2,3
## Then when returning from subroutine with final result of stack 4,5,6
## then original stack would be 4,5,6,1,2,3
## Since content is empty, it stands for duplicatinf entire stack
.a.eXX.z
## now X,X,X,X
# push two X's
.aXXXX.z
## now four X's
# duplicate entire stack twice
.a.e.eXX.z
# finally pop all to output each of them
.a.p

```

# Answer
> 1 votes
# Julia, 6 bytes

```
@info%

```

outputs in stderr (12 bytes including the trailing newline)

```
[ Info: rem

```

Explanation: `%` is the `rem` function (remainder)

Try it online!

# Answer
> 1 votes
# Excel, 23 - 25 = -2 bytes

```
=REPT(0,IF(A1,A1,2)*23)

```

Saves 2 bytes by repeating a number instead of a character.

## Excel, 4 bytes

```
=8^8

```

8^8 is an 8 digit number

# Answer
> 1 votes
# Subleq, ~~12~~ 11 bytes (Assuming an 8 bit word)

```
2 -1 88 10 11 -1 8 8 0 1 22

```

Subleq emulator

## Explanation

```
0:  2 -1 88 ' Output 2: "X"
3:  9 10 -1 ' 10: = 10: - 9:, if 10: <=0 exit
6:  8  8  0 ' 8: = 0, goto 0
9:  1 22    ' data

```

## 64 bit word, ~~96~~ 88 bytes

```
2 -1 88 9 10 -1 8 8 0 1 176

```

# Answer
> 1 votes
# Python 3, 12 bytes

```
print(9<<75)

```

Try it online!

# Answer
> 1 votes
# Python 3, (30-25)=5

```
def f(n=2):print((n*30-1)*"A")

```

The output includes a newline at the end which is accounted by subtracting 1 from the product of n and 30, the code length.

# Answer
> 1 votes
# APL, 2 bytes

```
!7

```

The program prints the number 5040 (factorial of 7).

# APL, 8 bytes (Bonus)

```
'*'⍴⍨8×⎕

```

The program prints asterisks (8 times more than n).

# Answer
> 1 votes
# Swift, 27 bytes

```
for i in 87...103{print(i)}

```

Prints the numbers 87 through 103 inclusive, each number followed by a newline, for a total of 54 bytes.

# Answer
> 0 votes
# Python 3.4, 14 13 bytes

```
print("a"*26)

```

# Answer
> 0 votes
## Pyth, 6 bytes

```
*4"aaa

```

Explanation:

```
*4"aaa
-------+------------
  "aaa | Print "aaa"
*4     | 4 times

```

---

## Pyth, -7 bytes

```
*.xvw2*2"aaaaaaaaa

```

Plain and simple.

```
*.xvw2*2"aaaaaaaaa
-------------------+----------------------
      *2"aaaaaaaaa | Print twice the "a"s
*                  | times
 .xvw              | try to evaluate input
     2             | otherwise, 2

```

# Answer
> 0 votes
# Go, 59 Bytes

```
package main
import"fmt"
func main(){fmt.Printf("%118d",0)}

```

Prints `0` formatted with padding

### Here is a version with argument (145-25 Bytes):

```
package main
import("os"
"fmt")
func main(){i:=2
if len(os.Args)>1{fmt.Sscanf(os.Args[1],"%d",&i)}
fmt.Printf("%"+fmt.Sprintf("%d",i*145)+"d",i)}

```

# Answer
> 0 votes
# C#, ~~63~~ 62 bytes

```
class P{static void Main(){System.Console.Write($"{1,124}");}}

```

Will print 123 spaces followed by `1`.

# Answer
> 0 votes
# Ruby, 22 bytes - 25 bytes = -3 bytes

```
c=->n=2{p ?d*21*n}
c[]

```

The reason the value shows up as 21 bytes in the code itself is that the quotation marks are printed, effectively reducing the number of bytes I need to print by 2 (left paren and right paren).

# Answer
> 0 votes
# \>\<\>, (15 + 3) - 25 = -7

```
2}f*:?!;1n1-30.

```

Like torcado's answer, but a one-liner. Takes input via the `-v` flag, e.g.

```
py -3 fish.py double.fish -v 5

```

and outputs `15*<input>` ones.

# \>\<\>, 5 bytes

```
"nn#;

```

Here's a version without any bonuses. Outputs `5935110110`.

# Answer
> 0 votes
# Ruby, 5 bytes

```
p 1e6

```

Outputs `1000000.0` and a newline, which is 10 bytes in summary

# Answer
> 0 votes
# GolfScript, 11 - 25 = -14 bytes

```
~2]0=11*(n*

```

Given *n*, outputs *n* times as many newlines as the length of the code in bytes (= 11). Given no (i.e. empty) input, outputs 22 newlines.

The implementation is very straightforward:

* `~` evals the input,
* `2]0=` replaces an empty input with 2,
* `11*` multiplies the input number with 11 (the length of the program),
* `(` decrements the number by 1 (to account for the automatically inserted trailing newline), and
* `n*` repeats a newline the given number of times.

# Answer
> 0 votes
# Brainfuck, 25 bytes

Prints 50 characters, most of which are control characters.

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

```

# Answer
> 0 votes
# Powershell, -10

```
"a"*15*$args[0]

```

# Powershell, 2

This answer without the bonus is probably golfier though

```
$?

```

Outputs;

```
True

```

# Answer
> 0 votes
# Sed, 40 - bonus = 15

```
s/^$/11/
s/.*/&&&&&/
s//&&&&&&&&/
s/.//

```

There's no final newline. Input is in unary, as you'd expect for sed.

We begin by defaulting the input to two. Then we multiply it by 5 and then by 8 for a total multiplication of 40. Our output includes a newline, so we must subtract one before it's printed.

# Test results

```
$ for i in '' 1 11 111 1111; do sed -e 's/^$/11/;s/.*/&&&&&/;s//&&&&&&&&/;s/.//' <<<"$i" | wc -c; done
80
40
80
120
160

```

# Answer
> 0 votes
# Python 3, 30 - 25 = 5

```
print(int(input()or 2)*30*"X")

```

It expects input on standard input, an empty input is treated the same as 2.

If we can use the REPL, rather than running as a script, you can remove the `print` call, to save 7 bytes and bring our score down to -2:

```
>>> int(input()or 2)*21*"X"
1
'XXXXXXXXXXXXXXXXXXXXX'

```

(Note that we multiply by 21, rather than 23 because of the quotation marks that appear in the string's `repr`.)

A Python 2 version of the same code can be written for three extra bytes (we need to add `raw_` to the `input`, but can replace the pair of parentheses around `print`'s arguments with a single space):

```
print int(raw_input()or 2)*33*"X"

```

# Answer
> 0 votes
# Processing, ~~31~~ 29 bytes

```
for(int i=1;i++<34;)print(i);

```

I stumbled upon this submission from long ago and decided that it can be golfed more.

Outputs all the integers from 2 to 34 in a single line (58 bytes).

```
2345678910111213141516171819202122232425262728293031323334

```

# Answer
> 0 votes
# C#, 77 bytes

102 bytes - 25 bonus

```
class c{static void Main(string[]a)=>System.Console.Write(new string('x',102*int.Parse(a[0]??"2")));}

```

Creates a string of the specified length, defaulting to 2.

# Answer
> 0 votes
# Hassium, 55 Bytes

```
use Math;func main(){ for(x=0;x<7;x++)print(Math.pi); }

```

Output:

```
3.141592653589793.141592653589793.141592653589793.141592653589793.141592653589793.141592653589793.14159265358979

```

Run and see online here

# Answer
> 0 votes
# Simplex v.0.5, 22 - 25 = -3 bytes

```
i?[{u(' R)22vM}ug#]2O3
i                      ~~ take input as number
 ?[               ]    ~~ do inside if byte is nonzero
   {          }        ~~ loop inside until zero byte met
    u       v          ~~ up/down strip traversal
     (   )22           ~~ repeats the inner 22 times
      '@R              ~~ pushes an @ and goes right
               ug      ~~ goes to the string strip and clears the strip
                 #     ~~ cease!
                   2   ~~ sets the current byte to two (default N)
                    O3 ~~ goes to the third byte in the source code

```

Essentially, for each pass of an integer `N` (input), the string `@@@@@@@@@@@@@@@@@@@@@@` is printed once, i.e., `N*"@@@@@@@@@@@@@@@@@@@@@@"`. Since the `(...)` is a preproccesed command, variable inputs cannot be handled. If they could, then I might shorten the code to something like `('@R)ig` whilst handling the special cases. Wouldn't that be something?

# Answer
> 0 votes
# Mouse-2002, 32 - 25 = 7 bytes

A quine is not possible in Mouse, unfortunately, else I would have gone that way.

```
?&DUP 0=[1]32*y:(y.x.>^1!x.1+x:)

```

Explained:

```
? &DUP        ~ get some input; dup it
0 =           ~ if 0
[             ~ then
  2           ~ push 2 instead
]             ~ fi
32 * y:       ~ push 32* and assign into y
(             ~ while(true)
  y. x. > ^   ~ cmp
  1 !         ~ print a 1
  x. 1 + x:   ~ increment x
)             ~ endwhile
$             ~ (implicit) end prog

```

# Answer
> 0 votes
*Note: This answer did not work when the question was asked, so it is not a competitive solution.*

# Pyth, 6 - 25 = -19 bytes

```
mb.xE2

```

Demonstration

First, we attempt to take STDIN input and evaluate it. It this throws an error, we use 2 instead. Then, we make a list of that many newline characters. Newline characters take 4 characters to represent (`'\n'`) and there are 2 bytes of list overhead (`[]` or `,`) per element, so it comes out to exactly 6 times longer than the above number.

# Answer
> 0 votes
# Perl, 11 bytes

```
print"J"x22

```

Using the lovely `x` operator, prints 22 Js. I may be able to find a shorter answer.

# Answer
> 0 votes
# Python 2, ~~11~~ ~~-1~~ ~~-6~~ -11 bytes

```
'M'*input()*14

```

Prints 14 * input `M`s. Requires a REPL environment.

There may be a way to make it shorter, but at this point I doubt it.

Changes

* Saved 5 bytes by not using `int()`.
* Saves 5 more bytes thanks to @cat and using a REPL environment.

# Answer
> 0 votes
# MATLAB, 5 bytes

```
a=123

```

Which displays

```
a =
   123

```

By my count that is 10 bytes of output if you include the new-line as 1 byte.

# Answer
> 0 votes
# Binary-Encoded Golfical, 13+1 (`-x` flag)=14 bytes

Noncompeting, language postdates the question.

Hexdump:

```
00 90 01 00 09 17 17 17 17 17 17 17 1D

```

This encoding can be converted back into the original graphical representation using the included Encoder utility, or run directly by adding the `x` flag.

Original image:

Magnified 64x, with color labels:

Explanation: Stores 9, prints it seven times (with a newline each time), then turns around and prints it seven more times.

# Answer
> 0 votes
# Mumps, 31 - 25 = 6 bytes

My submission was *supposed* to be unique (but I hadn't checked all of the answers yet) in that the basic "Assume 2x" code and the bonus-enabled code would work out to be the same length!

Basic code:

```
F J=1:1:28 W 1

```

Which is 14 bytes.

Here's the initial bonus-enabled code that takes input, anything that equates to '0' including any non-numeric input assumes 2, then outputs the correct number of output characters. This version is 39 bytes not including the bonus.

```
R I S:+I=0 I=2 F I=1:1:I F J=1:1:39 W 1

```

Calculating the bonus 39-25=14 bytes as well!

Too bad (for my narrative) that I looked it over and came up with a shorter version of the bonus code:

```
R I S:+I=0 I=2 F I=1:1:I*31 W 1

```

This is only 31 bytes long, so 31-25=6 bytes total, and the header reflects this.

# Answer
> 0 votes
## Mathematica, 9 bytes

```
Echo[16!]

```

If I am correct, this should output:

```
>> 20922789888000

```

with a trailing newline.

# Answer
> 0 votes
# Gogh, 3 bytes

```
6GJ

```

You can run it like this:

```
./gogh o '6GJ'

```

---

Or without implicit output (4 bytes):

```
8GJ¡

```

You can run this using:

```
./gogh "" "8GJ¡"

```

> The inverted exclamation point outputs the TOS.

---

### Explanation

```
6    “ Push the integer literal 6 ”
G    “ Push a range (0, TOS]      ”
J    “ Join the TOS               ”

```

# Answer
> 0 votes
# Python 2, 11 bytes

```
print`0`*21

```

This outputs 21 zeroes and a newline.

```
000000000000000000000

```

---

From the Python 2 documentation:

> A `'\n'` character is written at the end, unless the print statement ends with a comma.

# Answer
> 0 votes
# Cubix, 15 bytes

Non competing due to language age.

While having some fun with @ETHproductions language, I thought this would be interesting. It turned out a little longer than I thought it would and I'm sure it can be improved.

```
(.O.NU.\!@O$..u

```

This maps to a cube with edge length 2

```
    ( .
    O .
N U . \ ! @ O $
. . u . . . . .
    . .
    . .

```

Outputs

```
109998887776665554443332221110

```

`N` push 10 to the stack
`U` turn left moved forward turn left
`O` output number of TOS
`$` skip a no op
`(` decrement TOS, followed by a number of no ops
`u` turn right, move forward and turn right, more no ops
`O` output number of TOS, more no ops
`\` reflect to the east
`!` jump end program `@` if truthy
`O` output number of TOS
`$` skip `N` at start of program

# Answer
> 0 votes
# Lua, 20 bytes (bonus: 11 bytes)

Program:

```
print(("a"):rep(40))

```

Output:

```
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

```

(Change `40` to `39` if newline is counted)

**Bonus**:

```
print(("a"):rep(36*(io.read()or 2)))

```

(If newline is counted, use `print(("a"):rep(38*(io.read()or 2)-1))` \[**13 bytes**\] instead.)

# Answer
> 0 votes
# Underload, 12 bytes

```
(\/)a:*::**S

```

Outputs

```
(\/)(\/)(\/)(\/)(\/)(\/)

```

Try It Online

Explanation

```
(\/)            # push \/ to the stack        : \/
    a           # add brackets to TOS         : (\/)
     :*         # duplicate the TOS and join. : (\/)(\/)
       ::       # duplicate a couple of times : (\/)(\/)<>(\/)(\/)<>(\/)(\/)
         **     # join stack items            : (\/)(\/)(\/)(\/)(\/)(\/)
           S    # output TOS

```

# Answer
> 0 votes
# Tellurium, 10 bytes

```
µa~Åm16.

```

Outputs `a` 16 times. Simple enough.

More detailed explanation:

```
µ         Begins reading a string
a
~         Stops reading a string and stores it in the selected cell
Å         Command set 2
m         Print the cell's value n times
16
.

```

There might be a shorter version using `Åw` but I'm too tired to do that :P

# Answer
> 0 votes
# Java, 85

```
class A{public static void main(String[]s){for(A a:new A[170])System.out.println();}}

```

# Answer
> 0 votes
## Perl5, 11 bytes

x is string repetition operator

```
print 1x22

```

# Answer
> 0 votes
# BASH, 19 bytes

**54 bytes -25 bonus.** Using the variable input for x repeats:

```
#!/bin/sh
a=$1;for i in `seq 1 ${a:=2}`;do cat $0;done

```

similar but more readable:

```
#!/bin/sh
a=$1
for i in `seq 1 ${a:=2}`; do
 cat $0
done

```

**19 bytes** for a simple sh script.

```
#!/bin/sh
cat $0 $0

```

# Answer
> 0 votes
# Turtlèd, 8 bytes

```
15:[*,l]

```

explanation:

```
[implicit] initial cell is *, initial char var is *
15       put 15 in register
  :      move right by as many cells as the amount in register
   [*  ] while cell not *
     ,l  write char var, move left 1 cell

```

# Answer
> 0 votes
# Nim, 27 bytes

```
echo getStackTrace()[0..51]

```

Prints the first 53 bytes of the following, plus a trailing newline:

```
Traceback (most recent call last)
<filename>.nim(1)       <filename>

```

Note that despite having the filename in the output, this answer's validity is not dependant on the length of the filename. For example, saved in `x.nim`, this is output:

```
Traceback (most recent call last)
x.nim(1)

```

There are nine trailing spaces there. Conversely, when saved in `areallylongfilename.nim`, this is output:

```
Traceback (most recent call last)
areallylongfilena

```

Newlines are also output in each example. Example usage:

```
$ nim c length.nim
$ ./length | wc -c
54

```

# Answer
> 0 votes
# Scala, 52 - 25 = 27 bytes

```
object A extends App{println("#"*(args(0).toInt*52)}

```

Simply prints the string `#` repeated `(arg * lengthOfCode)` times.

# Answer
> 0 votes
# s-lang, 30 bytes

```
t[][sssssssssssssss]t[s][ssss]

```

Link

# Answer
> 0 votes
## QBIC, ~~16 - 25 = -9~~ ~~36 - 25 = 11~~  32 - 25 = 7 bytes

```
:~a|q=a][q*4|?@ABCDEFGHIJKLMNOP

```

Explanation:

```
:           Get a cmd line paramenter 'a'
~a|         IF a <> 0 THEN
q=a]        set q to the value of a
            If we don't hit that IF-branch, q will be 1 by default in QBIC
[q*4|       And execute the following 4 times for each 'a/q'
?@QBICFTW!IJKLMNOP  Print this 16-byte string literal

```

The code is 16 bytes boilerplate and 16 bytes repeated output. Printing that output four times = 16x4 = 2x32 = double my source code length. And it accepts an input that does this N times.

# Answer
> 0 votes
# Python 3, 20 bytes

```
print('#'*40,end='')

```

The optional argument `end` removes the newline. This is necessary due to universal newline support in Python which generates a `\n` on Linux and `\r\n` on Windows.

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

```
:Input N
:".
:While N23>length(Ans
:Ans+".
:End
:Ans

```

# Answer
> 0 votes
# Juggle, Non-competing, 8 bytes

Golfed: `1<4=a[p]`

Ungolfed

```
1<4    <--- literal for 1 bit-shifted left 4 indices, equal to 16
=a     <--- Set a equal to 16
[      <--- Iterate until a == 0
p      <--- Print a new line
]      <--- Decrement a by 1

```

This code effectively just outputs 16 `\n` characters, so there's not much to it.

# Answer
> 0 votes
# Kitanai, 35 bytes

```
$0[70]#?(neq@0)([sub@1]print"!"&1)%

```

Just a simple loop to print 70 times the character "!".

# Answer
> 0 votes
## PKod \- 6 bytes

Code:
`=0+ni6`

Explanation:

```
=0 - Set variable as 0 (ascii code of 0 is 48, thus 48 is stored in the variable)
+n - Add 1 to variable (making it 49 on first iteration) and print ascii char code
i6 - 'i' kicks you back 2 blocks in code (to the '+' sign) until variable equals next char
which is '6'

```

Output:
`495051525354`
(note how it prints ascii char code from 1 to 6 (49 50 51 52 53 54) but without spaces.)

# Answer
> 0 votes
# Java - 132 - 25 = 107 bytes

```
interface o{static void main(String[]a){int i=2,k=0;if(a.length>0)i=Integer.parseInt(a[0]);for(;k<132*i;k++)System.out.print('X');}}

```

Takes one number(Supposed to be a number, NumberFormatException otherwise) and converts it to an integer, if no input is present, it defaults to 2. Prints `X` characters.

Ungolfed version:

```
interface o {
    static void main(String[] a) {
        int i=2, k=0;
        if (a.length > 0)
            i = Integer.parseInt(a[0]);
        for (; k < 132 * i; k++)
            System.out.print('X');
    }
}

```

# Answer
> 0 votes
# ForceLang, 13 bytes

```
io.write 1e25

```

# Answer
> 0 votes
## Alice, 10 bytes - 25 = -15

```
2/
&oi@/a*

```

Try it online!

Prints a 0x02 byte and **10n-1** null bytes when given an argument **n**, and simply 20 null bytes when no argument is given.

### Explanation

```
2   Push 2 as the default input.
/   Reflect to SE. Switch to Ordinal.
i   Read all input as a string. Pushes "" if no input is given.
    Reflect off bottom boundary, move NE.
    Reflect off top boundary, move SE.
/   Reflect to E. Switch to Cardinal
a   Push 10, the length of the source code.
*   Multiply. The first argument this pops is 10. But two pop another integer
    argument, some implicit conversion needs to happen. If an input was given,
    that string is popped and converted to an integer, which will be used as
    the second argument. But if no input was given, the value "" contains no
    integers, so it's discarded and Alice pops the next value instead (the
    default value 2 we pushed earlier).
    IP wraps around to the first column.
&   Repeat the next command that many times.
o   Pop that many values and print them as bytes.
i   Try to read more input, irrelevant.
@   Terminate the program.

```

## Some alternatives

Without the bonus, we can do this in 4 bytes, printing 8 null bytes:

```
8&o@

```

Simple enough. There's a really fun and 6 byte solution with readable output though:

```
 /
O@n

```

This prints `Jabberwocky` with a trailing linefeed. The reason is that `n` is logical not, and the "canonical" truthy (non-empty) string used by Alice when applying this command to a falsy (empty) string is `"Jabberwocky"`. So...

```
/   Reflect to SE. Switch to Ordinal.
n   Logical NOT. Pops an implicit empty string from the stack and turns it into
    "Jabberwocky".
    Reflect off bottom right corner, move back NW.
/   Reflect to W. Switch to Cardinal.
    IP wraps around to the last column.
/   Reflect to NW. Switch to Ordinal.
    Reflect immediately off top boundary, move SW.
O   Print "Jabberwocky" with a trailing linefeed.
    Reflect off bottom left corner, move back NE.
/   Reflect to S. Switch to Cardinal.
@   Terminate the program.

```

Try it online!

# Answer
> 0 votes
# J, 2 bytes

```
!7

```

Prints 7 fatorial, or 5040.

If you include the trailing newline then use:

```
!6

```

Which would print 720.

# Answer
> 0 votes
# k, 2 bytes

This is one byte, but I don't like the answer because it doesn't feel "proper".

```
1

```

When run in oK as a file (as opposed to interactively) it prints out a newline after printing the `1`.

---

Another sort-of cheating answer:

```
11

```

If run in the closed-source k interpreter, it would output `11` followed by a newline and a space (and it would expect the next command).

---

```
$1

```

This would result in `,"1"` if trailing whitespace was not counted.

# Answer
> 0 votes
# Fourier \- Non-competing, 12 - 25 = -13 bytes

Fourier is newer than this challenge.

```
I*12(1ox^~x)

```

Works by multiplying the input by 12 (the length of the program) and outputting the number 1 that many times.

Try it online!

# Answer
> 0 votes
# Braingolf, (9 - 25) = -16 bytes

```
91+<9*1-^

```

Takes `n` input and outputs a `1` followed by `x` zeroes where `x = (n * 9) - 1`

# Braingolf, 5 bytes

```
91+9^

```

Outputs `1000000000` (10\**9)

# Answer
> 0 votes
# Powershell 4 Bytes

```
,1*8

```

This prints '1' 8 times in the console window.

# Answer
> 0 votes
# REXX 33 Bytes -25 = 8

```
say copies("x",max(2,"0"arg(1))*33)

```

# Answer
> 0 votes
# Pari/GP, 2 bytes

```
7!

```

Prints `5040` in the REPL.

# Answer
> 0 votes
# Charcoal, 1 byte

```
²

```

Try it online!

# Answer
> 0 votes
# Fourier, 12 - 25 = -13 bytes

***Non competing:*** *Fourier is newer than the challenge*

```
I*12(1oi^~i)

```

**Try it on FourIDE!**

Explanation pseudocode:

```
For i = 0 to (Input * 12)
    Print 1

```

# Answer
> 0 votes
## Check, 14 - 25 = -11 bytes (non-competing)

```
.>2\&"?"*>14*o

```

Explanation:

`.>2\&` puts 2 at the back of the stack. If there were no arguments passed, this means 2 is at the top of the stack. Otherwise, the passed input is on top of the stack. We then repeat the character `?` as many times as the stack number, and then repeat the result 14 times, and then output it.

# Answer
> 0 votes
# Python 2, 28 bytes

Quick and simple, also unimaginative.

This prints `1` 14 times, separated by spaces, and a newline at the end.

```
for i in range(14):print 1,

```

Try it online!

*Note: the newline in the code is required, otherwise it won't run.*

# Answer
> 0 votes
# Implicit, 1 byte

```
a

```

Pushes the ASCII character code for `a` (97). Implicit output. Try it online!

# Answer
> 0 votes
# Jq 1.5, ~~1~~ ~~-9~~ ~~-10~~ -1 bytes

```
range(inputs?//2)|23*"a"

```

Source is 24 bytes (-1 with bonus). Sample runs

Sample run with no input (defaults N=2)

```
$ jq -Mrn 'range(inputs?//2)|23*"a"' </dev/null
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa

```

Confirm character count with no input (defaults N=2)

```
$ jq -Mrn 'range(inputs?//2)|23*"a"' </dev/null | wc -c
      48

```

Sample run with N=4

```
$ jq -Mrn 'range(inputs?//2)|23*"a"' <<< "4" | wc -c
      96

```

Verify length of program

```
$ echo -n 'range(inputs?//2)|23*"a"' </dev/null | wc -c
      24

```

---

# Jq 1.5, 1 byte

```
1

```

Sample Run

```
$ jq -Mnr 1
1
$ jq -Mnr 1 | wc -c
       2
$ echo -n 1 | wc -c
       1

```

# Answer
> 0 votes
# RProgN 2, 8 - 25 = -17

```
2)i‘8*x*

```

Try it online!

## Explained

```
2)i‘8*x*    #
2           # Push two to the stack.
 )i‘        # Create a stack from the registry stack, inverse it, and pop the top value. If an argument is provided, it will use that, otherwise, it will use 2.
    8*      # Multiply it by 8 (The length of the code)
      x*    # Multiplied by the string "x".

```

# Answer
> 0 votes
# Brain-Flak, 30 bytes

```
([()()()()()]){((((({}))())))}

```

Try it online!

Prints three `0`s, four each of `-1` through to `-4` and two `-5`s, each separated by spaces.

# With bonus: 62 - 25 = 38 bytes

```
({{}[()()]}()()){({}<((()()()()()){}){({}(([()])))}>[()])}{}

```

Try it online!

Outputs n\*(20\*"-1 "+"0 "). There are two extra spaces to pad it out to 62 bytes.

### How It Works:

```
({{}[()()]}()()) Add a 2 to the stack if there is no input
{ Outer loop
  ({} Pop the outer loop counter
  <
  ((()()()()()){}) Add a 10 to the stack
  { Inner loop
    ({}(([()]))) Decrement the inner loop and add two "-1"s to the stack
  }
  > Discard the inner value
  [()]) Decrement the outer loop counter
}
{} Pop the excess 0

```

# Answer
> 0 votes
# JavaScript (Node.js), 22 - 25 = -3 bytes

```
(x=2)=>''.padEnd(22*x)

```

Try it online!

If we require an `alert`-type output, this can be managed in 29 bytes - 25 = 4 points:

```
(x=2)=>alert(''.padEnd(29*x))

```

Versions without bonus (7 bytes):

```
x=>1e13

```

And with output as alert (12 bytes):

```
alert({}+$4)

```

Or without special console variables (14 bytes):

```
alert({}+1e12)

```

# Answer
> 0 votes
# Japt `-P`, 3 - 25 = -22 bytes

```
õ@L

```

Try it online!

### How it works

```
Uõ@L

Uõ  Create range of [1..input] inclusive, and map...
@L  the function that returns the constant 100.

```

The `õ` generates `[1,0]` for no input (implicit zero) and `[1,...,n]` for positive integer input, which perfectly fits with the `default=2` requirement.

The `-P` flag prints the resulting array with no separator, so the output length is exactly 3 times the length of the array.

# Answer
> 0 votes
## F#, 46 bytes

```
let[<EntryPoint>]m a=
 printf"%A"[|10..31|]
 0

```

Try it online!

Prints out:

```
[|10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31|]

```

which is 92 bytes long.

# Answer
> 0 votes
# JavaScript REPL, 24-25 = -1 bytes

```
Array(24*prompt()||48)+0

```

JavaScript function, 20-25 = -5 bytes

```
(n=2)=>Array(20*n)+0
n=>Array(20*n||40)+0

```

Just how no one post this?

# Answer
> 0 votes
# Ruby, 18 Bytes

I am lazy to make the input thing. So take the \*2.

```
36.times{print"a"}

```

# Answer
> 0 votes
# Gol\>\<\>, 8 - 25 = -17 bytes

```
IE28*Rn;

```

Try it online!

Outputs all `0`s.

### Explanation:

```
I        Get inputted number
 E2      Push 2 if no input
   8*    Multiply by 8  (length of code)
     Rn  Print 0 that many times
       ; Halt

```

## Without bonus, 4 bytes

```
"D;

```

Try it online!

Outputs `[68 59]`. Note that both input and output have a trailing newline.

# Answer
> 0 votes
Python3 Shell version

```
'2'*10

```

outputs:'2222222222'

# Answer
> 0 votes
# Ahead, 4 bytes

```
8kO@

```

Prints `00000000`.

```
8k    8 times...
  O   ..pop and print number
   @  end

```

Try it online!

# Answer
> 0 votes
# Ahead, 6 - 25 = -19 bytes

Here it is with the bonus.

```
I6*kO@

I       Read number from stdin
 6*      multiply by 6
   k    I*6 times...
    O   ...pop and print number
     @  end

```

Try it online!

# Answer
> 0 votes
# Java, 234 - 25 = 209 bytes

```
import java.io.*;interface A{static void main(String a[])throws Exception{InputStream i=new FileInputStream("A.java");byte[]b=new byte[1];for(int l;(l=i.read(b))!=-1;)for(int n=0;n<Integer.parseInt(a[0]);n++)System.out.write(b,0,l);}}

```

Formatted :

```
import java.io.*;
interface A {
    static void main(String a[]) throws Exception {
        InputStream i = new FileInputStream("A.java");
        byte[] b = new byte[1];
        for (int l; (l = i.read(b)) != -1; )
            for (int n = 0; n < Integer.parseInt(a[0]); n++)
                System.out.write(b, 0, l);
    }
}

```

# Answer
> 0 votes
# C# (Visual C# Interactive Compiler), ~~17~~ 16 bytes

```
Write($"{0,32}")

```

Thanks to Jo King for saving one byte!

Try it online!

# Answer
> 0 votes
# SNOBOL4 (CSNOBOL4), 58 bytes - 25 = 33

```
	N =INPUT
O	OUTPUT =1
	X =LT(X,N * 29 - 1) X + 1	:S(O)
END

```

Try it online!

# Answer
> 0 votes
# MIPS, 58 bytes

```
main:li $v0,1
li $a0,63
l:sub $a0,$a0,1
syscall
bnez $a0,l

```

Try it online!

A counter loop that prints the count on each pass without spaces or a trailing newline.

# Answer
> 0 votes
# Perl 6 (8 bytes)

```
say 1e14

```

# Perl 6 (with challenge, 27 bytes - 25 = 2)

```
print "a"x(@*ARGS[0]//2)*27

```

# Answer
> 0 votes
# Tamsin, 40 bytes

```
main='aaaaaaaaaaaaaaaa'->T&''+T+T+T+T+T.

```

Try it online!

Outputs 80 of the character `a`.

# Answer
> 0 votes
# Java, 86 bytes

Prints 172 (86\*2 = 172) null bytes to STDOUT

```
interface A{static void main(String[]a){System.out.print(new String(new char[172]));}}

```

Try it online!

# Answer
> 0 votes
# ink, 1 byte

```
s

```

Try it online!

Outputs `s` and a newline for a total of two characters.

# Answer
> 0 votes
# Brainfuck, -5 bytes

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

```

Input is provided in binary.

Similar to anatolyg's solution, this program corresponds to the minimal solution of `a*b=10+a+b+c`.

# Answer
> 0 votes
# C++ (gcc)

## without bonus: 57 bytes

```
#include<cstdio>
int main(){for(int i=57;i--;)puts("x");}

```

Try it online!

## with bonus: 77 bytes (= Score 52)

```
#include<cstdio>
int main(){int i;scanf("%i",&i);for(i*=77;i--;)putchar(46);}

```

Try it online!

# Answer
> 0 votes
# Clam, 4 bytes

```
p^97

```

Try it online!

Not very interesting.

Outputs `4782969` followed by a newline

## Explanation:

```
p      - Print next token's value
 ^     - Exponent operator on next 2 tokens
  9    - Literal 9
   7   - Literal 7

```

9^7 = 4782969

# Answer
> 0 votes
# Python 3, 37 14 bytes

```
print('a'*27)

```

# Answer
> 0 votes
# Python 2, 12 Bytes

```
print 18**19

```

Outputs `708235345355337676357632` which is 24 characters.

# Answer
> 0 votes
# 33, 8 bytes

```
13c1[mo]

```

Prints `1211109876543210`, which is 16 bytes long

# Answer
> 0 votes
# Stax, 16 bytes \- 25 = -9

```
|?xx{{dqF}{dqq}?

```

Run and debug it

Uses Stax's sneaky `|?` command, which means that the output is also 2 quines (or any other input number)

However, one downside is the fact that I can't use packed stax, as the |? operation prints out unpacked source code, even if the source is packed

# Answer
> 0 votes
# MATLAB, 40 - 25 = 15 Bytes

I like using matlab, and I am slightly disappointed that what is probably the optimal answer for it has already been written. But here's a shot at achieving the bonus, which doesn't help ultimately but was fun regardless.

```
f=@(n)disp(char(linspace(1,2,2*2*10*n)))

```

Define an anonymous function that is 40 characters long. User calls the function as f(n) and it will output 40\*n characters. (I think this complies with code golf rules but feel free to call me out if it doesn't)

with no output, the error message returned is

```
Not enough input arguments.

Error in @(n)disp(char(linspace(1,2,2*2*10*n)))

K

```

which comes out to 80 bytes, or 2x the length of my function. It's hacky but any other way would take more I'm fairly certain.

# Answer
> 0 votes
# Vyxal, -18 bytes

```
2∨6*¤꘍₴

```

Try it Online!

```
2∨      # n || 2
  6*    # times 6
    ¤꘍  # spaces
      ₴ # Without a trailing newline

```

# Polyglot, 1 byte

```
0

```

In Vyxal, 05AB1E, , (edit in more), prints 0 with a trailing newline.

# Answer
> 0 votes
# JavaScript, 21 16 13 bytes

```
alert("A"*26)

```

# Answer
> 0 votes
# Thunno `d`, 7 - 25 = -18 bytes

```
2~zd*ZL

```

Attempt This Online!

#### Explanation

```
2~       # Logical OR with 2
  zd     # Read the source code
    *    # Repeat it that many times
     ZL  # Print without a trailing newline
         # Implicit output

```

## Thunno, 1 byte

```
1

```

Attempt This Online!

Prints 1 with a trailing newline. Any digit will work here.

# Answer
> 0 votes
# Thunno 2, 8 - 25 = -17 bytes

```
2|8×⁻'x×

```

Attempt This Online!

#### Explanation

```
2|8×⁻'x×  # Implicit input (or not)
2|        # Logical OR with 2
          # (if there was no input, push 2)
  8×      # Multiply it by 8
    ⁻     # Decrement to account for
          # the trailing newline
     'x×  # Repeat the character "x"
          # that many times
          # Implicit output with newline

```

# Answer
> 0 votes
# !@#$%^&\*()\_+, 2 bytes

```
^?

```

Try it online!

# Answer
> 0 votes
# Kib, 1 byte (noncompeting)

```
0

```

Any numeral works because of implicit output.
More interesting 4 byte solution

```
\A7*

\A     # Push char 'A'
  7    # Push 7
   *   # Multiply

```

(for reference this language is largely unfinished; I made it a couple months ago as a side project)

# Answer
> 0 votes
# Racket, 72 - 25 = 47 bytes

```
#!racket
((λ(n)(display(make-string(*(if(eq? eof n)2 n)72)#\a)))(read))

```

Try it online!

---

## Explanation

The language expression for Racket is `#!racket`. This just tells Racket's system what language to run the program with.

On line two, we create an immediately invoked lambda that receives one optional input from the user. User input can be either `#<eof>` (no input) or a number `n`. If there is no input, we set `n` to be `2`.

We multiply `n` with the length of the program which is 72 bytes (`λ` counts as two bytes) and use the result to make a string of `a`s. I could have saved 3 bytes by not specifying any character to be printed, but that would print an empty string with 72 null characters. Once the string is made, we print it to standard output.

```
#lang racket

((lambda (n)
   (display (make-string (* (if (eq? eof n) 2 n) 72) #\a)))
 (read))

```

## Links to relevant documentation

*Have a wonderful weekend!*

# Answer
> 0 votes
## Pascal, 39 Bytes

This complete `program` in accordance to ISO standard 7185 “Standard Pascal”

```
program p(output);begin write(6:78)end. { No trailing end‑of‑line character. }

```

prints

```
                                                                             6

```

*without* a trailing end‑of‑line character (tested with the GNU Pascal Compiler and FreePascal Compiler).

## Pascal, 90 − 25 = 65

The overhead for the bonus does not pay off since you must add `input` to the `program` parameters list and test for `EOF`, because `read`ing from `input` is illegal if the end of file has been reached.

```
program p(input,output);var n:integer;begin n:=2;if not EOF then read(n);write(1:90*n)end.

```

# Answer
> 0 votes
# YASEPL, 22 - 25 = -3 bytes

```
=a'}7,""$2`1*22;"a",a~

```

# YASEPL, 10 bytes (no input)

```
=a;"a",20~

```

---
Tags: code-golf, self-referential
---