Hi,
I'm currently solving problems on Advent of Code 2020
(adventofcode.com/2020) and Rosalind (rosalind.info) in Factor.
I encountered an interesting problem in AoC2020 Day4 Part2: the main
part of the problem is, given an array of 7 strings, validate them for
seven different conditions, i.e. test item 0 for condition 0, item 1
for condition 1, etc.
I initially thought pushing an array of 7 functions and doing "[ call ]
2map" should work, but it didn't. I "solved" the problem by extracting
the 7 strings on the stack (using "7 firstn"), using spread, and
collecting them back (using "7 narray"). Is there a better way to
achieve this?
The full code can be found here:
github.com/Bubbler-4/factor-problem-solving/blob/main/aoc2020/day4/day4.factor
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk