FizzBuzz/EsoLang: Difference between revisions

From Rosetta Code
Content added Content deleted
(moving Befunge)
(moving Brainf***)
Line 12: Line 12:
|!%5: <
|!%5: <
>:#,_ $> ^</lang>
>:#,_ $> ^</lang>

=={{header|Brainf***}}==
<lang bf>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
<<<<[-]++++ ++++ ++++ +.---.[-]>>
]
<<</lang>

Revision as of 12:19, 22 September 2015

FizzBuzz/EsoLang is part of FizzBuzz. You may find other members of FizzBuzz at Category:FizzBuzz.

Befunge

(befunge 93) <lang befunge>55*4*v _ v v <>:1-:^

   |:<$      <    ,*48 <                                                       
   @>0"zzif">:#,_$      v                                                      

>:3%!| >0"zzub">:#,_$^

    >:5%!|                                                                     

v "buzz"0<>:. ^

        |!%5:           <                                                      

>:#,_ $> ^</lang>

Brainf***

<lang bf>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
   <<<<[-]++++ ++++ ++++ +.---.[-]>>

] <<</lang>