From: Kristof Bastiaensen Date: 2004-10-02T20:05:08+09:00 Subject: Re: [JOIN] Range syntax & Solitare cypher On Sat, 02 Oct 2004 07:51:03 +0900, markus wrote: > On Sat, 2 Oct 2004, Zach Dennis wrote: > >> Markus wrote: >> >> >Here's a simple example of where ... is very nice to have. You want to >> >cut a deck and card x, so that x is on the top after the cut: >> > >> >deck = deck.values(x..-1,0...x) >> > >> >*grin* Try doing that as concisely without "..." >> > >> >-- MarkusQ >> > >> > >> deck = deck.values(x..-1,0..x-1) >> >> > Nope. Sorry. Try it with: > > deck = (1..52).to_a > x = deck.index(1) > > (or just a deck from 1..10 if you prefer) and then try again. > > -- MarkusQ > > P.S. I repeat, a...b is NOT a synonym for a..b-1 Exactly. (3..5-1).include? 4.4 #=> false (3...5).include? 4.4 #=> true KB