# Scream very loudly

Write a script that outputs A to stdout infinitely.

There should be no newlines or separators between the characters.

Standard loopholes apply.

This is . The shortest solution in each language wins.

• @FryAmTheEggman I respectfully disagree with this being marked as duplicate. This has a few almost (but not quite!) trivial distinctions from the other questions. For example, printing to stdout without printing a new line, and in the other challenge, looping without output Feb 29, 2020 at 1:41
• @FryAmTheEggman The other challenge clearly states "producing no output". This is not "producing no output". Feb 29, 2020 at 1:46
• @FryAm In Brainfuck, the size is more than 5 times that of the original program. In some languages, output without newlines is hard, especially with sed. I had to use the -z flag just to even remove one. Feb 29, 2020 at 15:36
• "Infinite output" is significantly different from "a specific char infinitely many times without new lines". I don't think this is a duplicate. Let's reopen it if this comment gets four upvotes Feb 29, 2020 at 22:00
• @Tornado547 If you update the requirement, you need to notify current answers. Alternatively, you can keep the infinite output requirement, and include a sentence saying something like "The code should theoretically produce infinite output, given enough time and memory, and disregarding any data-type limitations. It is acceptable if in practice the output stops due to some of those limitations" Mar 1, 2020 at 20:56

main=putStr$cycle"A"  Try it online! • Also 20 bytes: main=putStr"A">>main – cole Mar 1, 2020 at 18:45 • 19 bytes: m@main=putStr"A">>m – Lynn Sep 30, 2020 at 10:34 # Ruby, 12 bytes loop{$><<?A}


Try it online!

# Jelly, 4 bytes

”AȮß


Try it online!, or check how it works below. If the "A" could be program input, we could get away with only two bytes: Ȯß

”A   The character literal "A"
Ȯ  Print it and return it,
ß and recursively call this same link.

• How long does it take for the stack to overflow? Mar 2, 2020 at 20:49
• I didn't run it locally, only on TIO... And it seems TIO stops the execution because of the output size. So maybe the implementation of the recursive call is actually a loop? Because in Python the usual recursion depth is 1000 or 1024 and I manage to output way more than 1024 "A"s..? Just check the TIO link.
– RGS
Mar 2, 2020 at 22:01
• Here. The interpreter sets the recursion limit to 1 << 30.
– user92069
Mar 3, 2020 at 10:56

# Python 3, 25 22 bytes

Saved 3 bytes thanks to Jo King! :)

while 1:print(end='A')

• That's a good idea actually. Thing is though it would be 26 bytes, and the question doesn't require efficiency. Sorry :( Mar 4, 2020 at 9:19
• Ok, I'm lost. Could you give me your interpretation / solution? Mar 4, 2020 at 9:49
• Edit: I just realised what you meant, sorry Mar 4, 2020 at 9:50

# PowerShell27 25 bytes

for(1){Write-Host -n "A"}


Try it online!

-n parameter for Write-Host works as -NoNewline.

• for() should work as well to save 3 bytes Mar 3, 2020 at 18:18
• perhaps not heard. turn up volume: ıııııııııııııııııııııııııııııııııııııııı[]ııı Mar 5, 2020 at 4:18

# International Phonetic Esoteric Language, 9 bytes

Derived from my answer to "Shortest code to produce infinite output".

"A"10ɑbuɒ


## Explanation:

This works because the ɒ instruction don't do anything with the loop index except to check if index < limit. If it is, it loops back to its associated ɑ. Otherwise it exits the loop (index manipulation is handled with e adn ø).

"A"10ɑbuɒ
"A"       (Push "A")
10     (Loop bounds: 0 to 1)
ɑ    (Start loop)
b   (Copy top)
u  (Print with no trailing)
ɒ (End loop)


# 33, 7 bytes

"A"j[p]

"A"     Put "A" in the source string
j    Copy the value into the accumulator, so the loop never terminates
[p] Print infinitely


Try it online!

## Wj, 3 bytes

'AI


## Explanation.

  I % Forever:
'A  % Calculate the string "A"
% Implicit output

Flag:j % Without a newline
$$$$


# F# (.NET Core), 22 bytes

while 1=1 do printf"A"


Try it online!

# Whitespace, 23 bytes

[N
S S N
_Create_Label_LOOP][S S S T S S S S S T N
_Push_65_A][T   N
S S _Print_as_character_to_STDOUT][N
S N
N
_Jump_to_Label_LOOP]


Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Start LOOP:
Character c = 'A'
Print c as character to STDOUT
Go to next iteration of LOOP


# Batch, 42 bytes

@for /l %%a in (0,0,0) do @set /p="A" <nul


# Clojure, 18 bytes

(while 1(print\A))


Try it online!

# PHP, 16 14 bytes

for(;;)echo A;


Try it online!

• -1 byte thx to @Kaddath!
• You can save 1 byte with a for loop and echo ;) TIO Mar 2, 2020 at 7:59
• @Kaddath or 14 bytes with another tweak! TIO Mar 2, 2020 at 11:48
• @IsmaelMiguel I don't think that's necessary, as command-line is allowed for PHP golf; documentation says: when running in command line mode, the default is 0 (unlimited) Mar 2, 2020 at 12:06
• @Kaddath You're right, I've deleted my comment. Mar 2, 2020 at 12:11

# BASIC, 211817 13 bytes

1?"A";
GOTO 1


Try it online!

Everyone's first program!

Credits:

• -3 bytes thx to @ceilingcat
• -1 byte thx to @S.S. Anne
• -3 bytes more thx again to @ceilingcat!
• You can't even get a BASIC link right. Disappointing... Mar 2, 2020 at 1:26
• Mar 2, 2020 at 1:29
• Look around you. Look around you. Can you tell what we're looking for?
– JDL
Mar 2, 2020 at 10:56
• @JDL huh? I'm not following... Mar 2, 2020 at 12:27
• @640KB maybe a reference to the BBC show Mar 5, 2020 at 1:25

# Vim, 10 bytes

@Noodle9's answer of qqiA^[@q is a good start but is incorrect:

The call of macro-q is using any previous setting of macro-q. This only worked because, in testing, they had previously recorded macro-q to output A, so they were unwittingly relying on saved state.

You can see this by trying to change the A to a different letter, and the first time you test it you will still get 'A's. Or you can first clear macro-q with "qqq"

Here is a correct answer along the same lines:

qqiA^[@qq@q

qq            Record macro-q (the first time)
i           Insert
A          Letter 'A'
^[        Exit insert mode
@q      Call macro-q
qq    Stop recording
@q  Call macro-q


Although this does require that nothing is in macro-q at the start, which I think is a fair assumption for code golf, that you are starting with a clean slate / fresh install, as opposed to random initialization state. If not, or if you want to test this and have macros set already, you would need to do:

qqqqqiA^[@qq@q


Where the initial 'qqq' will clear the macro-q.

Of course, all of this is much easier to read if you don't use 'q' for the macro. :)

• Does anyone ever use anything other than q` for their macro?
– Neil
Mar 5, 2020 at 13:25
• Heh. I use 'w' sometimes, but that's because I have an odd keyboard. Mar 5, 2020 at 20:21