step: add prettyprint instead
This commit is contained in:
parent
8a593e1eb5
commit
a47306183d
2
index.md
2
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user