-
-
Save gr33n7007h/a0161d6705092bb48a4e7b9ae8124716 to your computer and use it in GitHub Desktop.
DOOM
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
module PythonUtils | |
refine Array do | |
def step(from:, to:, step:) | |
slice(from...to).each_slice(step).map(&:first) | |
end | |
end | |
end | |
using PythonUtils | |
p Array(0..75).step(from: 13, to: 45, step: 4) #=> [13, 17, 21, 25, 29, 33, 37, 41] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment