public void fizzbuzz() {
for (int i = 1; i<= 100; i++) {
if (i == 1) System.out.println(i);
if (i == 2) System.out.println(i);
if (i == 3) System.out.println("Fizz");
if (i == 4) System.out.println(i);
if (i == 5) System.out.println("Buzz");
if (i == 6) System.out.println("Fizz");
if (i == 7) System.out.println(i);
if (i == 8) System.out.println(i);
if (i == 9) System.out.println("Fizz");
if (i == 10) System.out.println("Buzz");
if (i == 11) System.out.println(i);
if (i == 12) System.out.println("Fizz");
if (i == 13) System.out.println(i);
if (i == 14) System.out.println(i);
if (i == 15) System.out.println("FizzBuzz");
...
}
}
>>57148565
perfect buzzing of fizz.
>>57148565
/* [s4s] PUBLIC LICENSE
* Version 1, December 2022
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* [s4s] PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You can do whatever is eric, ebin, or nice
* 1. The definitions of `eric', `ebin', and `nice' are up to you
* 2. :^) */
int main(int argc, char* argv[])
{
char asdf[15];
strncpy(asdf, "nnfnbfnnfbnnfnnx", 15);
/* note: null terminator not required here */
int ii;
for (ii = 1; ii <= 100; ++ii) {
switch (asdf[ii%15]) {
case 'n':
printf("%d\n", ii);
break;
case 'f':
printf("Fizz\n");
break;
case 'b':
printf("Buzz\n");
break;
default:
printf("FizzBuzz\n");
}
}
return 0;
}
>>57148565#include<stdio.h>
void main() {
const char *vars[] = { "%d ","Fizz ","Buzz ","FizzBuzz " };
for (int i = 1; i < 101; ++i)
printf(vars[(i % 3 == 0) + (i % 5 == 0)*2], i);
}
>>57149034
Should be \n instead of spaces but you got the idea.
#include <type_traits>
#include <limits>
#include <iterator>
#include <algorithm>
#include <string>
#include <iostream>
template< typename T >
using integral_iterator_base_t = std::enable_if_t< std::numeric_limits< T >::is_integer, std::iterator< std::random_access_iterator_tag, T, std::ptrdiff_t, T, T > >;
template< typename T >
class integral_iterator_t : public integral_iterator_base_t< T >
{
using base_t = integral_iterator_base_t<T>;
typename base_t::value_type m_value;
public:
integral_iterator_t() = default;
integral_iterator_t( decltype( m_value ) const& value ) : m_value{ value } {}
operator auto const& () const { return m_value; }
operator auto& () { return m_value; }
typename base_t::reference operator* () const { return *this; }
};
int main()
{
using uint_iterator_t = integral_iterator_t< unsigned >;
std::transform( uint_iterator_t{ 1 }, uint_iterator_t{ 35 }, std::ostream_iterator< std::string >{ std::cout, ", " },
[]( auto const& value )
{
static std::string lut[] = { {}, "Fizz", "Buzz", lut[ 1 ] + lut[ 2 ] };
lut[ 0 ] = std::to_string( value );
return lut[ !( value % 3 ) + ( !( value % 5 ) << 1) ];
} );
}
>>57149443
Okay why the fuck do you have to make this paragraph so fucking long.
>>57149636
what do you mean? all I did was making it modular and scalable
listBox1.Items.Clear();
for (int i = 1; i < Convert.ToInt32(textBox1.Text) + 1; i++)
{
if (i % 15 == 0)
{
listBox1.Items.Add( i + " Fizz Buzz");
}
else if (i % 5 == 0)
{
listBox1.Items.Add( i + " Buzz");
}
else if ( i % 3 == 0)
{
listBox1.Items.Add( i + " Fizz");
}
else
{
listBox1.Items.Add(i);
}
[/code[
i % 15 == 0 ? writeOnScreenInYourLanguage("FizzBuzz") : i % 5 == 0 ? writeOnScreenInYourLanguage("Buzz") : i % 3 == 0 ? writeOnScreenInYourLanguage("Fizz") : writeOnScreenInYourLanguage(i);
for i in range(1,101): print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)
for i in range(1, 101):
if i % 3 == 0 and i % 5 == 0 :
print("Fizz Buzz")
elif i % 5 == 0 :
print("Buzz")
elif i % 3 == 0 :
print("Fizz")
else :
print(i)
/ 'B' @=@@=@@++++#
// / 'u' @@@@@=@+++++#
// // / 'z' @=@@@@+@++++#
// // // / 'i' @@@@@@=+++++#
// // // // / 'F' @@@=@@+++++#
// // // // // / LF ++++++++++#
// // // // // // / 100 @@@=@@@=++++#
$@/>@/>@/>@/>@/>@/>@/\ 0
/ /
! /======= Fizz <<<.<.<..>>>#
/ | \
\?!#->+ @\.>?!#->+ @\.>?!#->+@/.>\ |
/ ! ! ! / |
\?!#->+ @\.>?!#->+@\ .>?!#->+@/.>\ |
/ ! \!===\! ! / |
\?!#->+ @\.>?!#->+ @\.>?!#->+@/.>\ |
/ ! ! | ! / |
\?!#->+@\ .>?!#->+ @\.>?!#->+@/.>\ |
/ \!==========!===\! ! / |
\?!#->+ @\.>?!#->+ @\.>?!#->+@/>>@\.>/
! | | |
/==========/ \========!\=== Buzz <<<<<<<.>.>..>>>#
|
\!/=dup==?\>>@\<!/back?\<<<#
\<<+>+>-/ | \>+<- /
|
/======================/
|
| /recurse\ #/?\ zero
\print=!\@\>?!\@/<@\.!\-/
| \=/ \=itoa=@@@+@+++++#
! /+ !/+ !/+ !/+ \ mod10
/<+> -\!?-\!?-\!?-\!?-\!
\?!\-?!\-?!\-?!\-?!\-?/\ div10
# +/! +/! +/! +/! +/
Now do it without standard libraries you cucks.
>>57150211
Is that befunge?
>>57150248
https://esolangs.org/wiki/SNUSP
local countUpper = 500
local NEWLINE = "\n"
for i = 1, countUpper do
if i % 3 == 0 then
io.write("fizz")
end
if i % 5 == 0 then
io.write("buzz")
end
if not (i % 3 == 0 or i % 5 == 0) then
io.write(tostring(i))
end
io.write(NEWLINE)
end
>>57150307
ugly as fuck tbqh senpai
#include fizzbuzz
fizzbuzz();
<font face="arial" size="2" color="black">1<br>
2<br>
fizz<br>
4<br>
buzz<br>
fizz<br>
7<br>
8<br>
...
</font>
print+(Fizz)[$_%3].(Buzz)[$_%5]||$_,$/for 1..100
>>57150403
also ugly
>>57150421
>43 bytes
>ugly
I beg your pardon
fb = map f [1..100]
f x = case (mod x 3, mod x 5) of
(0,0) -> "FizzBuzz"
(0,_) -> "Fizz"
(_,0) -> "Buzz"
(_,_) -> show x
>>57150454
Just because something doesn't take up a lot of space, doesn't mean it's pretty.
>>57150879
Found the fatty.
++++++++++[>++++++++++<-]>>++++++++++>->>>>>>>>>>>>>>>>-->+++++++[->++
++++++++<]>[->+>+>+>+<<<<]+++>>+++>>>++++++++[-<++++<++++<++++>>>]++++
+[-<++++<++++>>]>>-->++++++[->+++++++++++<]>[->+>+>+>+<<<<]+++++>>+>++
++++>++++++>++++++++[-<++++<++++<++++>>>]++++++[-<+++<+++<+++>>>]>>-->
---+[-<+]-<[+[->+]-<<->>>+>[-]++[-->++]-->+++[---++[--<++]---->>-<+>[+
+++[----<++++]--[>]++[-->++]--<]>++[--+[-<+]->>[-]+++++[---->++++]-->[
->+<]>>[.>]++[-->++]]-->+++]---+[-<+]->>-[+>>>+[-<+]->>>++++++++++<<[-
>+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>>[-]>>>++++++++++<[->-[>+>>]>[+[-<+>]>
+>>]<<<<<]>[-]>>[>++++++[-<++++++++>]<.<<+>+>[-]]<[<[->-<]++++++[->+++
+++++<]>.[-]]<<++++++[-<++++++++>]<.[-]<<[-<+>]+[-<+]->>]+[-]<<<.>>>+[
-<+]-<<]
>>57150897
At 57kg, I'd say I'm quite a healthy weight.
HAI 1.3
IM IN YR fizz UPPIN YR i TIL BOTH SAEM i AN 100
I HAS A i ITZ SUM OF i AN 1 BTW, ALL LUPZ START AT 0 :/
I HAS A mod3 ITZ NOT MOD OF i AN 3
I HAS A mod5 ITZ NOT MOD OF i AN 5
mod3, O RLY?, YA RLY, VISIBLE "Fizz"!, OIC
mod5, O RLY?, YA RLY, VISIBLE "Buzz"!, OIC
NOT EITHER OF mod3 AN mod5, O RLY?
YA RLY, VISIBLE i!
OIC
VISIBLE ""
IM OUTTA YR fizz
KTHXBYE
>>57150879
>he doesn't appreciate the beauty in efficiency
>>57150917
>Implying a skelly manlet's opinion matter to me
>>57151013
>skelly
>>57148889
What's the definition of 'eric' to you, anon?
>>57150937
use of lolcode AND elimination of the string "fizzbuzz", I'm in love.
>>57148565for x in range(-1000000, 10000000):
if x%3 == 0 or x%5 == 0:
if x%3 == 0:
print('Fizz')
if x%5 == 0:
print('Buzz')
else:
print(x)
>>57151158
it's up to you
>>57150357
I'm using this from now on
>>57151212
>What's the definition of 'eric' to you
>to you
So it's up to me to decide what is the definition of 'eric' to him? This license is confusing...
>>57149684
>what do you mean? all I did was making it modular and scalable
absolutely beautiful anon, it's great
>>57150238
you do realize we're on several layers of irony and just posting enterprise-grade solutions?