Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Help with Deck of cards assignment and getting it to deal... Date: Sat, 2 Aug 2014 10:19:42 +0000 (UTC) Organization: A noiseless patient Spider Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 2 Aug 2014 10:19:42 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="18820"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tpkHLxhPU1QonAipzbkI/QLtkXXgXjoA=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:h5XyIvRk7bW6SYaFR/gi0/iS16I= Xref: csiph.com comp.lang.java.programmer:29507 On Sat, 02 Aug 2014 01:42:13 -0700, Roedy Green wrote: > On Fri, 01 Aug 2014 18:16:33 -0700, Scott Dunning > wrote, quoted or indirectly quoted someone who said : > >>Hello, I have an assignment for my summer class. FYI, I'm super new to >>programming in general and this is my first time with java and it's a >>summer class so it's going super fast (please be nice!) lol. > > For basic background is shuffling, see > http://mindprod.com/pseudorandom.html In Java the indices of an array start to zero, not 1. Assuming that they start from 1, as you've done, will almost certainly cause problems at runtime by throwing "index out of range" exceptions. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |