Created
November 28, 2023 05:28
-
-
Save ParadoxV5/292123d3b8c13202dac0003295668177 to your computer and use it in GitHub Desktop.
Fibonacci calculator implemented with only `\W`s (and without realizing `Range%` is a block-taking thing)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$* << [//=~'', /$/=~'$'] << () << ->() { | |
$*[~(/$$/=~'$$')][ | |
( $*[~(/$/=~'$')] += (/$/=~'$') ) - (/$/=~'$') | |
] ||= ( | |
$*[~(/$/=~'$')] -= (/$$/=~'$$') | |
$*[~(//=~'')][] + $*[ ~(/$$/=~'$$') ][ $*[~(/$/=~'$')] - (/$$/=~'$$') ] | |
) | |
} | |
# Test | |
p 0x10.times.map {|n| | |
ARGV[-2] = n | |
ARGV[-1][] # lol | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment