Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Basic prisoner's dilemma? Date: Mon, 18 Apr 2011 00:14:35 -0700 Organization: A noiseless patient Spider Lines: 19 Message-ID: References: <4dabb5e8$0$55571$c30e37c6@exi-reader.telstra.net> <3c4ead8c-1841-415f-8bbe-f716ab8f33a9@l14g2000pre.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 18 Apr 2011 07:14:38 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="lDP3MNALQWyyfJ8GSfFWmQ"; logging-data="10397"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1rQ5VdUmQK75EY94NUUD2wViDx2oU2H0=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <3c4ead8c-1841-415f-8bbe-f716ab8f33a9@l14g2000pre.googlegroups.com> Cancel-Lock: sha1:p5ViyMf37fcXAhCoFApshEn+zWQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3103 On 4/17/2011 10:08 PM, theglazeb wrote: > You don't need to help if you don't want to, but of course it would be > appreciated. If don't want to help, it could be great if you could > point in me in the correct direction - how could make it output random > DEFECT or COOPERATE? and then following on that, how could I start > thinking about a Tit for Tat strategy? The first thing you might want to do is to have clear in your mind what "tit-for-tat" means, and also perhaps try to understand what the Prisoner's Dilemma is really talking about. I found the Wikipedia article very helpful, and of course I found that with Google. Random: you can use Math.random() to generate random numbers. Tit-for-tat, once you understand it, is just very basic array list manipulation. I'll let you think on that part.