From: Deepak Surti on
On Dec 8, 9:06 pm, Geoffrey Summerhayes <sumr...(a)gmail.com> wrote:
> On Dec 8, 9:45 am, Tamas K Papp <tkp...(a)gmail.com> wrote:
>
>
>
>
>
> > On Tue, 08 Dec 2009 05:52:36 -0800, Deepak Surti wrote:
> > > On Dec 8, 5:11 pm, vippstar <vipps...(a)gmail.com> wrote:
> > >> On Dec 8, 1:48 pm, Deepak Surti <dmsu...(a)gmail.com> wrote:
>
> > >> > Hi,
>
> > >> > I attempted to solve Sudoku. I have posted my solution
> > >> > here:http://deepaksurti.com/lisp/sudoku/mysoln.html
>
> > >> > Kindly let me know your comments.
>
> > >> Your codeboxes don't render correctly in firefox 3 (text is cropped)..
>
> > > Hi,
>
> > > I have fixed the css issue. Thanks for pointing out.
>
> > It is still quite tedious to read the code in such narrow boxes.  If I
> > scroll to the right, I don't see the left part.  I would recommend
> > paste.lisp.org.
>
> Quite tedious to scroll up-down to. Might look nice
> at the OP's screen resolution, on mine it looks like
> a bare tree in the middle of a field of snow. It's
> about 25% text, 75% completely unused, empty space.
>
> --
> Geoff

Hello All,

My sincere apologies for a not so good css skills. I have now
fixed it so that the source code appears without any
horizontal scroll bars.

Thanks for your patience,
Deepak Surti
From: Ron Garret on
In article
<dd3d59f1-bbfd-480c-92ce-d031aa249387(a)s21g2000prm.googlegroups.com>,
Deepak Surti <dmsurti(a)gmail.com> wrote:

> On Dec 8, 9:06 pm, Geoffrey Summerhayes <sumr...(a)gmail.com> wrote:
> > On Dec 8, 9:45 am, Tamas K Papp <tkp...(a)gmail.com> wrote:
> >
> >
> >
> >
> >
> > > On Tue, 08 Dec 2009 05:52:36 -0800, Deepak Surti wrote:
> > > > On Dec 8, 5:11 pm, vippstar <vipps...(a)gmail.com> wrote:
> > > >> On Dec 8, 1:48 pm, Deepak Surti <dmsu...(a)gmail.com> wrote:
> >
> > > >> > Hi,
> >
> > > >> > I attempted to solve Sudoku. I have posted my solution
> > > >> > here:http://deepaksurti.com/lisp/sudoku/mysoln.html
> >
> > > >> > Kindly let me know your comments.
> >
> > > >> Your codeboxes don't render correctly in firefox 3 (text is cropped).
> >
> > > > Hi,
> >
> > > > I have fixed the css issue. Thanks for pointing out.
> >
> > > It is still quite tedious to read the code in such narrow boxes.  If I
> > > scroll to the right, I don't see the left part.  I would recommend
> > > paste.lisp.org.
> >
> > Quite tedious to scroll up-down to. Might look nice
> > at the OP's screen resolution, on mine it looks like
> > a bare tree in the middle of a field of snow. It's
> > about 25% text, 75% completely unused, empty space.
> >
> > --
> > Geoff
>
> Hello All,
>
> My sincere apologies for a not so good css skills. I have now
> fixed it so that the source code appears without any
> horizontal scroll bars.
>
> Thanks for your patience,
> Deepak Surti

It's not your fault. CSS is great for styling but it sucks for layout.

SInce no one else is saying it: I think you did a great job on this
project. Thanks for sharing it.

rg
From: Alberto Riva on
Ron Garret wrote:
>>>>>> On Dec 8, 1:48 pm, Deepak Surti <dmsu...(a)gmail.com> wrote:
>>>>>>> Hi,
>>>>>>> I attempted to solve Sudoku. I have posted my solution
>>>>>>> here:http://deepaksurti.com/lisp/sudoku/mysoln.html
>>>>>>> Kindly let me know your comments.

> SInce no one else is saying it: I think you did a great job on this
> project. Thanks for sharing it.

I haven't looked carefully at your code yet, but this caught my eye:

(defun solved? (board)
"A board is solved if it has no contradictions.!"
(multiple-value-bind (found count)
(contradictions? board)
(if (and (= count 81) (not found))
t
nil)))

