Skip to content

Instantly share code, notes, and snippets.

@philnguyen
Created July 8, 2016 02:45
Show Gist options
  • Select an option

  • Save philnguyen/ac796f9505279b9d3a9f9445388cf0a9 to your computer and use it in GitHub Desktop.

Select an option

Save philnguyen/ac796f9505279b9d3a9f9445388cf0a9 to your computer and use it in GitHub Desktop.
#lang racket
(let* ([try (λ (f) (or (f #f) (f #t)))]
[p (λ (x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀)
(and x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀))]
[solve
(λ (q)
(try (λ (n₁)
(try (λ (n₂)
(try (λ (n₃)
(try (λ (n₄)
(try (λ (n₅)
(try (λ (n₆)
(try (λ (n₇)
(try (λ (n₈)
(try (λ (n₉)
(try (λ (n₁₀)
(q n₁ n₂ n₃ n₄ n₅ n₆ n₇ n₈ n₉ n₁₀))))))))))))))))))))))])
(solve p))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment