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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.roellig-ltd.de!open-news-network.org!cyclone02.ams2.highwinds-media.com!voer-me.highwinds-media.com!peer02.am1!peering.am1!peer02.fr7!news.highwinds-media.com!post02.fr7!fx29.fr7.POSTED!not-for-mail Message-ID: From: Mike H Reply-To: Mike Hopkins Newsgroups: comp.lang.ada Subject: Re: OT: A bit of Sudoku References: <5365d3f0-43cc-47ef-989c-d47992c84c9f@googlegroups.com> <3d4f61d0-8f8f-49e9-a4ce-8fedffc5da10@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed User-Agent: Turnpike/6.07-M (<8Ez$+Tvw77f+C5diGK2NqJMOjG>) NNTP-Posting-Host: 83.104.138.185 X-Complaints-To: abuse@demon.net X-Trace: 1402052812 83.104.138.185 (Fri, 06 Jun 2014 11:06:52 UTC) NNTP-Posting-Date: Fri, 06 Jun 2014 11:06:52 UTC Date: Fri, 6 Jun 2014 11:59:48 +0100 X-Received-Body-CRC: 1136968962 X-Received-Bytes: 2211 X-Original-Bytes: 2552 Xref: number.nntp.dca.giganews.com comp.lang.ada:186759 Date: 2014-06-06T11:59:48+01:00 List-Id: In message , Stefan.Lucks@uni-weimar.de writes >As I understand for the Sudoku case, the entire change is to assign a >digit to an empty cell, and undoing means to turn the cell's state back >to empty. If I am right, undoing changes is very easy, indeed! Not quite? Unless one is using brute force trial and error, there is some unavoidable housekeeping to be done Every cell, or rather the value or absence of value in that cell, influences the 24 other cells that have its line, column and block in common. However, if the caller retains its own copy of the state of the problem domain at the time that it made its call, it now has an additional piece of information. It now "knows" that calling the callee was not a correct option and, if the program is to continue, must have some alternative course of action up its sleeve. In a recursive process, one such alternative must be to return control to its own caller. -- "Why," said Ford squatting down beside him and shivering, "are you lying face down in the dust?" "It's a very effective way of being wretched," said Marvin. Mike ;-(