[Question]
  [
# Intro
Beauty lies in the eye of the beholder. Output lies in the choice of the compiler. There are some codes that give different outputs based on what language they are executed in. Take for instance, the code given below:
```
# include <stdio.h>
# define print(a) int main(){printf("C is better"); return 0;}
print("Python is better")
```
When executed in C, it prints "C is better". When using a python interpreter, it prints "Python is better". 
# Challenge
The challenge is a modification of the FizzBuzz challenge. Write a code that gives different outputs based on language it is executed in. When executed with the first language, it prints all numbers from 1 to 1000 (both inclusive) which are not divisible by 2. If a number is divisible by 2, it outputs "FizzBuzz". When executed with the second language, if a number is not divisible by 3, it is printed. Else, the string "FizzBuzz" is printed.
# Example
Output when executed in language 1 would be
```
1 FizzBuzz 3 FizzBuzz 5 FizzBuzz 7 FizzBuzz 9 FizzBuzz ... (upto FizzBuzz 999 FizzBuzz)
```
Output when executed in language 2 would be
```
1 2 FizzBuzz 4 5 FizzBuzz 7 8 FizzBuzz 10 11 FizzBuzz 13 14 FizzBuzz ... (upto 998 FizzBuzz 1000)
```
# Optional Challenge
You can optionally allow the program to execute in more than 2 languages. For the ith language, every multiple of (i+1) is substituted with FizzBuzz. It isn't necessary, but at least 2 languages are compulsory.
# Constraints
Need to write a fully functioning code. For instance, a method/function/procedure alone (which could not independently execute) would not be acceptable
Can use only 1 file
All outputs to be printed to standard output (not to standard error)
All other standard rules of code-golf apply
**EDIT**: Fixed a loophole: 
No taking of user inputs during execution
**Edit** I got a comment saying the question wasn't clear if a non-empty separator is mandatory between the numbers. Assume it's not mandatory
# Scoring
Total score = Number of bytes in the program.
# Winning
Consider different participation brackets (based on number of languages being used). Person with least characters in each bracket can be considered a winner.
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands) / [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b) / [2sable](https://github.com/Adriandmen/2sable), 27 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
3°Lv®dтнOÌyDrÖi"FizzBuzz"},
```
[2: Try it online in 2sable.](https://tio.run/##MypOTMpJ/f/f@NAGn7JD61IuNl3Y63@4p9Kl6PC0TCW3zKoqp9KqKqVanf//AQ)  
[3: Try it online in 05AB1E.](https://tio.run/##yy9OTMpM/f/f@NAGn7JD61IuNl3Y63@4p9Kl6PC0TCW3zKoqp9KqKqVanf//AQ)  
[4: Try it online in 05AB1E (legacy).](https://tio.run/##MzBNTDJM/f/f@NAGn7JD61IuNl3Y63@4p9Kl6PC0TCW3zKoqp9KqKqVanf//AQ)
**Explanation:**
Let's start with a bit of history of these three languages. The development of 05AB1E started at the start of 2016 (or actually, the very first git-commit was on December 21st, 2015). This new codegolf language was being built in Python as backend. Mid 2016 2sable was branched of the 05AB1E version (July 7th, 2016 to be exact), and the strength of 2sable in comparison to that old 05AB1E version was added: implicit inputs. Later on implicit input was also added to 05AB1E, and 2sable was basically a forgotten version right after it was created on that day July 7th, 2016.
Then in mid-2018, a new 05AB1E version was being started, this time completely rewritten in Elixir instead of Python, with loads of new builtins added and some builtins changed or even removed.
So, let's go over the code and see what it does in each of the three languages:
```
3°                          # Push 10^3: 1000 (NOTE: I'm unable to use builtin `₄` for
                            # 1000, since it wasn't available in 2sable yet)
  Lv                        # Loop `y` in the range [1,1000] (NOTE: I'm unable to use
                            # builtin `E` for the [1,n] loop, since it wasn't available
                            # in 2sable nor the legacy version yet)
    ®                       #  Push -1
     d                      #  2sable: check if -1 only consist of digits (falsey / 0)
                            #  05AB1E (legacy): check if -1 is an integer (truthy / 1)
                            #  New 05AB1E: check if -1 is non-negative ≥0 (falsey / 0)
      т                     #  2sable: no-op, so does nothing
                            #  05AB1E (legacy) / new 05AB1E: push 100
       н                    #  Pop and push its first character
                            #   2sable: does this for the 0 of the `d` falsey result
                            #   05AB1E (legacy) / new 05AB1E: 100 → 1
        O                   #  Sum all values on the stack:
                            #   2sable: 0
                            #   05AB1E (legacy): 2 (1+1)
                            #   New 05AB1E: 1 (0+1)
         Ì                  #  Increase it by 2
                            #   2sable: 2
                            #   05AB1E (legacy): 4
                            #   New 05AB1E: 3
          yD                #  Push the loop value `y` two times
            r               #  Reverse the values on the stack
             Öi          }  #  If `y` is divisible by the value we calculated earlier:
               "FizzBuzz"   #   Push string "FizzBuzz"
                          , #  Pop and print the top value with trailing newline
