Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -2,28 +2,28 @@ import <Utilities/Conversion.sl>;
import <Utilities/Sequence.sl>;
main(args(2)) :=
let
result[i] := args[i] ++ ": " ++ boolToString(can_make_word(args[i], InitBlocks));
in
delimit(result, '\n');
let
result[i] := args[i] ++ ": " ++ boolToString(can_make_word(args[i], InitBlocks));
in
delimit(result, '\n');
InitBlocks := ["BO", "XK", "DQ", "CP", "NA", "GT", "RE", "TG", "QD", "FS", "JW", "HU", "VI", "AN", "OB", "ER", "FS", "LY", "PC", "ZM"];
can_make_word(word(1), blocks(2)) :=
let
choices[i] := i when some(blocks[i] = toUpper(head(word)));
blocksAfterChoice[i] := blocks[(1 ... (choices[i] - 1)) ++ ((choices[i] + 1) ... size(blocks))];
in
true when size(word) = 0
else
false when size(choices) = 0
else
some(can_make_word(tail(word), blocksAfterChoice));
let
choices[i] := i when some(blocks[i] = toUpper(head(word)));
blocksAfterChoice[i] := blocks[(1 ... (choices[i] - 1)) ++ ((choices[i] + 1) ... size(blocks))];
in
true when size(word) = 0
else
false when size(choices) = 0
else
some(can_make_word(tail(word), blocksAfterChoice));
toUpper(letter(0)) :=
let
ascii := asciiToInt(letter);
in
letter when ascii >= 65 and ascii <= 90
else
intToAscii(ascii - 32);
let
ascii := asciiToInt(letter);
in
letter when ascii >= 65 and ascii <= 90
else
intToAscii(ascii - 32);

View file

@ -3,29 +3,29 @@ import <Utilities/Sequence.sl>;
import <RegEx/RegEx.sl>;
main(args(2)) :=
let
result[i] := args[i] ++ ": " ++ boolToString(can_make_word(args[i], InitBlocks));
in
delimit(result, '\n');
let
result[i] := args[i] ++ ": " ++ boolToString(can_make_word(args[i], InitBlocks));
in
delimit(result, '\n');
InitBlocks := "BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM";
can_make_word(word(1), blocks(1)) :=
let
regEx := "(\\a" ++ [toUpper(head(word))] ++ "|" ++ [toUpper(head(word))] ++ "\\a)";
newBlocks := replaceFirst(blocks, regEx, "");
in
true when size(word) = 0
else
false when size(newBlocks) = size(blocks)
else
can_make_word(tail(word), newBlocks);
let
regEx := "(\\a" ++ [toUpper(head(word))] ++ "|" ++ [toUpper(head(word))] ++ "\\a)";
newBlocks := replaceFirst(blocks, regEx, "");
in
true when size(word) = 0
else
false when size(newBlocks) = size(blocks)
else
can_make_word(tail(word), newBlocks);
toUpper(letter(0)) :=
let
ascii := asciiToInt(letter);
in
letter when ascii >= 65 and ascii <= 90
else
intToAscii(ascii - 32);
let
ascii := asciiToInt(letter);
in
letter when ascii >= 65 and ascii <= 90
else
intToAscii(ascii - 32);