T
travis laduke
I've been forced to work on some php lately and found myself
thinking: "man, this sucks. i wish it was more like supercollider"
then i remembered supercollider is ruby-influenced so i started
reading about ruby.
Here's my question: is there a common way to rotate a string or an
array?
I thought i could do some combination of .pop and .unshift or
something, but i ran into this problem:
idea = ["a","b","c","d"]
x = idea.pop
puts idea
why is idea changed? how do i make it stay the same?
why is it different than:
x = idea.reverse
where idea is left alone and only x is the reversed array?
-travis
thinking: "man, this sucks. i wish it was more like supercollider"
then i remembered supercollider is ruby-influenced so i started
reading about ruby.
Here's my question: is there a common way to rotate a string or an
array?
I thought i could do some combination of .pop and .unshift or
something, but i ran into this problem:
idea = ["a","b","c","d"]
x = idea.pop
puts idea
why is idea changed? how do i make it stay the same?
why is it different than:
x = idea.reverse
where idea is left alone and only x is the reversed array?
-travis