```
Note: the `O` to sum the stack will also add the previous value that was divisible (since we've duplicated it with `D`, but only popped and printed `"FizzBuzz"`). But since we know it's divisible, the increased sum in that next iteration doesn't make a difference to the divisibility check.
[Answer]
# [Fortran (GFortran)](https://gcc.gnu.org/fortran/)/[Ruby](https://www.ruby-lang.org/), ~~80~~ ~~79~~ 75 bytes
```
print&!1.upto(1e3)do|i|puts i%3<1?"
*,(i,'FizzBuzz',i=1,999,2)!"[7,8]:i
end
```
[Try it online!](https://tio.run/##S8svKilKzNNNT4Mw/v8vKMrMK1FTNNQrLSjJ1zBMNdZMya/JrCkoLSlWyFQ1tjG0V@LS0tHI1FF3y6yqciqtqlLXybQ11LG0tNQx0lRUijbXsYi1yuRKzUv5/x8A "Fortran (GFortran) – Try It Online") (Fortran), [Try it online!](https://tio.run/##KypNqvz/v6AoM69ETdFQr7SgJF/DMNVYMyW/JrOmoLSkWCFT1djG0F6JS0tHI1NH3S2zqsqptKpKXSfT1lDH0tJSx0hTUSnaXMci1iqTKzUv5f9/AA "Ruby – Try It Online") (Ruby)
The Fortran compiler just sees
```
print&
*,(i,'FizzBuzz',i=1,999,2)
end
```
(`!` is the comment character in Fortran). The Ruby interpreter sees the full program, but we hide the otherwise invalid (Fortran) syntax at the start of the second line by wrapping it in a string.
[Answer]
# [Python 2](https://docs.python.org/2/)/[Python 3](https://docs.python.org/3/), ~~81~~ ~~61~~ ~~57~~ 54 bytes
-20 with thanks to @KevinCruijssen
-4 with thanks to @dingledooper for the idea (prints from 1000 to 1)
-3 with thanks to @Ayxan by losing an unneeded `int`
```
x=1000
while x:print((x,'FizzBuzz')[x%(3/2*2)<1]);x-=1
```
Uses the differences of the `/` operator in Python 2 and 3. In Python 2 `3/2` is `1` (integer division) while in Python 3 it is `1.5`.
[Try it online (Python 2)!](https://tio.run/##K6gsycjPM/r/v8LW0MDAgKs8IzMnVaHCqqAoM69EQ6NCR90ts6rKqbSqSl0zukJVw1jfSMtI08YwVtO6QtfW8P9/AA "Python 2 – Try It Online")
[Try it online (Python 3)!](https://tio.run/##K6gsycjPM/7/v8LW0MDAgKs8IzMnVaHCqqAoM69EQ6NCR90ts6rKqbSqSl0zukJVw1jfSMtI08YwVtO6QtfW8P9/AA "Python 3 – Try It Online")
# [Python 2](https://docs.python.org/2/)/[Python 3](https://docs.python.org/3/), 81 bytes
```
import sys
print([(x,'FizzBuzz')[x%sys.version_info[0]<1]for x in range(1,1001)])
```
[Try it online (Python 2)!](https://tio.run/##Dck7DoAgDADQ3VOwGCExBpydHLwEIcbBTwdbUtAAl0ff@nyOF@FYK9yeOIqQQ@MZMEorU98tUMr8lNIpm9r/hnfnAIQr4EFWu8m4g1gkASh4w3OXpjdaG@VUrR8 "Python 2 – Try It Online")
[Try it online (Python 3)!](https://tio.run/##Dcm9CoAgEADgvadwiRQilNamhl5CJBr6uaE7OS3Ul7e@9fM5XoRjrXB74ihCDo1nwCitTH23QCnzU0qnbGr/G96dAxCugAdZ7SbjDmKRBKDgDc9dmt5obZRTtX4 "Python 3 – Try It Online")
Although it is longer, I am keeping the original as I think it is pretty cool the way the version numbers tie in with the the requirement for 2nd and 3rd elements :-)
[Answer]
# [Perl 4](https://www.perl.org/), ~~54~~ 48 bytes
```
for(;$i++<1e3;){print$i%(2+true)?$i:'FizzBuzz';}
```
[Try it online!](https://tio.run/##K0gtyjH5/z8tv0jDWiVTW9vGMNXYWrO6oCgzr0QlU1XDSLukqDRV014l00rdLbOqyqm0qkrduvb/fwA "Perl 4 – Try It Online")
# [PHP](https://php.net/), ~~54~~ 48 bytes
```
for(;$i++<1e3;){print$i%(2+true)?$i:'FizzBuzz';}
```
[Try it online!](https://tio.run/##K8go@G9jXwAk0/KLNKxVMrW1bQxTja01qwuKMvNKVDJVNYy0S4pKUzXtVTKt1N0yq6qcSquq1K1r//8HAA "PHP – Try It Online")
Simple: uses PHP's auto conversion from boolean `true` to integer `1` while PERL doesn't
EDIT: saved 3 bytes with a leading space separator instead of a trailing one
EDIT2: saved 6 bytes by removing the separator
[Answer]
# JavaScript/PHP 5.4+, ~~83~~ 81 bytes
This was a somewhat simple, but fun challenge.
The code is really simple (outputs to the console in JavaScript and to stdout in PHP with `-r`):
```
for($i=0;$i<1e3;)[console.log,'printf'][+![]]("%s\n",++$i%(2+![])?$i:'FizzBuzz');
```
For JavaScript, outputs FizzBuzz on even numbers, while in PHP outputs in multiples of 3.
---
The code picks which function to call to output the value based on `+![]` (previously `+!'0'`).  
An empty array (`[]`) (previously was `'0'` - a string with 0) is a truthy value in JavaScript, but a falsy value in PHP.  
An array is an object in JavaScript, and all objects are truthy in JavaScript.  
Using this, one can do `![]` to detect if the code is in JavaScript (`false`) or PHP (`true`).  
Since Javascript would coerce `false` to a string, the `+` is needed to ensure it is a numeric value.
Using this same value, one can just do `2+![]`, resulting in `3` for PHP (`2+!false` = `2+true` = `3`) and `2` for JavaScript (`2+!true` = `2+false` = `2`).  
That value is then used to check if it is a multiple.
The `$i=0` is required because JavaScript will throw an `Uncaught ReferenceError: $i is not defined`.
The `\n` in the output can't be replaced because newlines are line terminators in JavaScript, causing a syntax error if replaced with an actual newline.  
Without the `\n`, PHP would output `"12FizzBuzz45FizzBuzz[...]"`.  
JavaScript's console ignores it just fine.
[Answer]
# [Zsh](https://www.zsh.org/) `+X`/[Bash](https://www.gnu.org/software/bash/), 58 bytes
```
for i in {1..1000};{ ((i%${#-}))&&echo $i||echo FizzBuzz;}
```
[Try it online!](https://tio.run/##qyrO@J@cWKJgp5CSmpuvYGOjoO7q76b@Py2/SCFTITNPodpQT8/QwMCg1rpaQUMjU1WlWlm3VlNTTS01OSNfQSWzpgbMcMusqnIqraqyrv0P1M/FlZRYnAE2kqsKyNCOALP/AwA "Zsh – Try It Online")
This uses the `$-` parameter, which holds some options used by the shell. By default, it is `569X` in Zsh, and `hB` in Bash. Unsetting the `-X` option in Zsh results in a parameter of `569`. Since `${#-}` is the length of that parameter in both Bash and Zsh, we `%2` in Bash and `%3` in Zsh.
---
# [Zsh](https://www.zsh.org/)/[Bash](https://www.gnu.org/software/bash/), 65 bytes
```
a=(2 3)
for i in {1..1000};{ ((i%a[1]))&&echo $i||echo FizzBuzz;}
```
Zsh: [Try it online!](https://tio.run/##qyrO@P8/0VbDSMFYkystv0ghUyEzT6HaUE/P0MDAoNa6WkFDI1M1MdowVlNTTS01OSNfQSWzpgbMcMusqnIqraqyrv3/HwA "Zsh – Try It Online")
Bash: [Try it online!](https://tio.run/##S0oszvj/P9FWw0jBWJMrLb9IIVMhM0@h2lBPz9DAwKDWulpBQyNTNTHaMFZTU00tNTkjX0Els6YGzHDLrKpyKq2qsq79/x8A "Bash – Try It Online")
Zsh arrays are one-indexed, Bash arrays are zero-indexed. The surrounding `{ }` in the loop are needed in Bash, not in Zsh.
---
Normally, [options count as different languages](https://codegolf.meta.stackexchange.com/a/14339/86147). However, there is potential for abuse where the options are visible in a parameter. (Ab)Using the `$-` parameter in Zsh allows for [a **50 byte** program runnable in 45 "languages"](https://tio.run/##ZZDbTsJAEIbv@xRf0krbIKQcPKQBL4igMSqejd41ZbENtmu6RbTAs9cWEGLczMXO/81M/plMBbnvpZwwEpGsZyqg08HsDwdmPpYJIda8Ua83HMdZ2pYV7hl6zbYrFeEHEiNcLFafQZhlvWmW5UWfppVDaj7muqZmappO3/MD5Jg0EEoQKry4CDUTyT7T2JdRJOKUVKKEcMuGa7o0XU0vh1UPDrf2fllry/6h9gbt9HITH@uiwA/M6HPKC/c0GTOgzTEtzrgh4A2PEQ5DjpjwyC0NzrnkmTueEHzyxTfvfJCQ0uPKnqMzkrGZMpPJxCUm4hWlUTz5kVa7hq@tko03qhh6Ady1uLqVUeQ7t8vNBf@o@Q8) (N = 2..46)
[Answer]
# [Perl 5](https://www.perl.org/), ~~60~~ 54 bytes
```
for(;$i++<1e3;){print$i%(-1**2+3+true)?$i:'FizzBuzz';}
```
[Try it online!](https://tio.run/##K0gtyjH9/z8tv0jDWiVTW9vGMNXYWrO6oCgzr0QlU1VD11BLy0jbWLukqDRV014l00rdLbOqyqm0qkrduvb/fwA "Perl 5 – Try It Online")
# [PHP](https://php.net/), ~~60~~ 54 bytes
```
for(;$i++<1e3;){print$i%(-1**2+3+true)?$i:'FizzBuzz';}
```
[Try it online!](https://tio.run/##K8go@G9jXwAk0/KLNKxVMrW1bQxTja01qwuKMvNKVDJVNXQNtbSMtI21S4pKUzXtVTKt1N0yq6qcSquq1K1r//8HAA "PHP – Try It Online")
# [Perl 4](https://www.perl.org/), ~~60~~ 54 bytes
```
for(;$i++<1e3;){print$i%(-1**2+3+true)?$i:'FizzBuzz';}
```
[Try it online!](https://tio.run/##K0gtyjH5/z8tv0jDWiVTW9vGMNXYWrO6oCgzr0QlU1VD11BLy0jbWLukqDRV014l00rdLbOqyqm0qkrduvb/fwA "Perl 4 – Try It Online")
Another answer, a bit longer with 3 languages!!!
still the same difference with `true` between PHP and PERL, but in PERL 5 and PHP `**` takes precedence over the opposite operator `-`, while the contrary in PERL 4
EDIT: saved 6 bytes by removing the separator
[Answer]
# R (various versions); 74,626 languages; 61 bytes
```
z=1:1000;z[z%%as.double(R.version$`svn rev`)==0]="fizzbuzz";z
```
This answer may be ruled to be illegal depending on whether different svn revisions count as different languages or not.
(Is there a more efficient way to convert text to numeric than `as.double` that will work with the oldest versions of R? I feel like there is, but I cannot remember it.)
This program will continue to work as long as R continues to release versions and the number of languages will increase. I ran this using R 3.5.0.
Haven't included 74,626 TIO links for obvious reasons. [here](https://tio.run/##K/r/v8rW0MrQwMDAuiq6SlU1sVgvJb80KSdVI0ivLLWoODM/TyWhuCxPoSi1LEHT1tYg1lYpLbOqKqm0qkrJuur/fwA) is one for a recent version of R, but it is not very interesting as it is >1000 in the list, so there are no actual instances of fizzbuzz.
[Answer]
# [Befunge-98](https://github.com/catseye/FBBI) / [Befunge-93](https://github.com/catseye/FBBI), 55 bytes
```
1+:.:"}"8*-!#@_5j$1+:.1+" zzuBzziF",,,,,,,,,:"}"8*-!#@_
```
[Try it in 98!](https://tio.run/##S0pNK81LT9W1tPj/31DbSs9KqVbJQktXUdkh3jRLBSRiqK2kUFVV6lRVlemmpAMDSOr@/wcA "Befunge-98 (FBBI) – Try It Online")
[Try it in 93!](https://tio.run/##S0pNK81LT9W1NNZNS0rK/P/fUNtKz0qpVslCS1dR2SHeNEsFJGKoraRQVVXqVFWV6aakAwNI6v7/BwA "Befunge-93 (FBBI) – Try It Online")
This is based on the introduction of `j`ump in Befunge 98. By jumping in 98 the part `1+:.` (add `1`, duplicate, print) is only executed in Befunge 93.
[Answer]
# [C 89 (gcc)](https://gcc.gnu.org/)/[C 99 (gcc)](https://gcc.gnu.org/) 64 bytes
```
i;main(){while(i++<1e3)printf(i%(2//**/
+1)?"%d":"FizzBuzz",i);}
```
[Try online (C 89)](https://tio.run/##S9ZNT07@/z/TOjcxM09Ds7o8IzMnVSNTW9vGMNVYs6AoM68kTSNTVcNIX19LS59L21DTXkk1RclKyS2zqsqptKpKSSdT07r2//9/yWk5ienF/3UT84ozAQ)  
[Try online (C 99)](https://tio.run/##S9ZNT07@/z/TOjcxM09Ds7o8IzMnVSNTW9vGMNVYs6AoM68kTSNTVcNIX19LS59L21DTXkk1RclKyS2zqsqptKpKSSdT07r2//9/yWk5ienF/3WLS1Jsky0tAQ)
**Explanation:**  
You can find an explanation on how this works [here](https://stackoverflow.com/a/12890117/10147399).
[Answer]
# [Io](http://iolanguage.org/)/[Erlang (escript)](http://erlang.org/doc/man/escript.html), 134 bytes
Outputs a string as a list of codepoints in Erlang. Halts with an error in Io.
```
1%1+1000 repeat(i,if((i+1)%2<1,"FizzBuzz",i+1)println)
main(_)->io:write([if I rem 3<1->"FizzBuzz";1<2->I end||I<-lists:seq(1,1000)]).
```
[Try it online! (in Io)](https://tio.run/##RY1BCsMgEADvfYUEAivR4qa3VDz0EPANpZRADSwkJlVLQPJ325x6HZgZWkrBGhtUSrHgVjckIEEjADXI61ajqHrK@fbJuRIHWwP5NHl@mgfy8OTS0NJtgZKDO43M/iozu2iU5i9eUbfSWOb8a9@tlhPFFLvo3oDiOPMHP5fyBQ)
[Try it online! (in Erlang)](https://tio.run/##RY1BCsIwEADvviIUCglNJFtvbejBg5A3iEjRrSyksSYRIfTv0Z68DswMBjf6h8J4C7SkUqCGBrTWLOCCY@IkaeKcGhB1a0BWJ8r5@M65khtbAvnkvNjNI3l@FWqgZ/cJlJCfaWL2V5nZwYAa/mIPplWDZejv62qNchRT7CK@OMjtLC5iX8oX "Erlang (escript) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 58 bytes
```
for(i=0;i++<1e3;)console.log(i%(2+(this>{}))?i:'FizzBuzz')
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/Lb9II9PWwDpTW9vGMNXYWjM5P684PydVLyc/XSNTVcNIW6MkI7PYrrpWU9M@00rdLbOqyqm0qkpd8/9/AA "JavaScript (Node.js) – Try It Online")
# [JavaScript (V8)](https://v8.dev/), 58 bytes
[Try it online!](https://tio.run/##y0osSyxOLsosKNEts/j/Py2/SCPT1sA6U1vbxjDV2FozOT@vOD8nVS8nP10jU1XDSFujJCOz2K66VlPTPtNK3S2zqsqptKpKXfP/fwA "JavaScript (V8) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~136~~ ~~133~~ 130 bytes
Saved 3 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!!!  
Saved 3 bytes thanks to [Abhay Aravinda](https://codegolf.stackexchange.com/users/94904/abhay-aravinda)!!! 
```
#define print(a)i;main(){for(;i++<1e3;)printf(i%3?"%d":"FizzBuzz",i);}
print(''.join(i%2and`i`or"FizzBuzz"for i in range(1,1001)))
```
[Try it online!](https://tio.run/##RYy7CsIwFIZ3nyJEQnNokabdjCA4@BwNJNFf8KSEOhjx2WPRwfm7zM/lmniodetDBAcxZ/CiHcHeHVjTK6asLdr2YMJo6YujhhqPUnm5l2eUcnqUIjuQfW9@edPsbmmtoQbHfsKU8l9chwICLLLjS9CmM31viKjWDw "Python 2 – Try It Online")
# [C (gcc)](https://gcc.gnu.org/), ~~136~~ ~~133~~ 130 bytes
Saved 3 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!!!  
Saved 3 bytes thanks to [Abhay Aravinda](https://codegolf.stackexchange.com/users/94904/abhay-aravinda)!!! 
```
#define print(a)i;main(){for(;i++<1e3;)printf(i%3?"%d":"FizzBuzz",i);}
print(''.join(i%2and`i`or"FizzBuzz"for i in range(1,1001)))
```
[Try it online!](https://tio.run/##RYy7CsIwFIZ3nyJESnNolcZuRhAcfI6GXMov9ESCLhGfPRYdnL@L283O1br1IYKDuGfwQ1mCWSxY0SumrAy67qTDaOiLo0IznmXj5VFeUcrlWYrsQea9@eVtu7@ltUZzsOwnTCn/xXUoIMAiW56D0r0eBk1EtX4A "C (gcc) – Try It Online")
[Answer]
# Bash/Perl, 96 bytes
```
eval 'for i in `seq 500`;do echo $((i*2-1))FizzBuzz;done;exit';print$_%3?$_:FizzBuzz for 1..1000
```
This is based on an old Perl trick to get a Perl program to run as Perl, if executed as it were a shell program. If executed in either language, it takes the argument to `eval`, and tries to execute it (Bash) or compile, then execute it (Perl). When run as Bash, it dutifully execute the code, printing the numbers, replacing every second number with FizzBuzz, then exits. Perl, OTOH, tries to compile the string, which fails. It then carries on the execute the second statement, printing out the numbers, replacing every third with FizzBuzz.
Since non-empty separators are allowed, when executed in Bash, there will only be newlines after each FizzBuzz, while when executed in Perl, no whitespace will be outputted at all.
[Try it online!](https://tio.run/##S0oszvj/P7UsMUdBPS2/SCFTITNPIaE4tVDB1MAgwTolXyE1OSNfQUVDI1PLSNdQU9Mts6rKqbSqCiiVl2qdWpFZom5dUJSZV6ISr2psrxJvBVOgADLOUE/P0MDA4P9/AA "Bash – Try It Online") (Bash)
[Try it online!](https://tio.run/##K0gtyjH9/z@1LDFHQT0tv0ghUyEzTyGhOLVQwdTAIME6JV8hNTkjX0FFQyNTy0jXUFPTLbOqyqm0qgoolZdqnVqRWaJuXVCUmVeiEq9qbK8SbwVToAAyzlBPz9DAwOD/fwA "Perl 5 – Try It Online") (Perl)
[Answer]
# Perl -M5.010/C (gcc -w), 112 bytes
```
//;say$_*2-1,Fizzbuzz for 1..500;<<'}';
main(){for(int i=1;i<1001;i++){i%3?printf("%d",i):printf("FizzBuzz");}
}
```
[Try it online!](https://tio.run/##S9ZNT07@/19f37o4sVIlXstI11DHLbOqKqm0qkohLb9IwVBPz9TAwNrGRr1W3ZorNzEzT0OzGiihkZlXopBpa2idaWNoYACktLU1qzNVje0LioAyaRpKqilKOpmaVjAuyFAnoKFKmta1XLX///9LTstJTC/@r1sOAA "C (gcc) – Try It Online") (C)
[Try it online!](https://tio.run/##K0gtyjH9/19f37o4sVIlXstI11DHLbOqKqm0qkohLb9IwVBPz9TAwNrGRr1W3ZorNzEzT0OzGiihkZlXopBpa2idaWNoYACktLU1qzNVje0LioAyaRpKqilKOpmaVjAuyFAnoKFKmta1XLX////LLyjJzM8r/q/ra6pnYGgAAA "Perl 5 – Try It Online") (Perl)
This hides the Perl code behind a C++ style comment, and the C code inside a Perl here doc, using the final character of the C code as the here doc terminator. The C++ style comment marker looks like an empty regular expression to Perl, which happily executes it, to no visible effect. Just as the here doc which is in void context.
The C version does not print any whitespace, the Perl version prints a newline after each `FizzBuzz`.
[Answer]
# Befunge-93/Perl -M5.010, 125108 Bytes
```
#  v            .:  <>
say $_*2-1,# >:1+:3%|
#  >:8555***-|
             @
,,,,,,,,"FizzBuzz" #<^
for 1..500
```
[Try it online!](https://tio.run/##S0pNK81LT/3/X1lBoUwBCehZKSjY2HEVJ1YqqMRrGeka6igr2FkZalsZq9ZwARXbWVmYmppqaWnp1nAh61Nw4NKBAiW3zKoqp9KqKiUFZZs4rrT8IgVDPT1TA4P//wE "Befunge-93 – Try It Online")
[Try it online!](https://tio.run/##K0gtyjH9/19ZQaFMAQnoWSko2NhxFSdWKqjEaxnpGuooK9hZGWpbGavWcAEV21lZmJqaamlp6dZwIetTcODSgQIlt8yqKqfSqiolBWWbOK60/CIFQz09UwOD////5ReUZObnFf/X9TXVMzA0AAA "Perl 5 – Try It Online")
This can probably easy golfed down further, but I'm far from a Befunge expert. This code cannot be separated into different pieces of code, where each language ignores the part written in the different language -- the `,,,,,,,,"FizzBuzz"` section is used by both Perl and Befunge.
To explain it further, what Perl sees, after removing the comments, is:
```
say $_*2-1,,,,,,,,,"FizzBuzz" for 1..500
```
and what Befunge sees is:
```
#  v            .:  <>
             >:1+:3%|
   >:8555***-|
             @
,,,,,,,,"FizzBuzz" #<^
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~132~~ ~~128~~ ~~101~~ ~~99~~ ~~84~~ ~~82~~ 81 bytes
```
main(){for(int i;i++<1e3;)__builtin_printf(i%(2+sizeof'a'%2)?"%d":"fizzbuzz",i);}
```
[Try it online!](https://tio.run/##DclBCoAgFAXAq4QgKdYi22XQUaRM40FZlG1@dHZrtuPqxbmctxFRyCfsp0BMBQyU6hvfGmntdGNNiPY4/woCXGh1gfweyrHkWg6Mz6xjAUTTTcQqSPPm/AE "C (gcc) – Try It Online")
# [C++ (gcc)](https://gcc.gnu.org/), ~~132~~ ~~128~~ ~~101~~ ~~99~~ ~~84~~ ~~82~~ 81 bytes
```
main(){for(int i;i++<1e3;)__builtin_printf(i%(2+sizeof'a'%2)?"%d":"fizzbuzz",i);}
```
[Try it online!](https://tio.run/##DclLCoAgFAXQrYQgKdYgm2XQUqRM40KZ9Jm8aO3WmR6XUr04l/M2Igr5hP0QiFcBA6X6xrdGWjvdWC9Em46/ggAXWp0gv4dyLLmWA@Mz61gA0XQTsQrSvDl/ "C++ (gcc) – Try It Online")
~~-27~~ -28 bytes from ceilingcat (plus another inspired by ceiling cat)
-15 bytes from Ayxan
[Answer]
# [JavaScript (Node.js)](https://nodejs.org) / [Ruby](https://www.ruby-lang.org/) / [Python 2](https://docs.python.org/2/) / [Python 3](https://docs.python.org/3/) / [Perl 5](https://www.perl.org/) / [PHP](https://php.net/) + `-d short_open_tag=on -d output_buffering=on` / [Bash](https://www.gnu.org/software/bash/), 311 bytes
```
s=0;f='FizzBuzz';0//1;'''=;y=/.__id__;eval"s+=1;puts s%3>0?s:f;"*1e3;%q}<?ob_end_clean();$i=+1;for(;$i<1e3;){print((++$i%(6+true)?$i:FizzBuzz)."
");};die;#?>";while(s<1e3)console.log(++s%2?s:f)//';for i in {1..1000};{ a=($f);echo ${a[((i%8))]:-$i};} #''';exec('s+=1;print(s if s%(5if 3/2>1else 4)else f);'*1000)
```
[Try them all online!](https://tio.run/##NVHbjpswEH3nK0YsyPYibkm3qjIhkaq2j/2BqkJchmCJ2hRDt0mab09tdvM0x6PxnMvUlenvI00DxCMBa3r9awTZAemOwQGSRrcE@z37@v0Lu5siw65g3@Tl8nm5XBhmaZojY6zAc5EmZSnbskT6Uw2@iYocx2U2YMLtITuaXYf@c05bDH/f9kddl6TashmoUlxgIIsox05P3MK9mxLXcZJq5jyKAhnyj9E8LSSOgdw92EXie77AG7aS8Ol48PG1lwNx4/6LRiujB0oGfbIrTLhxCkSaMscCEqSCa54keZZlN7xCVfCgE0jWPwTX6gfnMvwkxM9dHMgb3uDJmkT6Sw1nb85WccYlZUL@Yss23RxyGgzBB7EWu449u/3ibsPzvNcG4uYtUPQ8p2Kc9MkJUS7jaanPMJ7nXqvNe93Cehh/7EeIWzC9nuZSj6TKuToVWrmmXmabclkvXUdWk2v7UNujIrTaA1gd@YGj8tG@V/R@1n/QU9VCrGDzgo/ZJEkeGL1WK7r/Bw) (truncates to the first 25 lines of each language)
I know there's no benefit to adding more languages, but I enjoyed this so thought I'd have a try at adding a few. Overall I'd like to share more of the code if possible, but the different looping structures make it pretty tricky. I'm sure there's a way I could share the Python and Ruby code to reduce some bytes, so I'll play with that more next.
# [JavaScript (Node.js)](https://nodejs.org) (with comments and unused strings removed)
```
s=0;f='FizzBuzz';0
while(s<1e3)console.log(++s%2?s:f)
```
# [Ruby](https://www.ruby-lang.org/) (with comments and unused strings removed)
```
s=0;f='FizzBuzz';0//1;'''=;y=/.__id__;eval"s+=1;puts s%3>0?s:f;"*1e3;die;
```
`0//1;.../.__id__;`: this is `0` `/` `/1;.../.__id__` where `/1;.../` is a RegExp and the `__id__` property is just a short property that exists on the RegExp object that returns a number to prevent a type error. This uses string repetition and `eval` as it was slightly shorter (but a true Rubyist might be able to correct me!).
# [Python 2](https://docs.python.org/2/) / [Python 3](https://docs.python.org/3/) (with comments and unused strings removed)
```
s=0;f='FizzBuzz';0//1;exec('s+=1;print(s if s%(5if 3/2>1else 4)else f);'*1000)
```
This uses the classic floored integer division check for Python 2 vs. 3 and string repetition the same as Ruby because it was shorter (although, again, any Pythonistas please feel free to correct me!)
# [Perl 5](https://www.perl.org/) + `-M5.10.0` (with unused strings removed/truncated)
```
s=...=...=;y=...=...=+1;for(;$i<1e3;){print((++$i%(6+true)?$i:FizzBuzz)."
");};die;
```
This uses [Perl's `s///` and `y///` (`tr///`) operators](https://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators) to ignore most of the code. This is the same code as is used for PHP and works because there's no `true` in Perl, so the bareword `true` evaluates to `0`.
# [PHP](https://php.net/) + `-d short_open_tag=on -d output_buffering=on` (with non-executed code removed)
```
<?ob_end_clean();$i=+1;for(;$i<1e3;){print((++$i%(6+true)?$i:FizzBuzz)."
");};die;#?>
```
A bit cheaty, but uses a pretty well known technique of the `output_buffering` option and [`ob_end_clean()`](https://www.php.net/manual/en/function.ob-end-clean.php) to discard the content before the first `<?`, then `die;#?>` before the rest of the program is parsed, basically 'hiding' the PHP program within strings and comments of the others. The majority of this code is shared with Perl.
# [Bash](https://www.gnu.org/software/bash/) (with comments and unused strings removed)
```
s=0;f='FizzBuzz';0//1;for i in {1..1000};{ a=($f);echo ${a[((i%8))]:-$i};}
```
Because of how variables are set in Bash (`var=value`) we can share `f='FizzBuzz'` from the JavaScript, Ruby, Python code, but it's pretty much just on its own. The useful thing with Bash is that `'''` isn't a syntax error, it's just concatenating an empty string and the start of a new string, so Bash pretty much just 'ignores' (executes and returns an error) all the code and it's relatively easy to find a space to drop it into.
[Answer]
# [Python 2](https://docs.python.org/2/) / [Python 3](https://docs.python.org/3/) / [Octave](https://www.gnu.org/software/octave/), 109 bytes
This is an add-on to @ElPedro's [answer](https://codegolf.stackexchange.com/a/204658/73613), adding Octave to his clever solution for Python 2 and 3.
```
x=1000;
while x>0%1:print((x,'FizzBuzz')[x%(3/2*2)<1]);x-=1;"""
printf('%d FizzBuzz %d ',x,x-1)
x-=3;
end%"""
```
[Try it online!](https://tio.run/##K6gsycjPM/r/v8LW0MDAwJqrPCMzJ1Whws5A1dCqoCgzr0RDo0JH3S2zqsqptKpKXTO6QlXDWN9Iy0jTxjBW07pC19bQWklJiQusNk1DXTVFAaZYAchW16nQqdA11OQCKjS25krNS1EFqv7/HwA "Python 2 – Try It Online") (Python 2)
[Try it online!](https://tio.run/##K6gsycjPM/7/v8LW0MDAwJqrPCMzJ1Whws5A1dCqoCgzr0RDo0JH3S2zqsqptKpKXTO6QlXDWN9Iy0jTxjBW07pC19bQWklJiQusNk1DXTVFAaZYAchW16nQqdA11OQCKjS25krNS1EFqv7/HwA "Python 3 – Try It Online") (Python 3)
[Try it online!](https://tio.run/##y08uSSxL/f@/wtbQwMDAmqs8IzMnVaHCzkDV0KqgKDOvREOjQkfdLbOqyqm0qkpdM7pCVcNY30jLSNPGMFbTukLX1tBaSUmJC6w2TUNdNUUBplgByFbXqdCp0DXU5AIqNLbmSs1LUQWq/v8fAA "Octave – Try It Online") (Octave)
]