FizzBuzz/EsoLang

From Rosetta Code
FizzBuzz/EsoLang is part of FizzBuzz. You may find other members of FizzBuzz at Category:FizzBuzz.
FizzBuzz, done in several esoteric languages.



beeswax[edit]

Simple solution:

               >     q
>@F5~%"[email protected]{ > @F q
_1>[email protected]~%'d >[email protected]
 ;bL@~.~4~.5~5@ P<

More clever solution, checking n%5 only on one path:

                            >@?q
> q >Ag'd@{?p
_>"1F3~%'d`Fizz`f>@[email protected]
b P~;"-~@[email protected]?<

Befunge[edit]

(befunge 93)

55*4*v    _   v                                                                 
v <>:1-:^
|:<$ < ,*48 <
@>0"zzif">:#,_$ v
>:3%!| >0"zzub">:#,_$^
>:5%!|
v "buzz"0<>:. ^
|!%5: <
>:#,_ $> ^

Brainf***[edit]

FizzBuzz
 
Memory:
Zero
Zero
Counter 1
Counter 2
 
Zero
ASCIIDigit 3
ASCIIDigit 2
ASCIIDigit 1
 
Zero
Digit 3
Digit 2
Digit 1
 
CopyPlace
Mod 3
Mod 5
PrintNumber
 
TmpFlag
 
Counters for the loop
++++++++++[>++++++++++[>+>+<<-]<-]
 
Number representation in ASCII
>>>>
++++++++ ++++++++ ++++++++ ++++++++ ++++++++ ++++++++ [>+>+>+<<<-]
<<<<
 
>>
[
Do hundret times:
 
Decrement counter
->->
 
Increment Number
> >>+>
> >>+>
<<<<
<<<<
 
Check for Overflow
++++++++++
>>> >>>>
>++++++++++<
[-<<< <<<<->>>> >>> >-<]
++++++++++
<<< <<<<
 
Restore the digit
[->>>> >>>-<<< <<<<]
>>>> [-]+ >>>>[<<<< - >>>>[-]]<<<< <<<<
 
If there is an overflow
>>>>[
<<<<
 
>>>----------> >>>----------<+<< <<+<<
 
Check for Overflow
++++++++++
>> >>>>
>>++++++++++<<
[-<< <<<<->>>> >> >>-<<]
++++++++++
<< <<<<
 
Restore the digit
[->>>> >>-<< <<<<]
>>>> [-]+ >>>>[<<<< - >>>>[-]]<<<< <<<<
 
If there (again) is an overflow
>>>>[
<<<<
>>---------->> >>----------<+< <<<+<
 
>>>>
[-]
]<<<<
 
>>>>
[-]
]<<<<
 
>>>> >>>>
 
Set if to print the number
>>>[-]+<<<
 
Handle the Mod 3 counter
[-]+++
 
>>>>[-]+<<<<
>+[-<->]+++<
[->->>>[-]<<<<]
>>>>[
<[-]>
 
[-]
Print "Fizz"
++++++++ ++++++++ ++++++++ ++++++++
++++++++ ++++++++ ++++++++ ++++++++
++++++.
 
++++++++ ++++++++ ++++++++ ++++++++
+++.
 
++++++++ ++++++++ +..
 
[-]
<<<--->>>
]<<<<
 
Handle the Mod 5 counter
[-]+++++
 
>>>>[-]+<<<<
>>+[-<<->>]+++++<<
[->>->>[-]<<<<]
>>>>[
<[-]>
 
[-]
Print "Buzz"
++++++++ ++++++++ ++++++++ ++++++++
++++++++ ++++++++ ++++++++ ++++++++
++.
 
++++++++ ++++++++ ++++++++ ++++++++
++++++++ ++++++++ +++.
 
+++++..
 
[-]
<<----->>
]<<<<
 
Check if to print the number (Leading zeros)
>>>[
<<< <<<< <<<<
>.>.>.<<<
>>> >>>> >>>>
[-]
]<<<
 
<<<< <<<<
 
Print New Line
<<<<[-]++++ ++++ ++++ +.---.[-]>>
]
<<

Chef[edit]

This was clearly a challenge in a language without a modulus operator, no proper if statement (except for checking if a variable is not exactly 0), and no way to define text (except 1 character at a time on a stack).

Irish Soda Bread with Club Soda.
 
This is FizzBuzz
 
Ingredients.
1 l buttermilk
 
Method.
Take buttermilk from refrigerator.
Shake the buttermilk.
Put buttermilk into the 6th mixing bowl.
Serve with club soda.
Pour contents of the 1st mixing bowl into the 1st baking dish.
Clean the 1st mixing bowl.
Watch the buttermilk until shaked.
 
Serves 1.
 
Club Soda.
 
