diff --git a/index.md b/index.md index b238e80..cf3169f 100644 --- a/index.md +++ b/index.md @@ -2,6 +2,8 @@ nimble install https://github.com/nim-lang/bigints https://nimdocs.com/nim-lang/bigints/bigints.html +nimble install print +https://github.com/treeform/print ## Dependencies diff --git a/jit_bayes b/jit_bayes index 6ee204a..747ccbc 100755 Binary files a/jit_bayes and b/jit_bayes differ diff --git a/jit_bayes.nim b/jit_bayes.nim index 8cce7f6..fe2f1db 100644 --- a/jit_bayes.nim +++ b/jit_bayes.nim @@ -1,6 +1,8 @@ import strutils import sequtils +import print +## Get sequences let file_path = "./data/stripped" proc getOEIS(): seq[seq[string]] = let f = open(file_path) @@ -18,6 +20,7 @@ proc getOEIS(): seq[seq[string]] = return seqs var seqs = getOEIS() +## Sequence helpers proc startsWithSubsequence(xs: seq[string], ys: seq[string]): bool = if xs.len == 0: return true @@ -35,6 +38,8 @@ proc getSequencesWithStart(seqs: seq[seq[string]], start: seq[string]): seq[seq[ continuations.add(seq) return continuations +## Pretty print sequences + var start = @["1", "2", "3"] var continuations = getSequencesWithStart(seqs, start) -echo continuations +print continuations