This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% WARNING: SPOILERS FOR BLUE PRINCE ! | |
core(A, B, C, D, Core) :- | |
Core is (A / B - C) * D. | |
core(A, B, C, D, Core) :- | |
Core is A / B * C - D. | |
core(A, B, C, D, Core) :- | |
% HAND -> 2, since 8 - 1 / 14 * 4 = 2, but is a float.. | |
%Core is (A - B) / C * D. | |
Core is (A - B) * D / C. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf | |
// https://github.com/mndrix/microkanren-prolog/blob/master/microkanren.pl | |
// https://gitlab.com/b2495/fleng/-/blob/master/doc/PCN-tutorial.txt | |
// https://github.com/awalterschulze/gominikanren | |
// goal: f(state) -> stream, or a relation with st/str as last two args | |
// variables are a tuple of one integer value | |
-struct(state(substitutions, variablecounter)) | |
// test: add sleep to equalo, then change composition of disj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% as per https://news.ycombinator.com/item?id=40010066 | |
:- use_module(library(clpfd)). | |
:- table splits/2, combines/3, map_reverse_puzzle/3. | |
reverse_puzzle(List) :- | |
reverse(List, Rev), | |
max_list(List, Max), | |
reverse_puzzle(Max, List, Rev), | |
write(true), nl. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
_ "embed" | |
"image/color" | |
"machine" | |
"math" | |
"math/rand" | |
"strings" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"math" | |
"gocv.io/x/gocv" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin scheme --script | |
;; loads two files from https://github.com/michaelballantyne/faster-miniKanren : | |
;; mk.scm and mk-vicare.scm | |
(load "lib.scm") | |
(define (membero x y) | |
(fresh (a d) | |
(== y `(,a . ,d)) | |
(conde | |
[(== x a)] |