Brain-Flak, 6 bytes
My first Brain-Flak solution worthy posting, I guess it's the right tool for this job:
([]<>)
Explanation
When executing a Brain-Flak program, initially the left stack contains all arguments. From there it's simply a matter of:
( -- push the following..
[] -- height of the stack (ie. # of arguments)
{}<> -- ..to the other stack (toggles to the other stack)
) --
-- the right stack now contains the # of arguments which
-- gets printed implicitly
Brain-Flak, 6 bytes
My first Brain-Flak solution worthy posting, I guess it's the right tool for this job:
([]<>)
Explanation
When executing a Brain-Flak program, initially the left stack contains all arguments. From there it's simply a matter of:
( -- push the following..
[] -- height of the stack (ie. # of arguments)
{} -- ..to the other stack (toggles to the other stack)
) --
-- the right stack now contains the # of arguments which
-- gets printed implicitly
Brain-Flak, 6 bytes
My first Brain-Flak solution worthy posting, I guess it's the right tool for this job:
([]<>)
Explanation
When executing a Brain-Flak program, initially the left stack contains all arguments. From there it's simply a matter of:
( -- push the following..
[] -- height of the stack (ie. # of arguments)
<> -- ..to the other stack (toggles to the other stack)
) --
-- the right stack now contains the # of arguments which
-- gets printed implicitly
Brain-Flak, 6 bytes
My first Brain-Flak solution worthy posting, I guess it's the right tool for this job:
([]<>)
Explanation
When executing a Brain-Flak program, initially the left stack contains all arguments. From there it's simply a matter of:
( -- push the following..
[] -- height of the stack (ie. # of arguments)
{} -- ..to the other stack (toggles to the other stack)
) --
-- the right stack now contains the # of arguments which
-- gets printed implicitly