Skip to content

Instantly share code, notes, and snippets.

@dpick
Created August 11, 2011 20:53
Show Gist options
  • Save dpick/1140742 to your computer and use it in GitHub Desktop.
Save dpick/1140742 to your computer and use it in GitHub Desktop.
def sample_array(size, array, new_array = [])
count = 0
while new_array.size < size
new_array << array[count % array.size]
count += 1
end
return new_array
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment