Introduction
In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is "Hello World!" and "Is this number a prime?".
Challenge
Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
Output
The output will be a list of numbers (and Fizzes, Buzzes and FizzBuzzes) separated by a newline (either \n or \r\n). A trailing newline is acceptable, but a leading newline is not. Apart from your choice of newline, the output should look exactly like this:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation.
Further Rules
This is not about finding the language with the shortest approach for playing FizzBuzz, this is about finding the shortest approach in every language. Therefore, no answer will be marked as accepted.
Submissions are scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score--if in doubt, please ask on Meta.
Nothing can be printed to STDERR.
Feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program generates FizzBuzz output, then congrats for paving the way for a very boring answer.
Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.
If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck derivatives like Alphuck and ???), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.
Because the output is fixed, you may hardcode the output (but this may not be the shortest option).
You may use preexisting solutions, as long as you credit the original author of the program.
Standard loopholes are otherwise disallowed.
As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf; these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.
Catalogue
var QUESTION_ID=58615;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=30525;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"https://api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='<h1>'+c.body.replace(OVERRIDE_REG,'')+'</h1>'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery('<a>'+lang+'</a>').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang.toLowerCase(),user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw>b.lang_raw)return 1;if(a.lang_raw<b.lang_raw)return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}
body{text-align:left!important}#answer-list{padding:10px;width:290px;float:left}#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="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{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>
436 Answers 436
GNU sed 4.2.2, 126 bytes
This answer is in response to the bounty offered by @user41805 to golf further his sed script for this challenge.
s/^/@@,/;h
:
y/@123456789';,/123456789@;,'/
/@.$/!{x;G;s/..\n.//}
h
s/[@5].$/&Buzz/
s/.*,/Fizz/
s/.*\WB/B/
s/\W*//gp
g;/@@/d
t
The trick was to notice that no '0' will be printed, so I replaced it with '@' to be able at line 9 to refer to the extra characters [0';] as \W, thus shaving 3 bytes. Please check his description on how the code works.
Pip, (削除) 32 (削除ここまで) (削除) 31 (削除ここまで) 30 bytes
LhP J["Fizz""Buzz"]X!*Ui%^35|i
Here's the 31-byte equivalent in Pip Classic: Try it online!
Explanation
LhP J["Fizz""Buzz"]X!*Ui%^35|i
Preinitialized variables: h=100, i=0
Lh Loop 100 times:
^35 Split 35 into a list of digits: [3 5]
Ui Pre-increment i (thus starting at 1, not 0)
% Mod (vectorizing); our list is now [i%3 i%5]
!* Map logical not to that list (1 if mod was 0, else 0)
["Fizz""Buzz"] List containing Fizz and Buzz
X Repeat string (vectorizing)
Our two items are now:
"Fizz" if i is divisible by 3, "" otherwise
"Buzz" if i is divisible by 5, "" otherwise
J Join that list into a single string
P |i Logical OR with i, and print
Apple shortcut language, 31 actions, 23580 bytes
Here's a link that'll open it in iOS. Warning: May brick your device, use with caution.
Here's a downloadable file that can be imported on MacOS. The size of this file is the score.
This was a huge pain, especially taking and combining all the screenshots for the above image. The language has several annoying (削除) bugs (削除ここまで) features though:
- The 'add to variable' action treats it as a list, even if it's a number
- There's no way to create a range
- There's one output, so you have to combine everything into that
- very basic list support only
- No way to do a while loop / break out of a loop
It's sorta equivalent to the pseudocode:
O = []
C = 0
repeat 100:
T = ''
C += 1
if C % 3 == 0:
T += 'Fizz'
if C % 5 == 0:
T += 'Buzz'
if T == '':
T = C
O += T
print '\n'.join(O)
-
\$\begingroup\$ Is this real language? \$\endgroup\$Fmbalbuena– Fmbalbuena2022年01月29日 01:04:24 +00:00Commented Jan 29, 2022 at 1:04
-
\$\begingroup\$ If anyone on iOS isn’t seeing any results it didn’t actually display anything for me until I added a "show result" block to display the O variable. \$\endgroup\$Aaroneous Miller– Aaroneous Miller2022年01月29日 04:40:40 +00:00Commented Jan 29, 2022 at 4:40
-
\$\begingroup\$ I’ve got 25 actions, including a "show result". iOS link \$\endgroup\$Aaroneous Miller– Aaroneous Miller2022年01月29日 05:07:08 +00:00Commented Jan 29, 2022 at 5:07
-
\$\begingroup\$ @AaroneousMiller It displays just fine on my end when editing+running the script \$\endgroup\$emanresu A– emanresu A2022年01月29日 05:29:29 +00:00Commented Jan 29, 2022 at 5:29
-
\$\begingroup\$ @AaroneousMiller Because of annoying iOS settings I can't open that, feel free to post it yourself. \$\endgroup\$emanresu A– emanresu A2022年01月29日 05:35:49 +00:00Commented Jan 29, 2022 at 5:35
Vyxal, Hj, (削除) 25 (削除ここまで) (削除) 19 (削除ここまで) 12 bytes
-6 bytes thanks to Aaron
-7 bytes thanks to lyxal
Flagless 15 bytes
Longer than lyxal's answer, but uses a different technique
ƛ3kf*n5kb*+∴ stack is preset to a 100 because of the `H` flag
ƛ lambda map with variable n
3 push 1 if n%3 == 0 (we'll call the return a)
kf push constant Fizz to the stack
* push a*kF
n push n
5 push 1 if n%5 == 0 (we'll call it b)
kb push Buzz to the stack
* push b*kB
+ add last two elements of the stack ""/Fizz/Buzz
∴ push the maximum of n and ""/Fizz/Buzz/FizzBuzz
Vyxal prints out the last element of the stack by default (the `j` flag joins the list with new lines)
-
1\$\begingroup\$ You can use the register instead of variables, and the
Hflag, for 19 bytes \$\endgroup\$Aaroneous Miller– Aaroneous Miller2021年06月27日 17:30:57 +00:00Commented Jun 27, 2021 at 17:30 -
\$\begingroup\$ Try it Online! for 16 bytes using the register, H flag and string multiplication instead of if statements \$\endgroup\$2021年06月27日 23:01:30 +00:00Commented Jun 27, 2021 at 23:01
-
\$\begingroup\$ Try it Online! for 12 \$\endgroup\$2021年06月28日 01:34:46 +00:00Commented Jun 28, 2021 at 1:34
-
\$\begingroup\$ @lyxal and Aaron Thanks! \$\endgroup\$math scat– math scat2021年06月28日 14:35:17 +00:00Commented Jun 28, 2021 at 14:35
-
\$\begingroup\$ @lyxal would you please check the explanation? I didn't get the last part so i guessed \$\endgroup\$math scat– math scat2021年06月28日 15:34:59 +00:00Commented Jun 28, 2021 at 15:34
Aya, 37 bytes
[100,Y""y3%0="Fizz"?y5%0="Buzz"?+:P];
I recently discovered Aya (so this code is likely not optimal), but really want to spread the word.
How it works
First, here are all the relevant operators:
[<number>,<expression>] | performs a list comprehension
| by taking all numbers from 1 to <number> (inclusive)
| and applying the expression to that number
Y | copies the value at the top of the stack into y
"" | puts an empty string on the stack
<num a> <num b> % | pop the topmost two values, store a mod b on stack
<num a> <num b> = | pop the topmost two values, store a equals b on stack
<any a> <any b> ? | pop the topmost two values, if a is truthy: keep b on stack
<any a> <any b> + | pop the topmost two values, store concatenation of a and b on stack
<any a> :P | pop the topmost value, format a as string, perform println
; | pop the topmost value
The main "gimmick" here, is that + only operates on the topmost two values.
So by placing [y ""] on the stack first, any addition to the stack will push y out of the scope of +.
Conditionally adding "Fizz" and "Buzz" to the stack leaves us with 4 possible compositions when + is executed:
[y ""]- when y is not divisible by 3 or 5[y "" "Fizz"]- when y is divisible by 3 but not 5[y "" "Buzz"]- when y is not divisible by 3 but is divisible by 5[y "" "Fizz" "Buzz"]- when y is divisible by 3 and 5
The list comprehension captures anything that remains on the stack as elements of the list, so we can drop all of the junk with a single ; at the end.
For the curious, this is what remains in the list:
[ 3 5 6 9 10 12 15 "" 18 20 21 24 25 27 30 "" 33 35 36 39 40 42 45 "" 48 50 51 54 55 57 60 "" 63 65 66 69 70 72 75 "" 78 80 81 84 85 87 90 "" 93 95 96 99 100 ]
-
\$\begingroup\$ Welcome to Code Golf! Nice answer. \$\endgroup\$2022年02月08日 00:09:09 +00:00Commented Feb 8, 2022 at 0:09
Kustom, 72 bytes
This somehow gets a decent score for what it is?
I'm not sure if this language even has an official name, but it's used in a few Android customization apps (KLWP, KWGT, and KLCK). Kustom function documentation for those curious
$fl(1,100,"i+1","if(i%3=0&i%5=0,FizzBuzz,i%3=0,Fizz,i%5=0,Buzz,i)","
")$
and a bit more readable:
$fl(
1,
100,
"i+1",
"if(
i%3 = 0 & i%5 = 0,
FizzBuzz,
i%3 = 0,
Fizz,
i%5 = 0,
Buzz,
i
)",
"
"
)$
-
2\$\begingroup\$ Welcome to Code Golf, and nice answer! \$\endgroup\$2022年06月03日 16:45:22 +00:00Commented Jun 3, 2022 at 16:45
Go, (削除) 162 (削除ここまで) (削除) 158 (削除ここまで) (削除) 145 (削除ここまで) (削除) 143 (削除ここまで) (削除) 142 (削除ここまで) 139 bytes
package main
import."fmt"
func main(){for i,p:=1,Println;i<101;i++{s:=""
if i%3<1{s+="Fizz"}
if i%5<1{s+="Buzz"}
if s!=""{p(s)}else{p(i)}}}
Bespoke, 561 bytes
list a hundred numbers;it must be done well
but remember:things seldomly r so easy
numbers do not go forward ordinarily;theres no one,two,a subsequent three
rather,go one,two(t-hr-ee?no)Fizz
indeed,it recurs if numbers get to divide with three
everyone thinks"probably I go FOUR despite it,yes?it should become easier"oh yes
but u r ongoing
nextly,we say fou-r(fi-ve?no)Buzz
indeed,it recurs if numbers are dividing five
remember a feature:if we ever factor a fifteen out,you do a connection,saying as FizzBuzz
meaning,do both
are you a mastermind?i presumed so
I included a FizzBuzz program as an example program with my official interpreter for Bespoke, but I wrote that one in a more extensible and readable way.
In this one, instead of using a heap value to store whether or not any of Fizz or Buzz were outputted, I directly add n mod 3 to n mod 5. Otherwise, it works largely the same in the broad strokes.
PowerShell, (削除) 59 (削除ここまで) 58 bytes
Original used array selection, but was one byte longer than a minor variation of TimmyD's answer
old: 1..100|%{@($_,"Fizz","Buzz","FizzBuzz")[!($_%3)+2*!($_%5)]}
new: 1..100|%{"Fizz"*!($_%3)+"Buzz"*!($_%5)+"$_"*!!($_%3*$_%5)}
The only real trick involving use of double negation to make anything non-zero a 1 while leaving a zero a zero.
I would have left this as a comment on TimmyD's answer, but I lack the reputation.
EDIT: GAH! I see, now, that the original array implementation was naive insofar as my not having read through the other solutions and realizing that it was already in use ... multiple times over. I leave it here, but shamefacedly admit my ignorance.
-
\$\begingroup\$ Welcome to PPCG! Nice to see another PowerShell user around. Neat trick with the array-indexing, and further proof that PowerShell is nothing if not flexible. Note that, in this particular instance, you don't need to prepend the
@symbol, since PowerShell treats any comma-separated list as an array, saving a byte on that guy and making the two the same length. See an update on my answer as well, incorporating other suggestions. \$\endgroup\$AdmBorkBork– AdmBorkBork2015年09月25日 13:08:56 +00:00Commented Sep 25, 2015 at 13:08
SWI-Prolog, 109 bytes
forall(between(1,100,I),((I mod 3<1,print('Fizz');1=1),(I mod 5<1,print('Buzz');I mod 3>0,print(I);1=1),nl)).
-
2\$\begingroup\$ How is this supposed to be run? I would suggest
+X:-print(X)., but it appears this is run from the REPL. Néanmoins,I mod 3>0,print(I);1=1can becomeI mod 3<1;print(I). Also anagol has 87 bytes (in anagol, them/0predicate is run) for FizzBuzz golf.shinh.org/p.rb?FizzBuzz#Prolog \$\endgroup\$user41805– user418052019年12月14日 10:51:05 +00:00Commented Dec 14, 2019 at 10:51
awk, 62
END{for(x="Fizz";i<100;y="Buzz")print++i%15?i%5?i%3?i:x:y:x y}
Pretty sure there's no surprises here.
Call
awk 'END{for(x="Fizz";i<100;y="Buzz")print++i%15?i%5?i%3?i:x:y:x y}'
then press Ctrl-D to signal end of input.
-
1\$\begingroup\$ I'm curious if the Ctrl-D should be included in the byte-count. Using a
BEGINblock and rearranging the operators a bit adds 1 byte, i.e.BEGIN{for(x="Fizz";i<100;y="Buzz")print++i%3?i%5?i:y:i%5?x:x y}\$\endgroup\$Robert Benson– Robert Benson2017年05月30日 16:19:09 +00:00Commented May 30, 2017 at 16:19
Beam, (削除) 307 (削除ここまで) 288 bytes
And now for the longest solution. I think I could compress this a bit more, but the brain is getting a little fried. I'm pretty happy I got it working though. Rearranged it slightly to gain a few.
+P'++P'++P'''''''>`++ \/+)@'''''>`+++++++)@' \
v```P'''----(+++++++++/+/P+++'L@@++(+++++`<''/
>'p-`n'''''''>`++++++++/
^ >'P'p-``n' >'p-``n'''''''''''>`++++++)@'''''''>`++ \
^ < >p:L''p-`` >''P``v
^ Hu```P-p'''L@++++++++++LP+p <``P+++++''L@@+++++@++(+++++/
var ITERS_PER_SEC = 100000;
var TIMEOUT_SECS = 50;
var ERROR_INTERRUPT = "Interrupted by user";
var ERROR_TIMEOUT = "Maximum iterations exceeded";
var ERROR_LOSTINSPACE = "Beam is lost in space";
var code, store, beam, ip_x, ip_y, dir, input_ptr, mem;
var input, timeout, width, iterations, running;
function clear_output() {
document.getElementById("output").value = "";
document.getElementById("stderr").innerHTML = "";
}
function stop() {
running = false;
document.getElementById("run").disabled = false;
document.getElementById("stop").disabled = true;
document.getElementById("clear").disabled = false;
document.getElementById("timeout").disabled = false;
}
function interrupt() {
error(ERROR_INTERRUPT);
}
function error(msg) {
document.getElementById("stderr").innerHTML = msg;
stop();
}
function run() {
clear_output();
document.getElementById("run").disabled = true;
document.getElementById("stop").disabled = false;
document.getElementById("clear").disabled = true;
document.getElementById("input").disabled = false;
document.getElementById("timeout").disabled = false;
code = document.getElementById("code").value;
input = document.getElementById("input").value;
timeout = document.getElementById("timeout").checked;
code = code.split("\n");
width = 0;
for (var i = 0; i < code.length; ++i){
if (code[i].length > width){
width = code[i].length;
}
}
console.log(code);
console.log(width);
running = true;
dir = 0;
ip_x = 0;
ip_y = 0;
input_ptr = 0;
beam = 0;
store = 0;
mem = [];
input = input.split("").map(function (s) {
return s.charCodeAt(0);
});
iterations = 0;
beam_iter();
}
function beam_iter() {
while (running) {
var inst;
try {
inst = code[ip_y][ip_x];
}
catch(err) {
inst = "";
}
switch (inst) {
case ">":
dir = 0;
break;
case "<":
dir = 1;
break;
case "^":
dir = 2;
break;
case "v":
dir = 3;
break;
case "+":
++beam;
break;
case "-":
--beam;
break;
case "@":
document.getElementById("output").value += String.fromCharCode(beam);
break;
case ":":
document.getElementById("output").value += beam;
break;
case "/":
dir ^= 2;
break;
case "\\":
dir ^= 3;
break;
case "!":
if (beam != 0) {
dir ^= 1;
}
break;
case "?":
if (beam == 0) {
dir ^= 1;
}
break;
case "|":
switch (dir) {
case 2:
dir = 3;
break;
case 3:
dir = 2;
break;
}
break;
case "_":
switch (dir) {
case 0:
dir = 1;
break;
case 1:
dir = 0;
break;
}
break;
case "H":
stop();
break;
case "S":
store = beam;
break;
case "L":
beam = store;
break;
case "s":
mem[beam] = store;
break;
case "g":
store = mem[beam];
break;
case "P":
mem[store] = beam;
break;
case "p":
beam = mem[store];
break;
case "u":
if (beam != store) {
dir = 2;
}
break;
case "n":
if (beam != store) {
dir = 3;
}
break;
case "`":
--store;
break;
case "'":
++store;
break;
case ")":
if (store != 0) {
dir = 1;
}
break;
case "(":
if (store != 0) {
dir = 0;
}
break;
case "r":
if (input_ptr >= input.length) {
beam = 0;
} else {
beam = input[input_ptr];
++input_ptr;
}
break;
}
// Move instruction pointer
switch (dir) {
case 0:
ip_x++;
break;
case 1:
ip_x--;
break;
case 2:
ip_y--;
break;
case 3:
ip_y++;
break;
}
if (running && (ip_x < 0 || ip_y < 0 || ip_x >= width || ip_y >= code.length)) {
error(ERROR_LOSTINSPACE);
}
++iterations;
if (iterations > ITERS_PER_SEC * TIMEOUT_SECS) {
error(ERROR_TIMEOUT);
}
}
}
<div style="font-size:12px;font-family:Verdana, Geneva, sans-serif;">Code:
<br>
<textarea id="code" rows="6" style="overflow:scroll;overflow-x:hidden;width:90%;">+P'++P'++P'''''''>`++ \/+)@'''''>`+++++++)@' \
v```P'''----(+++++++++/+/P+++'L@@++(+++++`<''/
>'p-`n'''''''>`++++++++/
^ >'P'p-``n' >'p-``n'''''''''''>`++++++)@'''''''>`++ \
^ < >p:L''p-`` >''P``v
^ Hu```P-p'''L@++++++++++LP+p <``P+++++''L@@+++++@++(+++++/
</textarea>
<br>
<input id="run" type="button" value="Run" onclick="run()">
<input id="stop" type="button" value="Stop" onclick="interrupt()" disabled="disabled">
<input id="clear" type="button" value="Clear" onclick="clear_output()"> <span id="stderr" style="color:red"></span>
</p>Output:
<br>
<textarea id="output" rows="6" style="overflow:scroll;width:90%;"></textarea>
<br>Input:
<br>
<textarea id="input" rows="1" style="overflow:scroll;overflow-x:hidden;width:90%;"></textarea>
<p>Timeout:
<input id="timeout" type="checkbox" checked="checked">
<br> </div>
Explanation
+P'++P'++P'''''''>`++ \
v```P'''----(+++++++++/
Initializes the program, presetting values in memory
Memory 0, value 1, count incrementer
Memory 1, value 3, div 3 decrementer
Memory 2, value 5, div 5 decrementer
Memory 3, value 99, loop decrementer
>'p-`n
>'P'p-``n
>p:L''p-``
Gets value from Memory 1, decrements it, sets Store to 0. If value <> 0 change direction down, otherwise pass though.
Do the same with Memory 2. Finally if it gets down there, print out the current counter from memory 0.
/+)@'''''>`+++++++)@' \
+/P+++'L@@++(+++++`<''/
'''''''>`++++++++/
Prints Fizz and resets memory slot 1 to 3.
>'p-``n'''''''''''>`++++++)@'''''''>`++ \
``P+++++''L@@+++++@++(+++++/
Another div 5 checker to catch FizzBuzzs. Prints out Buzz and resets memory slot 2 to 5.
>''P``v
Hu```P-p'''L@++++++++++LP+p <
Increments the counter, prints a newline, decrements the loop counter and exits if required.
Lua, (削除) 88 (削除ここまで) 86 bytes
Saved 2 bytes thanks to @Mauris
I'm sure this can be golfed more, any suggestions are welcome.
for i=1,100 do n=(i%3<1 and"Fizz"or"")..(i%5<1 and"Buzz"or"")print(n~=""and n or i)end
-
\$\begingroup\$ Try
i%3<1andi%5<1? \$\endgroup\$lynn– lynn2015年09月26日 22:25:09 +00:00Commented Sep 26, 2015 at 22:25 -
\$\begingroup\$ 82 bytes:
for i=1,100 do s=('Fizz'):sub(i%3*5)..('Buzz'):sub(i%5*5)print(s==''and i or s)end\$\endgroup\$lynn– lynn2015年09月27日 21:56:24 +00:00Commented Sep 27, 2015 at 21:56 -
\$\begingroup\$ I posted a 72-byte solution that ties the record on anarchy golf. \$\endgroup\$lynn– lynn2015年09月27日 22:19:51 +00:00Commented Sep 27, 2015 at 22:19
Python 3, 59 bytes
Based on @feersum's answer.
for i in range(100):print(i%3//2*"fizz"+i%5//4*"buzz"or-~i)
-
3\$\begingroup\$ looks like this has the wrong capitalization \$\endgroup\$ASCII-only– ASCII-only2020年05月08日 06:57:53 +00:00Commented May 8, 2020 at 6:57
C (83 characters)
Because misusing a (POSIX conformant) printf is not that bad, after all:
i;main(){while(++i<101)printf(i%3?i%5?"%2$d\n":"%s\n":"Fizz%s\n",i%5?"":"Buzz",i);}
Perl 6, 46 bytes
say "Fizz"x $_%%3~"Buzz"x $_%%5||$_ for 1..100
-
4\$\begingroup\$ You can remove the spaces after
x\$\endgroup\$Jo King– Jo King2019年01月06日 03:27:42 +00:00Commented Jan 6, 2019 at 3:27
Python 2 REPL, 54
0;exec"print _%3/2*'Fizz'+_%5/4*'Buzz'or-~_;_+=1;"*100
Based on this answer by feersum. Essentially the same technique, only using Python's underscore variable to save 2 chars at the start.
Seriously, 36 bytes
2╤R`;;3@%Y"Fizz"*)5@%Y"Buzz"*(+;I`Mi
Explanation:
2╤ push the value 10**2 (100)
R pop a: push range(1,a+1)
` start function literal
;; duplicate the top of the stack twice
3 push the value 3
@ swap the top 2 values
% pop a,b: push a%b
Y pop a: push 1 if a==0, else 0
"Fizz" push the string "Fizz"
* pop a,b: push a*b (in this case, "Fizz" repeated b times)
) rotate the stack right by one ([a,b,c] -> [c,a,b])
5@%Y"Buzz"* Do the same thing as above, but with divisibility testing for 5 and using "Buzz"
( rotate the stack left by one
+ pop a,b: push a+b (string concatenation here)
; dupe top of stack
I pop a,b,c: push b if a is truthy, else c (here, a and b are the same string, either "", "Fizz", "Buzz", or "FizzBuzz", and c is the original integer)
` end function literal
M pop f,[a]: using each element of [a] as a temporary stack, evaluate f, and push the result
i flatten [a] (push each value in [a] to the stack, starting from the end to preserve order)
-
\$\begingroup\$ Methinks you need a logical NOT in Seriously. \$\endgroup\$lirtosiast– lirtosiast2015年11月10日 23:11:17 +00:00Commented Nov 10, 2015 at 23:11
-
\$\begingroup\$ @ThomasKwa Maybe. I was wishing it had one while I was writing this. Seriously has
~, which is unary bitwise negation, which is not quite the same thing. I might add one. \$\endgroup\$user45941– user459412015年11月10日 23:13:31 +00:00Commented Nov 10, 2015 at 23:13
Javascript, 64 bytes
for(i=0;++i<101;)console.log((i%5?'':'fizz')+(i%3?'':'buzz')||i)
-
\$\begingroup\$ I'm not sure, but I think we allow alert for js output which would save you a few bytes. Nice answer btw. \$\endgroup\$Maltysen– Maltysen2016年05月06日 01:43:19 +00:00Commented May 6, 2016 at 1:43
-
1\$\begingroup\$ We do allow alert. \$\endgroup\$Riker– Riker2016年05月06日 01:48:19 +00:00Commented May 6, 2016 at 1:48
-
1\$\begingroup\$ All of the other JS answers on this particular challenge use
console.log, except for one that outputs the entire text at once. \$\endgroup\$ETHproductions– ETHproductions2016年11月26日 15:09:50 +00:00Commented Nov 26, 2016 at 15:09
8086 machine code, (削除) 70 68 (削除ここまで) 62 bytes
00000000 31 c0 40 50 89 c2 89 e5 68 0a 24 d4 05 75 06 68 |[email protected].$..u.h|
00000010 7a 7a 68 42 75 89 d0 d4 03 75 06 68 7a 7a 68 46 |zzhBu....u.hzzhF|
00000020 69 89 d0 83 fc fa 75 08 d4 0a 86 c4 0d 30 30 50 |i.....u......00P|
00000030 b4 09 89 e2 cd 21 89 ec 58 3c 64 75 c5 c3 |.....!..X<du..|
0000003e
How it works:
| org 0x100
| use16
31 c0 | xor ax, ax
40 | aa: inc ax
50 | push ax
89 c2 | mov dx, ax
89 e5 | mov bp, sp
68 0a 24 | push 0x240a
d4 05 | aam 5
75 06 | jnz @f
68 7a 7a | push 0x7a7a
68 42 75 | push 0x7542
89 d0 | @@: mov ax, dx
d4 03 | aam 3
75 06 | jnz @f
68 7a 7a | push 0x7a7a
68 46 69 | push 0x6946
89 d0 | @@: mov ax, dx
83 fc fa | cmp sp, -6
75 08 | jne @f
d4 0a | aam 10
86 c4 | xchg al, ah
0d 30 30 | or ax, 0x3030
50 | push ax
b4 09 | @@: mov ah, 0x09
89 e2 | mov dx, sp
cd 21 | int 0x21
89 ec | mov sp, bp
58 | pop ax
3c 64 | cmp al, 100
75 c5 | jne aa
c3 | ret
-
\$\begingroup\$ This is very nice and very clean work! Using the stack is quite elegant! Technically
PUSH immediatewas not available on the 8086, so this is really 80186+ machine code. Also, not sure if it's allowed or not, but this does show leading 0's on single digit numbers (01 02 Fizz 03, etc). \$\endgroup\$640KB– 640KB2019年08月28日 01:04:05 +00:00Commented Aug 28, 2019 at 1:04
TeX, 304 bytes
\documentclass[9pt,a4paper]{article}\pagestyle{empty}\begin{document}\count0=0\count1=0\count3=3\count5=5\loop\advance\count1 by1\count0=0
\ifnum\count1=\count3 Fizz\advance\count3 by3\count0=1\fi\ifnum\count1=\count5 Buzz\advance\count5 by5\count0=1\fi\the\count1
\ifnum\count1<100\repeat\end{document}
Somehow count0 is necessary but I didn't check whether it is zero. It works and I have no idea why.
-
\$\begingroup\$ I'm assuming that extra newline is there for a reason, but what's the reason? \$\endgroup\$Stephen– Stephen2017年08月20日 00:06:00 +00:00Commented Aug 20, 2017 at 0:06
-
1\$\begingroup\$ @StepHen two newlines is a new paragraph \$\endgroup\$Leaky Nun– Leaky Nun2017年08月20日 00:06:23 +00:00Commented Aug 20, 2017 at 0:06
Symbolic Python, 324 bytes
I think I fried my brain making this...
_____=_;_=-~(_==_);___=_**(_*_+_);____=___+___/_+_+_
___=(('%'+`'¬'`[-_])*_)%(___+_,___*_-_*_-_)
___=`_>_`[_>_]+`__`[_*_+_]+___[~-_]*_,___[-_]+`__`[_]+___[~-_]*_
_=_>_
__('____=""'+(';_=-~_;____+=((_%-~-~(_==_)<(_==_))*___[_>_]+(_%-~-~-~-~(_==_)<(_==_))*___[_==_]'+`_____`[_==_]+`_==_`[_==_]+'`_`)+'+`"""
"""`)*____)
_=____
Befunge-93, 61 bytes
1+::::3%|>.#_:"c"`#@_55+,
,,:,,0\v>"ziF"
,:,,01ドル>>5%#v_"zuB",
Decided to come back to this and make it conform to specification while shaving some bytes off. Look, no extra spaces!
sed, (削除) 275 (削除ここまで) (削除) 272 (削除ここまで) (削除) 270 (削除ここまで) (削除) 260 (削除ここまで) (削除) 254 (削除ここまで) (削除) 249 (削除ここまで) 245 bytes
s/.*/t0u123456789/
:1
s/(tu?(.).*)/1円\n2円/
s/u(.)(t?)(.*)/1円2円u3円1円/
/9u/{s/t(.)/1円t/;s/u//;s/^/u/}
/99/!b1
s/$/\n10/
s/[0-9][05]/&Buzz/g
s/[0369]{2}/&Fizz/g
s/[147][258]/&Fizz/g
s/[258][147]/&Fizz/g
s/[0-9]+([FB])/1円/g
s/\n0/\n/g
s/[^\n]+\n//
q
This is a pure sed script which discards all input, if any, and then prints all the necessary output lines and quits.
Explanation
The script is divided into a sequence of three main parts: 1. Numeral generation; 2. "Fizz/Buzz/FizzBuzz" insertion; and 3. Formatting.
1. Numeral generation (lines 1 through 6)
The purpose of this part is to generate 99 lines containing the base 10 numerals corresponding to numbers 1 through 99. For that, we first set the entire pattern space to the following string:
t0u123456789
We will call the above string our state string. Next, we enter a loop in which each iteration goes like this:
- A newline is appended to the pattern space;
- A copy of the first numeral character after the "t" in the state string is appended to the pattern space;
- A copy of the first numeral character after the "u" in the state string is appended to the pattern space;
- The "u" in the state string is moved from its current position to the immediate right of the first numeral character after it or, if a "t" is already in said position, the "u" is instead moved to the immediate right of that "t";
- If the "u" in the state string is immediately at the right of the "9" in the state string, the "t" is moved from its current position to the immediate right of the first character after it, and the "u" is moved from its current position to the immediate left of the "0" in the state string;
- If there isn't a "99" anywhere in the pattern space (i.e., the loop has not finished its job of generating all the 99 lines), control goes back to line 2 (label :1) and so this enumeration of procedures is repeated from step 1; otherwise, control flow continues into the next line.
2. "Fizz/Buzz/FizzBuzz" insertion (lines 7 through 11)
The purpose of this part is to append "Fizz" immediately after each two-digit numeral in the pattern space which corresponds to a number which is a multiple of 3 but not of 5; to append "Buzz" immediately after each two-digit numeral in the pattern space which corresponds to a number which is a multiple of 5 but not of 3; and to append "FizzBuzz" after each two-digit numeral in the pattern space which corresponds to a number which is a multiple of both 3 and 5. This is how the computations go:
- We append a newline followed by "10" to the pattern space.
- Next, we search for all substrings of the pattern space formed by a digit between 0-9 on the left and either a 0 or a 5 on the right. We insert "Buzz" into the pattern space immediately after each such substring;
- Finally, we insert "Fizz" into the pattern space immediately after each substring which matches either of the following criteria:
- Substrings formed by two digits which may be 0, 3, 6, or 9;
- Substrings formed by a digit which is either 1, 4 or 7 on the left and a digit which is either 2, 5 or 8 on the right;
- Substrings formed by a digit which is either 2, 5 or 8 on the left and a digit which is either 1, 4 or 7 on the right.
3. Formatting (lines 12 through 15)
This part is straight forward. Here we remove all of the following substrings from the pattern space:
- Every contiguous sequence of numeral characters on the immediate left of a "F" or a "B";
- All 0's on the immediate right of a newline character;
- All characters from the beginning of the pattern space up to and including the first newline character (remember that the state string is still there and there's a newline immediately before the first output numeral).
And then sed just prints the final contents of the pattern space and calls it quits.
Brain-Flak, (削除) 474 470 446 438 420 (削除ここまで) 412 bytes
-18 bytes thanks to Nitroden!
-8 thanks to Wheat Wizard
(((()()()()()){}){}){({}[(()())]((((())))))}{}{({}<>)<>({}<>)<>({}()()<>)<>}<>{}{}{([{}]())({()<(({}())()){(<{}>)((((()()()())())((((({}{}){})[()]){}){}()))){({}<>)<>}}{}{(<{}>)(((((()()()())({})){}())(({})({}())({}{})))){({}<>)<>}}>}{}[()]){([](<>))<>((()()()()()){}){(({}<({}())>)){({}[()])<>}{}}{}<>([{}()]{}<>)<>{({}<>)(<>)}}{}(<>)<>}<>{}{{({}((((()()()){}){}){}){}<>)<>}({}(()()()()()){}<>)<>}<>{({}<>)<>}<>
Gosh, it's nice to finally check this off my to-do list.
Explanation:
Brain-Flak is obviously not very good at getting the modulo of numbers, so I bypassed this by pushing all the elements first.
(((()()()()()){}){}) Push 20
{ Loop 20 times
({}
[(()())] Push a 2 to represent a Buzz
((((())))) Push 4 1s
) And decrement loop counter
}{} Pop the excess 0
{ Loop over the list of numbers
({}<>)<>({}<>)<> Transfer two of the elements to the other stack
({}()()<>)<> And add 2 to the last one
}<>{}{} Pop the excess two elements
Now 1 represents normal numbers, 2 represents Buzz, 3 is Fizz and 4 represents FizzBuzz. Initially I just pushed the values that repeat every 15 numbers 7 times and popped the excess 5, but this way turned out to be slightly shorter.
{ Loop over each element
([{}]()) Subtract one from the current element
({ Fizz and/or Buzz if num is not 1
<(({}())()) Subtract 1 and push, twice
{ Push Buzz if num was not 3
(<{}>)((((()()()())())((((({}{}){})[()]){}){}()))){({}<>)<>}
}{}
{ Push Fizz if num is not 2
(<{}>)(((((()()()())({})){}())(({})({}())({}{})))){({}<>)<>}
}
>
()
}{}[()]) Push -1 if neither Fizz nor Buzz were pushed
{
([](<>)) Push length of list to other stack
<>((()()()()()){}) Push 10 as the mod
Div/mod algorithm
{(({}<({}())>)){({}[()])<>}{}}{}<>([{}()]{}<>)<>
Pushes n%10 to output stack and n/10 to the list stack
{ If div is not 0
({}<>) Push it to the other stack
(<>) Push 0
}
}{} Pop excess 0
(<>)<> Push 0 to other stack to represent a newline
}<>{} Pop extra newline
{ Loop over values
{
({}((((()()()){}){}){}){}<>)<> Add 48 to every value
}
({}(()()()()()){}<>)<> Turn 0s into newlines
} Until there's two 0s in a row
<>{({}<>)<>}<> Reverse output
-
2\$\begingroup\$ Fizz in 44 bytes \$\endgroup\$Nitrodon– Nitrodon2018年05月16日 18:00:42 +00:00Commented May 16, 2018 at 18:00
-
2\$\begingroup\$ Buzz in 44 bytes \$\endgroup\$2018年07月19日 04:00:55 +00:00Commented Jul 19, 2018 at 4:00
(削除) Word (削除ここまで) VBA, 124 (削除) 189 (削除ここまで) bytes
Sub f()
For i=1 To 100
r=""
If i Mod 3=0 Then r="Fizz"
If i Mod 5=0 Then r=r & "Buzz"
If r="" Then r=i
Debug.?r
Next
End Sub
The code breakdown is fairly simple (yay, BASIC).
Loop from 1 to 100
For i=1 To 100Set a variable to be an empty string
r=""Check the value on the counter to see if we should set the variable to Fizz
If i Mod 3=0 Then r="Fizz"Check the counter to see if we need to add Buzz (adding it to an empty string is the same as setting that variable to Buzz)
If i Mod 5=0 Then r=r & "Buzz"Check to see if the variable is still empty and therefore needs to be set to the counter value
If r="" Then r=iPrints the results to the immediate window
t = t & r & vbCr
EDIT: Used @Taylor-Scott's suggestions to tighten it up. Relies on the meta discussion about counting characters when your IDE forces whitespace. Specifically the conclusion that if you can paste the code from the answer into the IDE and run it without issues, then you don't have to count the results of autoformatting.
-
\$\begingroup\$ Actually, the spacing after paragraphs is just a display thing. The plain text output will not have this spacing. :-) If you could add a code breakdown and explanation, this would have my upvote. \$\endgroup\$wizzwizz4– wizzwizz42016年04月22日 16:47:39 +00:00Commented Apr 22, 2016 at 16:47
-
\$\begingroup\$ Yes, those are the words I was looking for. Ta! \$\endgroup\$phrebh– phrebh2016年04月22日 17:57:19 +00:00Commented Apr 22, 2016 at 17:57
-
\$\begingroup\$ +1, as promised! I have however noticed some irritating spaces around certain operators; can those be removed, or is it a language "feature"? \$\endgroup\$wizzwizz4– wizzwizz42016年04月22日 19:15:08 +00:00Commented Apr 22, 2016 at 19:15
-
\$\begingroup\$ @wizzwizz4 Unfortunately, those spaces are a limitation of the language. The IDE forces them in there and you can't get around using the IDE. One of the many, many reasons that VBA is not a good candidate for code golf. \$\endgroup\$phrebh– phrebh2016年04月25日 19:03:33 +00:00Commented Apr 25, 2016 at 19:03
-
\$\begingroup\$ @phrebh can you write in a non-IDE e.g. notepad++, textedit, etc. and run as VB? \$\endgroup\$Riker– Riker2016年05月05日 21:09:34 +00:00Commented May 5, 2016 at 21:09
APL (Dyalog Unicode), 37 bytes SBCS
↑{∨/d←4/0=3 5|⍵:d/'FizzBuzz'⋄⍕⍵} ̈⍳100
⍳100 ɩndices 1...100
{...} ̈ apply the following anonymous lambda to each of those:
⍵ the argument; e.g. 20
3 5| the division remainder when that is divided by 3 and 5; e.g. [2,0]
0= Boolean mask where that is equal to 0; e.g. [0,1]
4/ replicate those numbers for 4 copies of each; e.g. [0,0,0,0,1,1,1,1]
d← assign that to d
∨/...: if any of those are true (OR-reduction); e.g. true:
d/'FizzBuzz' use d to mask the characters of the string; e.g. "Buzz"
⋄ else:
⍕⍵ stringify the argument; e.g. "20"
↑ mix the list of strings into a matrix, so it prints right
-
\$\begingroup\$ Art⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ \$\endgroup\$Andrew Ogden– Andrew Ogden2021年03月30日 15:42:57 +00:00Commented Mar 30, 2021 at 15:42
-
\$\begingroup\$ @AndrewOgden Thank you! \$\endgroup\$Adám– Adám2021年03月30日 15:58:36 +00:00Commented Mar 30, 2021 at 15:58
><>, 59 bytes
0v!oo:oo"Fiz"\
1<oan?*/!?%5$\!?%3;?)*aa::::::+
o"Buzz"/0ドルoo
Prints a trailing newline
How it works
0v...
.<... Initialises the stack with 0
.....
.....
1<................;?)*aa::::::+ Increment the counter and duplicate it a looooot
..... End the program if the counter is larger than 100 (10*10)
0..oo:oo"Fiz"\
.............\!?%3... Check if the counter is divisible by 3 and print Fizz if so
..... Also push a 0 to the stack
.......o Swap the pushed 0 if it exists (otherwise it swaps two copies of the counter)
......./!?%5$... Check if the counter is divisible by 5 and print Buzz if so
o"Buzz"/0ドルoo Also push a 0 to the stack
.......... Multiply the top two values of the stack.
..oan?*... If the counter was divisible by 5 or 3 print the number
.......... Print a newline and loop around again
As time goes, the stack fills up, with an extra copy of the counter for each Fizz or Buzz (and two for FizzBuzzes). This is due to the extra copy(s) of the counter that don't end up being printed.
Spaghetti, 522 bytes
main:0"n"goto store goto l l:100"n"goto retrieve goto areEqual"EOF"goto jumpIfTrue"n"goto retrieve 1 2 goto add"n"goto store 15"n"goto retrieve 2 goto modulus 0 goto areEqual"f"goto jumpIfTrue 3"n"goto retrieve 2 goto modulus 0 goto areNotEqual"b"goto jumpIfTrue"Fizz"1 goto print goto b t:3"n"goto retrieve 2 goto modulus 0 goto areEqual"l"goto jumpIfTrue"n"goto retrieve 1 goto print goto l b:5"n"goto retrieve 2 goto modulus 0 goto areNotEqual"t"goto jumpIfTrue"Buzz"1 goto print goto l f:"FizzBuzz"1 goto print goto l
Requires a newline at the end, cause otherwise the interpreter throws a hissy fit.
Spaghetti is a stack based language that promotes using goto extensively. That means, every single operation you use requires a goto statement along with it.
That being said, this took a while.
Commented version is at the Spaghetti examples.
Try it on the online interpreter! (Code must be pasted in)
LolCode, (削除) 392 (削除ここまで) (削除) 383 (削除ここまで) 353 bytes
This LolCode follows the 1.3 standard used by the lci interpreter.
Unfortunately, no online interpreter.
Not the best language to golf with, but it's fun!
Update 1: changed for loop to while loop
Update 2: removed newlines in favor of commas (soft command break)
HAI 1.3,CAN HAS STDIO?,I HAS A v ITZ 1,IM IN YR s,BOTH SAEM 0 AN MOD OF v AN 15,O RLY?,YA RLY,VISIBLE "FizzBuzz",NO WAI,BOTH SAEM 0 AN MOD OF v AN 3,O RLY?,YA RLY,VISIBLE "Fizz",NO WAI,BOTH SAEM 0 AN MOD OF v AN 5,O RLY?,YA RLY,VISIBLE "Buzz",NO WAI,VISIBLE v,OIC,OIC,OIC,BOTH SAEM v AN 100,O RLY?,YA RLY,GTFO,OIC,v R SUM OF v AN 1,IM OUTTA YR s,KTHXBYE
-
\$\begingroup\$ Nice first post, welcome to the site! \$\endgroup\$2020年11月03日 15:32:47 +00:00Commented Nov 3, 2020 at 15:32
Explore related questions
See similar questions with these tags.
Nothing can be printed to STDERR.Is this true only when running, or also when compiling (assuming that is a separate step?) \$\endgroup\$