Created
May 28, 2021 00:53
-
-
Save mlajx/bf61e7151c2641b5022a42b9b9578c17 to your computer and use it in GitHub Desktop.
CPF Validator in Brainfuck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPF | |
>+ | |
>++ | |
>+++ | |
>++++ | |
>+++++ | |
>++++++ | |
>+++++++ | |
>++++++++ | |
>+++++++++ | |
>>>>>> | |
Qty Digits | |
+++++++++ | |
Flag Spot To Move CPF | |
<+> | |
Move CPF and add one | |
[<[<]<<<<[>>>>+<<<<-]>>>>+[>]<-] | |
Reset Flag Spot | |
<-> | |
Add Logic For Big Loop | |
<<[<]<<<++ | |
Start Big Loop | |
[ | |
>>>>[>]> | |
Define the Multiplier | |
++++++++++ | |
<<[<]> | |
Start Loop | |
[ | |
Copy Next Digit | |
[<<+>>>[>]>>+<<<[<]>-] | |
Make a flag | |
+ | |
[>]>>>>> | |
Define de Divider | |
+++++++++++ | |
<<< | |
Make the multiplication | |
[<[<+>>>+<<-]<[>+<-]>>-] | |
Add the division in multiplication result | |
>>>[<+<+>>-]<< | |
Sub one time the multiplier | |
<<[<+>>>-<<-]<[>+<-] | |
>>> | |
Make the Mod and present only the mod | |
[>->+<[>]>[<+>-]<<[<]>-]>[-] | |
Move mod to next sum | |
>+[<<+>>-]<<- | |
Sub one in multiplier | |
<<- | |
<<[<]> | |
Remove flag | |
- | |
> | |
End Loop | |
] | |
Reset Multiplier | |
>[-] | |
<+>>+ | |
Add One To Avoid 0 | |
+>+ | |
Copy the If B | |
[>+>+<<-]>[<+>-]<< | |
Make the if(A GorE B) | |
[->-[>]<<] | |
<[- | |
<<+>> | |
] | |
<[-< | |
<+++++++++++++>>>>>>> | |
[<<<<<<<->>>>>>>-] | |
<<<<<< | |
] | |
Reset If | |
>>>>[-]>>[-] | |
<<<<<<< | |
Move digits to correct spot | |
[[>>+<<-]<] | |
Add one in next multiply | |
>>>[>]>+ | |
End Big Loop | |
<<[<]<<<-] | |
Remove the one extra in multiply | |
>>>>[>]>- | |
<<[<]> | |
Move back to start | |
[[<<<<<+>>>>>-]<<<<<->>>>>>] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment