Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

80%
+6 −0
Challenges Create an Alphabet Diamond

Brain-Flak, 250 bytes ((((()()()){}){}){}()){(({})[()])}{}(<>)<>{({}<>)<>}<>{(({})[()])}([]){{}([(({}))](((()()()){}){}){}()){({}[()])<>((((()()()()){}){}){})&l...

posted 3y ago by DJMcMayhem‭

Answer
#1: Initial revision by user avatar DJMcMayhem‭ · 2021-02-12T07:00:23Z (over 3 years ago)
# [Brain-Flak], 250 bytes

    ((((()()()){}){}){}()){(({})[()])}{}(<>)<>{({}<>)<>}<>{(({})[()])}([]){{}([(({}))](((()()()){}){}){}()){({}[()])<>((((()()()()){}){}){})<>}{}<>(((((()()()()){}){}){}){}())<>{({}[()])<>(({})())<>}{}{({}[()])<>(({})[()])<>}{}<>((()()()()()){})<>([])}<>

[Try it online!][TIO-kl1xxz7l]

[Brain-Flak]: https://github.com/DJMcMayhem/Brain-Flak
[TIO-kl1xxz7l]: https://tio.run/##dY4xDoAgDEWv0w7cgJB4DsKgg4nROLgSzl5/iwoxCgw/r@2j0zEuu5u3cRUhPayXc6lPIxFiJE5cAHxgHzKQhaK51SkmzmiKxjj9CHOxdh/aj12LalVP31Vz1BUeC7BBzL35lW8j90IQLIyCiLhjOAE "Brain-Flak – Try It Online"

Readable, commented version:

    # Push 25
    ((((()()()){}){}){}())
    
    # Push range(25, 1)
    {
        (({})[()])
    }
    {}
    
    # Push a 0 on to the alternate stack and return to main stack
    (<>)<>
    
    # Reverse values onto other stack
    {
        ({}<>)
        <>
    }
    <>
    
    # Push range(25, 0)
    {
        (({})[()])
    }
    
    # Push the stack height.
    ([])
    
    # At this point, the stack has 0, 1, 2... 23, 24, 25, 24, 23... 2, 1, 0
    # Go through each number of these numbers, and call it N
    {
        # Pop the stack height counter
        {}
    
        # Push (25 - N), and underneath it push N an additional time
        ([(({}))](((()()()){}){}){}())
    
        # That many times...
        {
            # Decrement
            ({}[()])
    
            <>
    
            # Push a space onto the ascii-art stack
            ((((()()()()){}){}){})
    
            <>
        }
        {}
    
        # on the ascii-art stack, push the letter A
        <>
        (((((()()()()){}){}){}){}())
        <>
    
        # N times...
        {
            # Decrement N
            ({}[()])
    
            # Push "The last character + 1"
            <>
            (({})())
            <>
        }
        {}
    
        # N times...
        {
            # Decrement N
            ({}[()])
    
            # Push "The last character - 1"
            <>
            (({})[()])
            <>
        }
        {}
    
        <>
        # Push a newline
        ((()()()()()){})
        <>
    
        ([])
    }<>