Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DJMcMayhem
Last active September 8, 2017 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DJMcMayhem/52453a771830a0dcd42323d39396ce54 to your computer and use it in GitHub Desktop.
Save DJMcMayhem/52453a771830a0dcd42323d39396ce54 to your computer and use it in GitHub Desktop.
#While true
{
(
################
# 40
################
<
#Duplicate
(({}))
#Push 40
((((()()()()()){}){}){})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push it to the main stack
({}<>)
#Push a zero
(<>)
#endif
}
#Pop the previous zero
{}
################
# 41
################
<
#Duplicate
(({}))
#Push 41
((((()()()()()){}){}){}())
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push it to the main stack
({}<>)
#Check if the top two values are inequal
({}[{}](<()>)){{}{}(<(())>)}{}
#If they are
{
#Toggle to the main stack
<>
#Pop everything
{{}}
#Toggle Back to the alternate stack
<>
#Pop everything
{{}}
#Push two zeros (one to break, one to increase the stack height)
((<()>))
#endif
}
#Pop zero (from the alternate stack
{}
#Toggle back onto the main stack, pushing a zero in the process
(<>)
#endif
}
#Pop the previous zero
{}
################
# 60
################
<
#Duplicate
(({}))
#Push 60
(((((()()()()()){}){})){}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push a two to the main stack
#Evaluate this as one
<({}()<>)>()
#Push a zero
(<>)
#endif
}
#Pop the previous zero
{}
################
# 62
################
<
#Duplicate
(({}))
#Push 62
(((((()()()()()){}){})()){}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push a two to the main stack
#Evaluate this as one
<({}()<>)>()
#Check if the top two values are inequal
({}[{}](<()>)){{}{}(<(())>)}{}
#If they are
{
#Toggle to the main stack
<>
#Pop everything
{{}}
#Toggle Back to the alternate stack
<>
#Pop everything
{{}}
#Push two zeros (one to break, one to increase the stack height)
((<()>))
#endif
}
#Pop zero (from the alternate stack
{}
#Toggle back onto the main stack, pushing a zero in the process
(<>)
#endif
}
#Pop the previous zero
{}
################
# 91
################
<
#Duplicate
(({}))
#Push 91
((((()()()){}){}()){({}[()])}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push three to the main stack
#Evaluate it to one
<({}()()<>)>()
#Push a zero
(<>)
#endif
}
#Pop the previous zero
{}
################
# 93
################
<
#Duplicate
(({}))
#Push 93
((((((()()()()()){})){}{}())){}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push three to the main stack
#Evaluate it to one
<({}()()<>)>()
#Check if the top two values are inequal
({}[{}](<()>)){{}{}(<(())>)}{}
#If they are
{
#Toggle to the main stack
<>
#Pop everything
{{}}
#Toggle Back to the alternate stack
<>
#Pop everything
{{}}
#Push two zeros (one to break, one to increase the stack height)
((<()>))
#endif
}
#Pop zero (from the alternate stack
{}
#Toggle back onto the main stack, pushing a zero in the process
(<>)
#endif
}
#Pop the previous zero
{}
################
# 123
################
<
#Duplicate
(({}))
#Push 123
((((((()()()()()){}){}){}())){}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push four to the main stack
#Evaluate it to one
<({}()()()<>)>()
#Push a zero
(<>)
#endif
}
#Pop the previous zero
{}
################
# 125
################
<
#Duplicate
(({}))
#Push 125
((((((()()()()()){}){}){}())()){}{})
#Check if they equal
({}[{}]<(())>){((<{}{}>))}{}
>
#If they are
{
#Pop the one off, and push four to the main stack
#Evaluate it to one
<({}()()()<>)>()
#Check if the top two values are inequal
({}[{}](<()>)){{}{}(<(())>)}{}
#If they are
{
#Toggle to the main stack
<>
#Pop everything
{{}}
#Toggle Back to the alternate stack
<>
#Pop everything
{{}}
#Push two zeros (one to break, one to increase the stack height)
((<()>))
#endif
}
#Pop zero (from the alternate stack
{}
#Toggle back onto the main stack, pushing a zero in the process
(<>)
#endif
}
#Pop the previous zero
{}
########################
# End of brackets
########################
#Pop the last character
<{}>
#Push the result of that run - 1 (-1 or 0)
[()])
#Check if any bracket equaled
{
#Toggle to the alternate stack
<>
#Pop everything
{{}}
#push a zero to increase the stack height
(<()>)
#Toggle Back to the main stack
<>
#Pop everything
{{}}
#Push one zero to break
(<()>)
#endif
}
#Pop a zero
{}
#Endwhile
}
#Toggle back
<>
#Push stack-height onto main-stack
([]<>)
#Logical not
({}<(())>){((<{}{}>))}{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment