on d452c09 help sign in
1651 lines 23 kB history raw
1# 4j: parsing (bases and base digits)
2### `++ab`
4Primitive parser engine
6A core containing numeric parser primitives.
8Source
9------
11 ++ ab
12 |%
14Examples
15--------
17 > ab
18 <36.ecc 414.gly 100.xkc 1.ypj %164>
20------------------------------------------------------------------------
22### `++bix`
24Parse hex pair
26Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
28Accepts
29-------
31XX
33Produces
34--------
36A an atom. XX
38Source
39------
41 ++ bix (bass 16 (stun [2 2] six))
43Examples
44--------
46 > (scan "07" bix:ab)
47 q=7
48 > (scan "51" bix:ab)
49 q=81
50 > (scan "a3" bix:ab)
51 q=163
53------------------------------------------------------------------------
55### `++hif`
57Parse phonetic pair
59Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
60encoded phonetically.
62Accepts
63-------
65XX
67Produces
68--------
70An atom.
72Source
73------
75 ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
77Examples
78--------
80 > (scan "doznec" hif:ab)
81 q=256
82 > (scan "pittyp" hif:ab)
83 q=48.626
85------------------------------------------------------------------------
87### `++huf`
89Parse two phonetic pairs
91Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
92of two two-byte pairs that are encoded (and scrambled) phonetically.
94Accepts
95-------
97XX
99Produces
100--------
102An atom. XX
104Source
105------
107 ++ huf %+ cook
108 |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
109 ;~(plug hif ;~(pfix hep hif))
111Examples
112--------
114 > (scan "pittyp-pittyp" huf:ab)
115 328.203.557
116 > (scan "tasfyn-partyv" huf:ab)
117 65.792
118 > `@ux`(scan "tasfyn-partyv" huf:ab)
119 0x1.0100
121------------------------------------------------------------------------
123### `++hyf`
125Parse 8 phonetic bytes
127Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
128phonetic bytes.
130Accepts
131-------
133An atom of odor `@pG`
135Produces
136--------
138An atom. XX
140Source
141------
143 ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
145Examples
146--------
148 > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
149 q=365.637.097.828.335.095
150 > `@u`~sondel-forsut-tillyn-nillyt
151 365.637.097.828.335.095
153------------------------------------------------------------------------
155### `++pev`
157Parse \<= 5 base-32
159Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
161Accepts
162-------
164Up to five @uv (base 64) digits.
166Produces
167--------
169An atom.
171Source
172------
174 ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
176Examples
177--------
179 > (scan "a" pev:ab)
180 q=10
181 > (scan "290j" pev:ab)
182 q=74.771
183 > (scan "123456" pev:ab)
184 ! {1 6}
185 ! exit
186 > (scan "090j" pev:ab)
187 ~ <syntax error at [1 11]>
189------------------------------------------------------------------------
191### `++pew`
193Parse \<= 5 base-64
195Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
197Accepts
198-------
200Up to five @uw (base 64) digits.
202Produces
203--------
207Source
208------
210 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
212Examples
213--------
215 > (scan "Q" pew:ab)
216 q=52
217 > (scan "aQ~9" pew:ab)
218 q=2.838.473
219 > `@`0waQ~9
220 2.838.473
221 > (scan "123456" pew:ab)
222 ! {1 6}
223 ! exit
224 > (scan "012345" pew:ab)
225 ! {1 1}
226 ! exit
228------------------------------------------------------------------------
230### `++piv`
232Parse 5 base-32
234Parsing `++rule`. Parses exactly five base-32 digits.
236Accepts
237-------
239Produces
240--------
242Source
243------
245 ++ piv (bass 32 (stun [5 5] siv))
247Examples
248--------
250 > (scan "10b3l" piv:ab)
251 q=1.059.957
252 > (scan "1" piv:ab)
253 ! {1 2}
254 ! exit
256------------------------------------------------------------------------
258### `++piw`
260Parse 5 base-64
262Parsing `++rule`. Parses exactly five base-64 digits.
264Accepts
265-------
267Produces
268--------
270Source
271------
273 ++ piw (bass 64 (stun [5 5] siw))
275Examples
276--------
278 > (scan "2C-pZ" piw:ab)
279 q=43.771.517
280 > (scan "2" piv:ab)
281 ! {1 2}
282 ! exit
284------------------------------------------------------------------------
286### `++qeb`
288Parse \<= 4 binary
290Parsing `++rule`. Parses a binary number of up to 4 digits in length without
291a leading zero.
293Accepts
294-------
296Produces
297--------
299Source
300------
302 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
304Examples
305--------
307 > (scan "1" qeb:ab)
308 q=1
309 > (scan "101" qeb:ab)
310 q=5
311 > (scan "1111" qeb:ab)
312 q=15
313 > (scan "11111" qeb:ab)
314 ! {1 5}
315 ! exit
316 > (scan "01" qeb:ab)
317 ! {1 1}
318 ! exit
320------------------------------------------------------------------------
322### `++qex`
324Parse \<= 4 hex
326Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
327without a leading zero.
329Accepts
330-------
332Produces
333--------
335Source
336------
338 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
340Examples
341--------
343 > (scan "ca" qex:ab)
344 q=202
345 > (scan "18ac" qex:ab)
346 q=6.316
347 > (scan "18acc" qex:ab)
348 ! {1 5}
349 ! exit
350 > (scan "08ac" qex:ab)
351 ! {1 1}
352 ! exit
354------------------------------------------------------------------------
356### `++qib`
358Parse 4 binary
360Parsing `++rule`. Parses exactly four binary digits.
362Accepts
363-------
365Produces
366--------
368Source
369------
371 ++ qib (bass 2 (stun [4 4] sib))
373Examples
374--------
376 > (scan "0001" qib:ab)
377 q=1
378 > (scan "0100" qib:ab)
379 q=4
380 > (scan "110" qib:ab)
381 ! {1 4}
382 ! exit
384------------------------------------------------------------------------
386### `++qix`
388Parse 4 hex
390Parsing `++rule`. Parses exactly four hexadecimal digits.
392Accepts
393-------
395Produces
396--------
398Source
399------
401 ++ qix (bass 16 (stun [4 4] six))
403Examples
404--------
406 > (scan "0100" qix:ab)
407 q=256
408 > (scan "10ff" qix:ab)
409 q=4.351
410 > (scan "0" qix:ab)
411 ! {1 2}
412 ! exit
414------------------------------------------------------------------------
416### `++seb`
418Parse 1
420Parsing `++rule`. Parses the number 1.
422Accepts
423-------
425Produces
426--------
428Source
429------
431 ++ seb (cold 1 (just '1'))
433Examples
434--------
436 > (scan "1" seb:ab)
437 1
438 > (scan "0" seb:ab)
439 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
440 ! {1 1}
441 > (scan "2" seb:ab)
442 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
443 ! {1 1}
445------------------------------------------------------------------------
447### `++sed`
449Parse decimal
451Parsing `++rule`. Parses a nonzero decimal digit.
453Accepts
454-------
456Produces
457--------
459Source
460------
462 ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
464Examples
465--------
467 > (scan "5" sed:ab)
468 5
469 > (scan "0" sed:ab)
470 ! {1 1}
471 ! exit
473------------------------------------------------------------------------
475### `++sev`
477Parse base-32
479Parsing `++rule`. Parses a nonzero base-32 digit
481Accepts
482-------
484Produces
485--------
487Source
488------
490 ++ sev ;~(pose sed sov)
492Examples
493--------
495 > (scan "c" sev:ab)
496 12
497 ~zod/socialnet=> (scan "0" sev:ab)
498 ! {1 1}
499 ! exit
501------------------------------------------------------------------------
503### `++sew`
505Parse base-64
507Parsing `++rule`. Parses a nonzero base-64 digit
509Accepts
510-------
512Produces
513--------
515Source
516------
518 ++ sew ;~(pose sed sow)
520Examples
521--------
523 > (scan "M" sew:ab)
524 48
525 > (scan "0" sew:ab)
526 ! {1 1}
527 ! exit
529------------------------------------------------------------------------
531### `++sex`
533Parse hex
535Parsing `++rule`. Parses a nonzero hexadecimal digit.
537Accepts
538-------
540Produces
541--------
543Source
544------
546 ++ sex ;~(pose sed sox)
548Examples
549--------
551 > (scan "e" sex:ab)
552 14
553 > (scan "0" sex:ab)
554 ! {1 1}
555 ! exit
557------------------------------------------------------------------------
559### `++sib`
561Parse binary
563Parsing `++rule`. Parses a binary digit.
565Accepts
566-------
568Produces
569--------
571Source
572------
574 ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
576Examples
577--------
579 > (scan "1" sib:ab)
580 1
581 ~zod/socialnet=> (scan "0" sib:ab)
582 0
584------------------------------------------------------------------------
586### `++sid`
588Parse decimal
590Parsing `++rule`. Parses a decimal digit.
592Accepts
593-------
595Produces
596--------
598Source
599------
601 ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
603Examples
604--------
606 > (scan "5" sid:ab)
607 5
609------------------------------------------------------------------------
611### `++siv`
613Parse base-32
615Parsing `++rule`. Parses a base-32 digit.
617Accepts
618-------
620Produces
621--------
623Source
624------
626 ++ siv ;~(pose sid sov)
628Examples
629--------
631 > (scan "c" siv:ab)
632 12
634------------------------------------------------------------------------
636### `++siw`
638Parse base-64
640Parsing `++rule`. Parses a base-64 digit.
642Accepts
643-------
645Produces
646--------
648Source
649------
651 ++ siw ;~(pose sid sow)
653Examples
654--------
656 > (scan "M" siw:ab)
657 48
659------------------------------------------------------------------------
661### `++six`
663Parse hex
665Parsing `++rule`. Parses a hexadecimal digit.
667Accepts
668-------
670Produces
671--------
673Source
674------
676 ++ six ;~(pose sid sox)
678Examples
679--------
681 > (scan "e" six:ab)
682 14
684------------------------------------------------------------------------
686### `++sov`
688Parse base-32
690Parsing `++rule`. Parses a base-32 letter.
692Accepts
693-------
695Produces
696--------
698Source
699------
701 ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
703Examples
704--------
706 > (scan "c" sov:ab)
707 12
709------------------------------------------------------------------------
711### `++sow`
713Parse base-64
715Parsing `++rule`. Parses a base-64 letter/symbol.
717Accepts
718-------
720Produces
721--------
723Source
724------
726 ++ sow ;~ pose
727 (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
728 (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
729 (cold 62 (just '-'))
730 (cold 63 (just '~'))
731 ==
733Examples
734--------
736 > (scan "M" sow:ab)
737 48
739------------------------------------------------------------------------
741### `++sox`
743Parse hex letter
745Parsing `++rule`. Parses a hexadecimal letter.
747Accepts
748-------
750Produces
751--------
753Source
754------
756 ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
758Examples
759--------
761 > (scan "e" sox:ab)
762 14
764------------------------------------------------------------------------
766### `++ted`
768Parse \<= 3 decimal
770Parsing `++rule`. Parses a decimal number of up to 3 digits without a
771leading zero.
773Accepts
774-------
776Produces
777--------
779Source
780------
782 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
784Examples
785--------
787 > (scan "21" ted:ab)
788 q=21
789 > (scan "214" ted:ab)
790 q=214
791 > (scan "2140" ted:ab)
792 {1 4}
793 > (scan "0" ted:ab)
794 ! {1 1}
795 ! exit
797------------------------------------------------------------------------
799### `++tip`
801Leading phonetic byte
803Parsing `++rule`. Parses the leading phonetic byte, which represents a
804syllable.
806Accepts
807-------
809Produces
810--------
812Source
813------
815 ++ tip (sear |=(a/@ (ins:po a)) til)
817Examples
818--------
820 > (scan "doz" tip:ab)
821 0
822 > (scan "pit" tip:ab)
823 242
825------------------------------------------------------------------------
827### `++tiq`
829Trailing phonetic syllable
831Parsing `++rule`. Parses the trailing phonetic byte, which represents a
832syllable.
834Accepts
835-------
837Produces
838--------
840Source
841------
843 ++ tiq (sear |=(a/@ (ind:po a)) til)
845Examples
846--------
848 > (scan "zod" tiq:ab)
849 0
850 > (scan "nec" tiq:ab)
851 1
853------------------------------------------------------------------------
855### `++tid`
857Parse 3 decimal digits
859Parsing `++rule`. Parses exactly three decimal digits.
861Accepts
862-------
864Produces
865--------
867Source
868------
870 ++ tid (bass 10 (stun [3 3] sid))
872Examples
873--------
875 > (scan "013" tid:ab)
876 q=13
877 > (scan "01" tid:ab)
878 ! {1 3}
879 ! exit
881------------------------------------------------------------------------
883### `++til`
885Parse 3 lowercase
887Parsing `++rule`. Parses exactly three lowercase letters.
889Accepts
890-------
892Produces
893--------
895Source
896------
898 ++ til (boss 256 (stun [3 3] low))
900Examples
901--------
903 > (scan "mer" til:ab)
904 q=7.497.069
905 > `@t`(scan "mer" til:ab)
906 'mer'
907 > (scan "me" til:ab)
908 ! {1 3}
909 ! exit
911------------------------------------------------------------------------
913### `++urs`
915Parse span characters
917Parsing rule. Parses characters from an atom of the span odor `@ta`.
919Accepts
920-------
922Produces
923--------
925Source
926------
928 ++ urs %+ cook
929 |=(a/tape (rap 3 ^-((list @) a)))
930 (star ;~(pose nud low hep dot sig cab))
932Examples
933--------
935 > `@ta`(scan "asa-lom_tak" urs:ab)
936 ~.asa-lom_tak
937 > `@t`(scan "asa-lom_tak" urs:ab)
938 'asa-lom_tak'
940------------------------------------------------------------------------
942### `++urt`
944Parse non-`_` span
946Parsing rule. Parses all characters of the span odor `@ta` except
947for cab, `_`.
949Accepts
950-------
952Produces
953--------
955Source
956------
958 ++ urt %+ cook
959 |=(a/tape (rap 3 ^-((list @) a)))
960 (star ;~(pose nud low hep dot sig))
962Examples
963--------
965 > `@t`(scan "asa-lom.t0k" urt:ab)
966 'asa-lom.t0k'
968------------------------------------------------------------------------
970### `++voy`
972Parse bas, soq, or bix
974Parsing rule. Parses an escaped backslash, single quote, or hex pair
975byte.
977Accepts
978-------
980Produces
981--------
983Source
984------
986 ++ voy ;~(pfix bas ;~(pose bas soq bix))
988Examples
989--------
991 > (scan "\\0a" voy:ab)
992 q=10
993 > (scan "\\'" voy:ab)
994 q=39
996------------------------------------------------------------------------
998### `++ag`
1000Top-level atom parser engine
1002A core containing top-level atom parsers.
1004Accepts
1005-------
1007Produces
1008--------
1010Source
1011------
1013 ++ ag
1014 |%
1016Examples
1017--------
1019 > ag
1020 <14.vpu 414.mof 100.xkc 1.ypj %164>
1022------------------------------------------------------------------------
1024### `++ape`
1026Parse 0 or rule
1028Parser modifier. Parses 0 or the sample rule `fel`.
1030Accepts
1031-------
1033Produces
1034--------
1036`fel` is a `rule`.
1038Source
1039------
1041 ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1044Examples
1045--------
1047 > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1048 ~[2 0 2]
1050------------------------------------------------------------------------
1052### `++bay`
1054Parses binary number
1056Parsing rule. Parses a binary number without a leading zero.
1058Accepts
1059-------
1061Produces
1062--------
1064Source
1065------
1067 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1069Examples
1070--------
1072 > (scan "10.0110" bay:ag)
1073 q=38
1075------------------------------------------------------------------------
1077### `++bip`
1079Parse IPv6
1081Parsing rule. Parses a `@is`, an IPv6 address.
1083Accepts
1084-------
1086Produces
1087--------
1089Source
1090------
1092 ++ bip =+ tod=(ape qex:ab)
1093 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1095Examples
1096--------
1098 > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1099 q=283.183.420.760.121.105.516.068.864
1100 > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1101 .0.0.ea.3e6c.0.0.0.0
1103------------------------------------------------------------------------
1105### `++dem`
1107Parse decimal with dots
1109Parsing rule. Parses a decimal number that includes dot separators.
1111Accepts
1112-------
1114Produces
1115--------
1117Source
1118------
1120 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1123Examples
1124--------
1126 > (scan "52" dem:ag)
1127 q=52
1128 > (scan "13.507" dem:ag)
1129 q=13.507
1131------------------------------------------------------------------------
1133### `++dim`
1135Parse decimal number
1137Parsing rule. Parses a decimal number without a leading zero.
1139Accepts
1140-------
1142Produces
1143--------
1145Source
1146------
1148 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1150Examples
1151--------
1153 > (scan "52" dim:ag)
1154 q=52
1155 > (scan "013507" dim:ag)
1156 ! {1 2}
1157 ! exit
1159------------------------------------------------------------------------
1161### `++dum`
1163Parse decimal with leading `0`
1165Parsing rule. Parses a decmial number with leading zeroes.
1167Accepts
1168-------
1170Produces
1171--------
1173Source
1174------
1176 ++ dum (bass 10 (plus sid:ab))
1178Examples
1179--------
1181 > (scan "52" dum:ag)
1182 q=52
1183 > (scan "0000052" dum:ag)
1184 q=52
1185 > (scan "13507" dim:ag)
1186 q=13.507
1188------------------------------------------------------------------------
1190### `++fed`
1192Parse phonetic base
1194Parsing rule. Parses an atom of odor `@p`, the phonetic base.
1196Accepts
1197-------
1199Produces
1200--------
1202Source
1203------
1205 ++ fed ;~ pose
1206 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1207 huf:ab
1208 hif:ab
1209 tiq:ab
1210 ==
1212Examples
1213--------
1215 > (scan "zod" fed:ag)
1217 > (scan "nec" fed:ag)
1219 > (scan "sondel" fed:ag)
1220 9.636
1221 > ~tillyn-nillyt
1222 ~tillyn-nillyt
1223 > (scan "tillyn-nillyt" fed:ag)
1224 3.569.565.175
1225 > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1226 15.331.165.687.565.582.592
1227 > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1228 282.810.089.790.159.633.869.501.053.313.363.681.181
1230------------------------------------------------------------------------
1232### `++hex`
1234Parse hex
1236Parsing rule. Parses a hexadecimal number
1238Accepts
1239-------
1241Produces
1242--------
1244Source
1245------
1247 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1249Examples
1250--------
1252 > (scan "4" hex:ag)
1253 q=4
1254 > (scan "1a" hex:ag)
1255 q=26
1256 > (scan "3.ac8d" hex:ag)
1257 q=240.781
1258 > `@ux`(scan "3.ac8d" hex:ag)
1259 0x3.ac8d
1261------------------------------------------------------------------------
1263### `++lip`
1265Parse IPv4 address
1267Parsing rule. Parses an IPv4 address.
1269Accepts
1270-------
1272Produces
1273--------
1275Source
1276------
1278 ++ lip =+ tod=(ape ted:ab)
1279 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1281Examples
1282--------
1284 > (scan "127.0.0.1" lip:ag)
1285 q=2.130.706.433
1286 > `@if`(scan "127.0.0.1" lip:ag)
1287 .127.0.0.1
1288 > `@if`(scan "8.8.8.8" lip:ag)
1289 .8.8.8.8
1291------------------------------------------------------------------------
1293### `++viz`
1295Parse Base-32 with dots
1297Parsing rule. Parses a Base-32 number with dot separators.
1299Accepts
1300-------
1302Produces
1303--------
1305Source
1306------
1308 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1310Examples
1311--------
1313 > (scan "e2.ol4pm" viz:ag)
1314 q=15.125.353.270
1316------------------------------------------------------------------------
1318### `++vum`
1320Parse base-32 string
1322Parsing rule. Parses a raw base-32 string.
1324Accepts
1325-------
1327Produces
1328--------
1330Source
1331------
1333 ++ vum (bass 32 (plus siv:ab))
1335Examples
1336--------
1338 > (scan "e2ol4pm" vum:ag)
1339 q=15.125.353.270
1341------------------------------------------------------------------------
1343### `++wiz`
1345Parse base-64
1347Parsing rule. Parses a base-64 number.
1349Accepts
1350-------
1352Produces
1353--------
1355Source
1356------
1358 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1359 --
1360 ::
1362Examples
1363--------
1365 > (scan "e2O.l4Xpm" wiz:ag)
1366 q=61.764.130.813.526
1368***
1369### `++mu`
1371Core used to scramble 16-bit atoms
1373A door that contains arms that are used to scramble two atoms, `top`
1374and `bot`. Used especially in the phonetic base to disguise the
1375relationship between a destroyer and its cruiser.
1377Accepts
1378-------
1380Produces
1381--------
1383`bot` is an atom.
1385`top` is an atom.
1387Source
1388------
1390 ++ mu
1391 |_ [top/@ bot/@]
1393Examples
1394--------
1396 > ~(. mu 0x20e5 0x5901)
1397 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1399------------------------------------------------------------------------
1401### `++zag`
1403Add bottom into top
1405Produces the cell of `top` and `bot` with `top` scrambled to the result
1406of adding `bot` to `top` modulo 16. Used to scramble the name of a
1407destroyer.
1409Accepts
1410-------
1412Produces
1413--------
1415`bot` is an atom.
1417`top` is an atom.
1419Source
1420------
1422 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1425Examples
1426--------
1428 > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1429 [0x22e1 0x201]
1431------------------------------------------------------------------------
1433### `++zig`
1435Subtract bottom from top
1437The inverse of `++zag`. Produces the cell of `top` and `bot` with
1438`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1439and the 16-bit complement of `bot`. Used to unscramble the name of the
1440destroyer.
1442Accepts
1443-------
1445Produces
1446--------
1448`bot` is an atom.
1450`top` is an atom.
1452Source
1453------
1455 ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1457Examples
1458--------
1460 > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1461 [0x1f04 0x1042]
1463------------------------------------------------------------------------
1465### `++zug`
1467Concatenate into atom
1469Produces the concatenation of `top` and `bot`. Used to assemble a
1470destroyer name.
1472Accepts
1473-------
1475Produces
1476--------
1478`bot` is an atom.
1480`top` is an atom.
1482Source
1483------
1485 ++ zug (mix (lsh 4 1 top) bot)
1487Examples
1488--------
1490 > `@ux`~(zug mu 0x10e1 0xfa)
1491 0x10e1.00fa
1495***
1496### `++ne`
1498Digit rendering engine
1500A door containing arms that render digits at bases 10, 16, 32, and
150164.
1503Accepts
1504-------
1506Produces
1507--------
1509`tig` is an `atom`.
1511Source
1512------
1514 ++ ne
1515 |_ tig/@
1517Examples
1518--------
1520 > ~(. ne 20)
1521 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1523------------------------------------------------------------------------
1525### `++d`
1527Render decimal
1529Renders a decimal digit as an atom of an ACII byte value.
1531Accepts
1532-------
1534Produces
1535--------
1537`tig` is an `atom`.
1539Source
1540------
1542 ++ d (add tig '0')
1544Examples
1545--------
1547 > `@t`~(d ne 7)
1548 '7'
1550------------------------------------------------------------------------
1552### `++x`
1554Render hex
1556Renders a hexadecimal digit as an atom of an ASCII byte value.
1558Accepts
1559-------
1561Produces
1562--------
1564`tig` is an `atom`.
1566Source
1567------
1569 ++ x ?:((gte tig 10) (add tig 87) d)
1571Examples
1572--------
1574 > `@t`~(x ne 7)
1575 '7'
1576 > `@t`~(x ne 14)
1577 'e'
1579------------------------------------------------------------------------
1581### `++v`
1583Render base-32
1585Renders a base-32 digit as an atom of an ASCII byte value.
1587Accepts
1588-------
1590Produces
1591--------
1593Source
1594------
1596 ++ v ?:((gte tig 10) (add tig 87) d)
1598Examples
1599--------
1601 > `@t`~(v ne 7)
1602 '7'
1603 > `@t`~(v ne 14)
1604 'e'
1605 > `@t`~(v ne 25)
1606 'p'
1608------------------------------------------------------------------------
1610### `++w`
1612Render base-64
1614Renders a base-64 digit as an atom of an ASCII byte value.
1616Accepts
1617-------
1619Produces
1620--------
1622`tig` is an `atom`.
1624Source
1625------
1627 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1628 --
1629 ::
1631Examples
1632--------
1634 > `@t`~(w ne 7)
1635 '7'
1636 > `@t`~(w ne 14)
1637 'e'
1638 > `@t`~(w ne 25)
1639 'p'
1640 > `@t`~(w ne 52)
1641 'Q'
1642 > `@t`~(w ne 61)
1643 'Z'
1644 > `@t`~(w ne 63)
1645 '~'
1646 > `@t`~(w ne 62)
1647 '-'
1651***