Gets whether to print fizz buzz fizzbuzz or number.
 
Ingredients.
70 g flour
105 g salt
122 ml milk
66 g sugar
117 ml vegetable oil
3 cups fizzle
5 cups seltzer
1 cup bmilk
1 cup ice
1 cup baking soda
1 g oregano
32 ml vinegar
1 g thyme
1 g sage
 
Method.
Put milk into the 1st mixing bowl.
Put salt into the 1st mixing bowl.
Put flour into the 1st mixing bowl.
Put vinegar into the 1st mixing bowl.
Put milk into the 1st mixing bowl.
Stir the 1st mixing bowl for 5 minutes.
Liquify contents of the 1st mixing bowl.
Put fizzle into the 3rd mixing bowl.
Combine seltzer into the 3rd mixing bowl.
Fold bmilk into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Put seltzer into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Serve with moist cake.
Fold bmilk into the 1st mixing bowl.
Fold sage into the 6th mixing bowl.
Fold sage into the 6th mixing bowl.
Put bmilk into the 4th mixing bowl.
Remove seltzer from the 4th mixing bowl.
Fold oregano into the 4th mixing bowl.
Smell the oregano.
Fold bmilk into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Put fizzle into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Serve with moist cake.
Fold bmilk into the 1st mixing bowl.
Fold sage into the 6th mixing bowl.
Fold sage into the 6th mixing bowl.
Put bmilk into the 4th mixing bowl.
Remove fizzle from the 4th mixing bowl.
Fold oregano into the 4th mixing bowl.
Crush the oregano.
Clean the 1st mixing bowl.
Fold bmilk into the 6th mixing bowl.
Put bmilk into the 1st mixing bowl.
Refrigerate.
Grind until crushed.
Refrigerate.
Shuffle until smelled.
Clean the 1st mixing bowl.
Put milk into the 1st mixing bowl.
Put vegetable oil into the 1st mixing bowl.
Put sugar into the 1st mixing bowl.
Put vinegar into the 1st mixing bowl.
Put milk into the 1st mixing bowl.
Stir the 1st mixing bowl for 5 minutes.
Liquify contents of the 1st mixing bowl.
Fold baking soda into the 3rd mixing bowl.
Fold bmilk into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Put baking soda into the 6th mixing bowl.
Put bmilk into the 6th mixing bowl.
Serve with moist cake.
Fold bmilk into the 1st mixing bowl.
Fold sage into the 6th mixing bowl.
Fold sage into the 6th mixing bowl.
Put bmilk into the 4th mixing bowl.
Remove baking soda from the 4th mixing bowl.
Fold oregano into the 4th mixing bowl.
Separate the oregano.
Refrigerate.
Part until separated.
Put fizzle into the 6th mixing bowl.
Serve with club soda.
Stir the 1st mixing bowl for 1 minute.
Stir the 1st mixing bowl for 7 minutes.
Stir the 1st mixing bowl for 1 minute.
Stir the 1st mixing bowl for 7 minutes.
Stir the 1st mixing bowl for 5 minutes.
Fold the oregano into the 1st mixing bowl.
Fold the oregano into the 1st mixing bowl.
Fold the oregano into the 1st mixing bowl.
Fold the oregano into the 1st mixing bowl.
Fold the oregano into the 1st mixing bowl.
Refrigerate.
 
Moist cake.
 
Mods a number
 
Ingredients.
1 cup chocolate
70 g wheat flour
1 cup white chocolate chips
1 cup baking powder
105 g honey
5 cups syrup
1 g vanilla
1 g rosemary
 
