Skip to main content
Commonmark migration
Source Link

DUP

It's simple: 2+2=5.

#DUP It's simple: 2+2=5. [Try it here.][1]Try it here.

Hehe, good luck with this one. #Explanation DUP

Explanation

DUP treats most A-za-z as variables, albeit uninitialized. It pushes 2 uninitialized variables to the stack. 's pushes charcode of s to the stack. Whitespace is entirely ignored. simple pushes 6 more uninitialized variables to the stack, while : takes the top stack item (a variable) and sets it to the second from top stack item. 2 is pushed to the stack, + pops 2 numbers and adds them, 2 is pushed to the stack, = pops 2 numbers and checks for equality, and 5 is pushed to the stack.

Of course, that's all completely irrelevant, because just . outputs the top of the stack (in this case, 5). [1]: http://www.quirkster.com/iano/js/dup.html

#DUP It's simple: 2+2=5. [Try it here.][1]

Hehe, good luck with this one. #Explanation DUP treats most A-za-z as variables, albeit uninitialized. It pushes 2 uninitialized variables to the stack. 's pushes charcode of s to the stack. Whitespace is entirely ignored. simple pushes 6 more uninitialized variables to the stack, while : takes the top stack item (a variable) and sets it to the second from top stack item. 2 is pushed to the stack, + pops 2 numbers and adds them, 2 is pushed to the stack, = pops 2 numbers and checks for equality, and 5 is pushed to the stack.

Of course, that's all completely irrelevant, because just . outputs the top of the stack (in this case, 5). [1]: http://www.quirkster.com/iano/js/dup.html

DUP

It's simple: 2+2=5.

Try it here.

Hehe, good luck with this one.

Explanation

DUP treats most A-za-z as variables, albeit uninitialized. It pushes 2 uninitialized variables to the stack. 's pushes charcode of s to the stack. Whitespace is entirely ignored. simple pushes 6 more uninitialized variables to the stack, while : takes the top stack item (a variable) and sets it to the second from top stack item. 2 is pushed to the stack, + pops 2 numbers and adds them, 2 is pushed to the stack, = pops 2 numbers and checks for equality, and 5 is pushed to the stack.

Of course, that's all completely irrelevant, because just . outputs the top of the stack (in this case, 5).

Source Link
Mama Fun Roll
  • 9.9k
  • 1
  • 36
  • 46

#DUP It's simple: 2+2=5. [Try it here.][1]

Hehe, good luck with this one. #Explanation DUP treats most A-za-z as variables, albeit uninitialized. It pushes 2 uninitialized variables to the stack. 's pushes charcode of s to the stack. Whitespace is entirely ignored. simple pushes 6 more uninitialized variables to the stack, while : takes the top stack item (a variable) and sets it to the second from top stack item. 2 is pushed to the stack, + pops 2 numbers and adds them, 2 is pushed to the stack, = pops 2 numbers and checks for equality, and 5 is pushed to the stack.

Of course, that's all completely irrelevant, because just . outputs the top of the stack (in this case, 5). [1]: http://www.quirkster.com/iano/js/dup.html