From 0ebee8213c86a26d0b16fa8a1811cf29abbf8df5 Mon Sep 17 00:00:00 2001 From: nomennescio Date: Tue, 6 Feb 2024 14:00:34 +0000 Subject: [PATCH] Preload useful vocabs from extra (vocab list supplied and tested by Kacarott ) --- codewars/imager/imager.factor | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/codewars/imager/imager.factor b/codewars/imager/imager.factor index 8eb62ff..0fda51d 100644 --- a/codewars/imager/imager.factor +++ b/codewars/imager/imager.factor @@ -1,12 +1,20 @@ -! Copyright (C) 2022 nomennescio +! Copyright (C) 2022-2024 nomennescio ! see LICENSE.md for license -USING: memory namespaces sequences sequences.rotated system vectors vocabs vocabs.hierarchy vocabs.loader ; +USING: kernel memory namespaces sequences sequences.rotated system vectors vocabs vocabs.hierarchy vocabs.loader ; IN: codewars.imager +CONSTANT: preload-extra-vocabs { + "arrays" "assocs" "combinators" "coroutines" "decimals" "generators" + "grouping" "infix" "lists" "lru-cache" "math" "multisets" "pair-rocket" + "pairs" "path-finding" "qw" "sequences" "sets" "sorting" "splitting" + "trees" "variants" +} + : load-and-save-image ( -- ) "resource:pre" add-vocab-root vocab-roots [ -1 >vector ] change-global "resource:extra" vocab-roots get remove [ load-root ] each + "resource:extra" preload-extra-vocabs [ load-from-root ] with each image-path save-image-and-exit ;