Method.
Fold chocolate into the 6th mixing bowl.
Fold syrup into the 6th mixing bowl.
Clean the 1st mixing bowl.
Put chocolate into the 5th mixing bowl.
Fold wheat flour into the 5th mixing bowl.
Put white chocolate chips into the 5th mixing bowl.
Remove white chocolate chips from the 5th mixing bowl.
Fold baking powder into the 5th mixing bowl.
Put baking powder into the 5th mixing bowl.
Fold honey into the 5th mixing bowl.
Sift the wheat flour.
Put honey into the 5th mixing bowl.
Add white chocolate chips into the 5th mixing bowl.
Fold honey into the 5th mixing bowl.
Put honey into the 5th mixing bowl.
Remove syrup from the 5th mixing bowl.
Fold vanilla into the 5th mixing bowl.
Sprinkle the vanilla.
Put white chocolate chips into the 5th mixing bowl.
Remove white chocolate chips from the 5th mixing bowl.
Fold rosemary into the 5th mixing bowl.
Set aside.
Move until sprinkled.
Recite the rosemary.
Put white chocolate chips into the 5th mixing bowl.
Remove white chocolate chips from the 5th mixing bowl.
Fold honey into the 5th mixing bowl.
Put baking powder into the 5th mixing bowl.
Add white chocolate chips into the 5th mixing bowl.
Fold baking powder into the 5th mixing bowl.
Set aside.
Repeat until recited.
Put white chocolate chips into the 5th mixing bowl.
Fold rosemary into the 5th mixing bowl.
Shuffle the wheat flour until sifted.
Put the baking powder into the 5th mixing bowl.
Combine syrup into the 5th mixing bowl.
Fold honey into the 5th mixing bowl.
Put chocolate into the 5th mixing bowl.
Remove honey from the 5th mixing bowl.
Fold chocolate into the 5th mixing bowl.
Put white chocolate chips into the 5th mixing bowl.
Fold rosemary into the 5th mixing bowl.
Siphon chocolate.
Put white chocolate chips into the 5th mixing bowl.
Remove white chocolate chips from the 5th mixing bowl.
Fold rosemary into the 5th mixing bowl.
Set aside.
Gulp until siphoned.
Quote the rosemary.
Put syrup into the 5th mixing bowl.
Fold chocolate into the 5th mixing bowl.
Set aside.
Repeat until quoted.
Put chocolate into the 1st mixing bowl.
Refrigerate.

FALSE[edit]

[\$@$@\/*=]d:
[1\$3d;!["Fizz"\%0\]?$5d;!["Buzz"\%0\]?\[$.]?"
"]f:
0[$100\>][1+f;!]#%

LOLCODE[edit]

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

Another method using LOLCODE 1.2

HAI 1.2
I HAS A NUMZ ITZ 1
IM IN YR FIZZR UPPIN YR NUMZ TIL BOTH SAEM NUMZ AN 100
BOTH SAEM MOD OF NUMZ AN 15 AN 0
O RLY?
YA RLY
VISIBLE "FizzBuzz"
MEBBE BOTH SAEM MOD OF NUMZ AN 3 AN 0
VISIBLE "Fizz"
MEBBE BOTH SAEM MOD OF NUMZ AN 5 AN 0
VISIBLE "Buzz"
NO WAI
VISIBLE NUMZ
OIC
IM OUTTA YR FIZZR
KTHXBYE

SNUSP[edit]

        /               'B' @=@@=@@++++#
// / 'u' @@@@@=@+++++#
// // / 'z' @=@@@@+@++++#
// // // / 'i' @@@@@@=+++++#
// // // // / 'F' @@@=@@+++++#
// // // // // / LF ++++++++++#
// // // // // // / 100 @@@=@@@=++++#
$@/>@/>@/>@/>@/>@/>@/\ 0
/ /
! /======= Fizz <<<.<.<..>>>#
/ | \
\?!#->+ @\.>?!#->+ @\.>?!#->+@/.>\ |
/  !  !  ! / |
\?!#->+ @\.>?!#->+@\ .>?!#->+@/.>\ |
/  ! \!===\!  ! / |
\?!#->+ @\.>?!#->+ @\.>?!#->+@/.>\ |
/  !  ! |  ! / |
\?!#->+@\ .>?!#->+ @\.>?!#->+@/.>\ |
/ \!==========!===\!  ! / |
\?!#->+ @\.>?!#->+ @\.>?!#->+@/>>@\.>/
 ! | | |
/==========/ \========!\=== Buzz <<<<<<<.>.>..>>>#
|
\!/=dup==?\>>@\<!/back?\<<<#
\<<+>+>-/ | \>+<- /
|
/======================/
|
| /recurse\ #/?\ zero
\print=!\@\>?!\@/<@\.!\-/
| \=/ \=itoa=@@@+@+++++#
 ! /+ !/+ !/+ !/+ \ mod10
/<+> -\!?-\!?-\!?-\!?-\!
\?!\-?!\-?!\-?!\-?!\-?/\ div10
# +/! +/! +/! +/! +/


Whitespace[edit]

   	
 














 










 


 







 


 







 









 
 
 
 

This solution was generated from the following pseudo-Assembly.

push 1 ; Initialize a counter.
 
0:
dup dup ; Get two copies for the mod checks.
push 3 mod jz 1
push 5 mod jz 2
dup onum jump 4 ; If we're still here, just print the number.
 
1: ; Print "Fizz", then maybe "Buzz".
push F ochr
push i ochr
call 3 push 5 mod
jz 2
jump 4
 
2: ; Print "Buzz".
push B ochr
push u ochr
call 3 jump 4
 
3: ; Print "zz"; called as a function for convenient return.
push z dup ochr ochr ret
 
4:
push 10 ochr ; Print a newline.
push 1 add dup ; Increment the counter.
push 101 sub
jn 0 ; Go again unless we're at 100.
pop exit ; Exit clean.