diff --git a/index.md b/index.md index c771709..b238e80 100644 --- a/index.md +++ b/index.md @@ -3,6 +3,17 @@ nimble install https://github.com/nim-lang/bigints https://nimdocs.com/nim-lang/bigints/bigints.html +## Dependencies + +The data folder is not included, but its contents are: + +. +├── data +│   ├── stripped +│   └── stripped.gz + +Where stripped.gz can be found at + ## To do - [ ] Exploration of OEIS data diff --git a/jit_bayes b/jit_bayes index 8d532e7..e0db881 100755 Binary files a/jit_bayes and b/jit_bayes differ diff --git a/jit_bayes.nim b/jit_bayes.nim index 61466e3..8097ce9 100644 --- a/jit_bayes.nim +++ b/jit_bayes.nim @@ -6,15 +6,30 @@ import bigints # type: BigInt let file_path = "./data/stripped" +proc startsWithSubsequence(xs: seq[string], ys: seq[string]): bool = + if xs.len == 0: + return true + elif ys.len == 0: + return false + elif xs[0] == ys[0]: + return startsWithSubsequence(xs[1.. 3: - let arr = split(line, ",") - let l = arr.len - let nums = arr[1..(l-2)] # .map(proc (x: string): BigInt = initBigInt(x)) - # echo nums + let seq = split(line, ",") + let l = seq.len + let nums = seq[1..(l-2)] # .map(proc (x: string): BigInt = initBigInt(x)) + if startsWithSubsequence(start, nums): + seqs.add(nums) i = i + 1 - f.close() + +echo seqs diff --git a/bigint/bigint b/scratchpad/bigint/bigint similarity index 100% rename from bigint/bigint rename to scratchpad/bigint/bigint diff --git a/bigint/bigint.nim b/scratchpad/bigint/bigint.nim similarity index 100% rename from bigint/bigint.nim rename to scratchpad/bigint/bigint.nim diff --git a/bigint/parseutils.nim b/scratchpad/bigint/parseutils.nim similarity index 100% rename from bigint/parseutils.nim rename to scratchpad/bigint/parseutils.nim diff --git a/scratchpad/seqs.nim b/scratchpad/seqs.nim new file mode 100644 index 0000000..20f7a0f --- /dev/null +++ b/scratchpad/seqs.nim @@ -0,0 +1 @@ +echo @[ "1", "2" ] in @["1", "2", "3" ]