Skip to content

Instantly share code, notes, and snippets.

@SteveKoontz
Created March 18, 2015 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveKoontz/fad6d583e13a4a83bdd3 to your computer and use it in GitHub Desktop.
Save SteveKoontz/fad6d583e13a4a83bdd3 to your computer and use it in GitHub Desktop.
Example for Logan
for id in useridarray
unless(id.to_s == self.id.to_s)
if(playedarray.include?(id.to_s))
playedarray.insert(id, playedarray.delete_at(playedarray.index("id")))
else
playedarray.push(id.to_s)
end
end
end
@LoganBarnett
Copy link

useridarray.each_with_index do id, i

deleted = playedarray.delete_at(i)
playedarray << deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment