Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#RProgN , Distance 2.

RProgN , Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' by removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

#RProgN , Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' by removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

RProgN , Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' by removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

Typo fix.
Source Link
ATaco
  • 11.7k
  • 30
  • 82

#RProgN, Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' butby removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

#RProgN, Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' but removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

#RProgN, Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' by removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

Source Link
ATaco
  • 11.7k
  • 30
  • 82

#RProgN, Distance 2.

Given aset of integers, ;find the sum of all integers in it.

In RProgN, a, set, find and sum are all commands. Everything else is per default ignored in syntax. a pushes the alphabet to the stack, which will cause sum to fail. Set never has enough arguments, so always fails, erroring. Find either has the wrong number of arguments, or tries to compare the alphabet with the input stack, which doesn't work.

a and set can both be 'fixed' but removing the space between then, aset is not a function, so it's ignored. Find just has an extra character inserted at the start, causing it also to not be recognized, and ignored. Only sum is left, which conveniently sums the contents of the input stack.

Finally, RProgN might win something!

Try it Online!

AltStyle によって変換されたページ (->オリジナル) /