From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!eu.feeder.erje.net!feeder.erje.net!us.feeder.erje.net!news.ripco.com!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx28.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:35.0) Gecko/20100101 Thunderbird/35.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: dynamically create tasks References: <47e42c27-69ba-44fc-861f-c230f5ac04f4@googlegroups.com> In-Reply-To: <47e42c27-69ba-44fc-861f-c230f5ac04f4@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Sat, 11 Oct 2014 02:20:41 UTC Organization: TeraNews.com Date: Fri, 10 Oct 2014 20:20:35 -0600 X-Received-Bytes: 1626 X-Received-Body-CRC: 3196056902 Xref: news.eternal-september.org comp.lang.ada:22338 Date: 2014-10-10T20:20:35-06:00 List-Id: On 10/10/2014 7:49 PM, compguy45@gmail.com wrote: > If you have one task body and would like to create 5 of these > tasks since there is one task body there will only be one > task created plus main task....how would you create 20 tasks > with same body? > > is there way to do this? Yes; it's essentially what I do in my solution to the No-Connection puzzle on Rosetta-code. ( See: http://rosettacode.org/wiki/Solve_the_no_connection_puzzle#Ada ) The Idea is that the tasks are fed a list of possible numbers and a state (usu. inherited from prior tasks which create them dynamically) -- if the given state cannot be a solution, its task simply ends otherwise there are two options (1) the state is a complete board [that is, the puzzle is solved], OR (2) the task creates a task for every possible number which can be in the next position.