Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 26 Feb 2013 10:40:09 -0600 Date: Tue, 26 Feb 2013 16:40:06 +0000 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: BlueJ don't know what i did wrong References: <638ed624-9eba-44eb-bcbf-68466e5bb5f1@googlegroups.com> <42d76fca-d365-4030-ae8c-07a806eab87c@googlegroups.com> <1wtai7dd80h80$.6rbtwoyou3gh.dlg@40tude.net> <5q6dnc3pF_HJzLfMnZ2dnUVZ7s-dnZ2d@bt.com> <77afaabf-ec0f-46d6-b3ea-d8f186dbf7e4@googlegroups.com> <743qp5x1pcgm.1ctnh8jj9stlu$.dlg@40tude.net> In-Reply-To: <743qp5x1pcgm.1ctnh8jj9stlu$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 39 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-zB4oo7zppS/n3pcLY3zJRd36V8HZvujAn3XJOJ2ikoXNr55/T2uZqauNGawS18VllRBbxMnrHQHqUb5!y9uGLgbQXh3c2C2u9kfBt/VdYVhs0d6NL5zrdeiCM1dyvaChhSiEIpkg95lxS8W7jNpdKG2+unA= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3298 Xref: csiph.com comp.lang.java.programmer:22540 On 26/02/13 15:13, Joerg Meier wrote: > On Mon, 25 Feb 2013 11:10:49 +0000, lipska the kat wrote: > >> Do you know what a stack is ? > > Not to put fuel on the fire that is going on elsewhere in the thread, but > it seems to me that Stack/Deque is a bad choice for this, as he needs > random access (because certain units are helped by certain specific other > ones). A map where the helper-reference is the key would imo be the best > choice, Yes, I've been thinking about this, you're right, a Stack probably wouldn't be the answer. I was thinking 'cards, deck, (no not deque :-) stack but as time allows I'm trying to get something working given the rather sparse information to date. I have never played these 'adventure' type games ('bubble bobble' with my daughter is about my level). It would be nice to have a spec. > with something like. Object[] keys = unitMap.keySet().toArray(); > Unit unit = (Unit) unitMap.remove(keys[rng.nextInt(keys.length)]); Yea, there needs to be a way of determining if the 'whatever' is there or if it's been used I think. I presume you would test for null but we might end up with the same problem the 'thereness' or not is being used all over the place in conditional tests, I think this just needs to happen once, probably, anyway ... too busy with other stuff at the moment to investigate further. Like: get the example sitemap from google webmaster tools and test it with the recommended validator and ... epic fail :-( meh lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun