• Re: (3-digit combination) Lock.lsp (in Gauche Scheme)

    From HenHanna@21:1/5 to All on Fri Mar 1 02:11:33 2024
    XPost: comp.lang.lisp

    i enjoyed working on the problem of coming up with a 1-line Python code.
    We dont really have LINES in Lisp-Scheme... What would be a similar challenge in Lisp-Scheme?



    (define (Score X Y)
    (list (count list? (map (lambda (y) (member y X)) Y))
    (count zero? (map - X Y))))
    ; <--- Is there a better way? (using equal? instead of - ) ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to All on Thu Feb 29 19:39:06 2024
    XPost: comp.lang.lisp

    FYI, here is an interesting paper about playing Mastermind using a SAT
    solver, beating other approaches. Mastermind turns out to be well-known
    to be NP-complete (a quick web search found that).

    https://www.seas.upenn.edu/~ncollina/Mastermind.pdf

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)