The IF is unnecessary, you could simply return:

(and (= count 81) (not found))


And in UPDATE-BOARD you have:

(if (contradictions? board)
nil
(if (equal-boards board newboard)
board
(update-board newboard)))


Which can be written as:

(unless (contradictions? board)
(if (equal-boards board newboard)
board
(update-board newboard)))


Alberto
From: Deepak Surti on
On Dec 9, 2:24 am, Ron Garret <rNOSPA...(a)flownet.com> wrote:
> In article
> <dd3d59f1-bbfd-480c-92ce-d031aa249...(a)s21g2000prm.googlegroups.com>,
>  Deepak Surti <dmsu...(a)gmail.com> wrote:
>
>
>
> > On Dec 8, 9:06 pm, Geoffrey Summerhayes <sumr...(a)gmail.com> wrote:
> > > On Dec 8, 9:45 am, Tamas K Papp <tkp...(a)gmail.com> wrote:
>
> > > > On Tue, 08 Dec 2009 05:52:36 -0800, Deepak Surti wrote:
> > > > > On Dec 8, 5:11 pm, vippstar <vipps...(a)gmail.com> wrote:
> > > > >> On Dec 8, 1:48 pm, Deepak Surti <dmsu...(a)gmail.com> wrote:
>
> > > > >> > Hi,
>
> > > > >> > I attempted to solve Sudoku. I have posted my solution
> > > > >> > here:http://deepaksurti.com/lisp/sudoku/mysoln.html
>
> > > > >> > Kindly let me know your comments.
>
> > > > >> Your codeboxes don't render correctly in firefox 3 (text is cropped).
>
> > > > > Hi,
>
> > > > > I have fixed the css issue. Thanks for pointing out.
>
> > > > It is still quite tedious to read the code in such narrow boxes.  If I
> > > > scroll to the right, I don't see the left part.  I would recommend
> > > > paste.lisp.org.
>
> > > Quite tedious to scroll up-down to. Might look nice
> > > at the OP's screen resolution, on mine it looks like
> > > a bare tree in the middle of a field of snow. It's
> > > about 25% text, 75% completely unused, empty space.
>
> > > --
> > > Geoff
>
> > Hello All,
>
> > My sincere apologies for a not so good css skills. I have now
> > fixed it so that the source code appears without any
> > horizontal scroll bars.
>
> > Thanks for your patience,
> > Deepak Surti
>
> It's not your fault.  CSS is great for styling but it sucks for layout.
>
> SInce no one else is saying it: I think you did a great job on this
> project.  Thanks for sharing it.
>
> rg

Hi Ron,

Thanks for your appreciation. Very motivating for new
Lispers like me.

Regards,
Deepak Surti
From: Deepak Surti on
On Dec 9, 2:44 am, Alberto Riva <a...(a)nospam.ufl.edu> wrote:
> Ron Garret wrote:
> >>>>>> On Dec 8, 1:48 pm, Deepak Surti <dmsu...(a)gmail.com> wrote:
> >>>>>>> Hi,
> >>>>>>> I attempted to solve Sudoku. I have posted my solution
> >>>>>>> here:http://deepaksurti.com/lisp/sudoku/mysoln.html
> >>>>>>> Kindly let me know your comments.
> > SInce no one else is saying it: I think you did a great job on this
> > project.  Thanks for sharing it.
>
> I haven't looked carefully at your code yet, but this caught my eye:
>
> (defun solved? (board)
>    "A board is solved if it has no contradictions.!"
>    (multiple-value-bind (found count)
>        (contradictions? board)
>      (if (and (= count 81) (not found))
>        t
>        nil)))
>
> The IF is unnecessary, you could simply return:
>
>    (and (= count 81) (not found))
>
> And in UPDATE-BOARD you have:
>
> (if (contradictions? board)
>      nil
>    (if (equal-boards board newboard)
>          board
>      (update-board newboard)))
>
> Which can be written as:
>
> (unless (contradictions? board)
>     (if (equal-boards board newboard)
>          board
>       (update-board newboard)))
>
> Alberto

Hi Alberto,

Nice observations. I will incorporate that in my
code. Makes my code shorter and hence better.

Thanks and Regards,
Deepak Surti