Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Circular shift
7stud --
1/22/2008 7:46:00 PM
Zangief Ief wrote:
> Hello everybody,
>
> I would like to write a simple implementation of *circular shift*
> (
http://en.wikipedia.org/wiki/Circ...
). Thank you all for any
> ideas :)
arr = [1, 2, 3]
arr << arr.shift
p arr
arr[0, 0] = arr.pop
p arr
--output:--
[2, 3, 1]
[1, 2, 3]
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Circular shift
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password