Skip to main content
added 308 characters in body
Source Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180

Pyramid Scheme, 166 156 131131 123 bytes

Saved 10 bytes thanks to Pavel! Saved 2525 33 bytes thanks to Khuldraeseth na'Barya!

   ^        ^
  / \      / \
 /set\    /do \
^-----^  ^-----^
-    /l\^- -^   / \
    /ine\l\ /#\ /out\
    -----/ine\---^-----
         -----   -

Try it online!

Try it online!

Old answer and explanation (functionally equivalent)

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

Pyramid Scheme, 166 156 131 bytes

Saved 10 bytes thanks to Pavel! Saved 25 bytes thanks to Khuldraeseth na'Barya!

   ^        ^
  / \      / \
 /set\    /do \
^-----^  ^-----^
-    /l\ -^   / \
    /ine\/#\ /out\
    --------^-----
            -

Try it online!

Old answer and explanation (functionally equivalent)

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

Pyramid Scheme, 166 156 131 123 bytes

Saved 10 bytes thanks to Pavel! Saved 25 33 bytes thanks to Khuldraeseth na'Barya!

   ^       ^
  / \     / \
 /set\   /do \
^-----^ ^-----^
-    ^- -^   / \
    /l\ /#\ /out\
   /ine\---^-----
   -----   -

Try it online!

Try it online!

Old answer and explanation (functionally equivalent)

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

added 514 characters in body
Source Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180

Pyramid Scheme, 166 156156 131 bytes

Saved 10 bytes thanks to Pavel! Saved 25 bytes thanks to Khuldraeseth na'Barya!

   ^        ^
  / \      / \
 /set\    /do \
^-----^  ^-----^
-    /l\ -^   / \
    /ine\/#\ /out\
    --------^-----
            -

Try it online!

Old answer and explanation (functionally equivalent)

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

Pyramid Scheme, 166 156 bytes

Saved 10 bytes thanks to Pavel!

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

Pyramid Scheme, 166 156 131 bytes

Saved 10 bytes thanks to Pavel! Saved 25 bytes thanks to Khuldraeseth na'Barya!

   ^        ^
  / \      / \
 /set\    /do \
^-----^  ^-----^
-    /l\ -^   / \
    /ine\/#\ /out\
    --------^-----
            -

Try it online!

Old answer and explanation (functionally equivalent)

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

added 1 character in body
Source Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180

Pyramid SchemePyramid Scheme, 166166 156 bytes

Saved 10 bytes thanks to Pavel!

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    / \l\      ^-----
   /ine\   \ /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /linel\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

HeheThis is a do while loop, with the left pyramid being the condition, and the right one being the body. I love this languageEquivalent to:

do {
    out(a);
} while(a);

which is what we want.

Pyramid Scheme, 166 bytes

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    / \      ^-----
   /   \    /a\
  /line \   ---
  -------

Hehe. I love this language.

Pyramid Scheme, 166 156 bytes

Saved 10 bytes thanks to Pavel!

    ^        ^
   / \      / \
  /set\    /do \
 ^-----^  ^-----^
/a\   /#\/a\   / \
---  ^------  /out\
    /l\      ^-----
   /ine\    /a\
   -----    ---

Hehe. I love this language.

Explanation

There are two pyramid chains. The first is:

    ^
   / \
  /set\
 ^-----^
/a\   /#\
---  ^---
    /l\
   /ine\
   -----

This sets variable a to line (a line read from STDIN), as a value (#).

The second:

    ^
   / \
  /do \
 ^-----^
/a\   / \
---  /out\
    ^-----
   /a\
   ---

This is a do while loop, with the left pyramid being the condition, and the right one being the body. Equivalent to:

do {
    out(a);
} while(a);

which is what we want.

added 1 character in body
Source Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180
Loading
Source Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180
Loading