on 6d45ede help sign in
1656 lines 23 kB history raw
1---
2navhome: /docs
3---
6# 4j: parsing (bases and base digits)
7### `++ab`
9Primitive parser engine
11A core containing numeric parser primitives.
13Source
14------
16 ++ ab
17 |%
19Examples
20--------
22 > ab
23 <36.ecc 414.gly 100.xkc 1.ypj %164>
25------------------------------------------------------------------------
27### `++bix`
29Parse hex pair
31Parsing `++rule`. Parses a pair of base-16 digits. Used in escapes.
33Accepts
34-------
36XX
38Produces
39--------
41A an atom. XX
43Source
44------
46 ++ bix (bass 16 (stun [2 2] six))
48Examples
49--------
51 > (scan "07" bix:ab)
52 q=7
53 > (scan "51" bix:ab)
54 q=81
55 > (scan "a3" bix:ab)
56 q=163
58------------------------------------------------------------------------
60### `++hif`
62Parse phonetic pair
64Parsing `++rule`. Parses an atom of odor `@pE`, a phrase of two bytes
65encoded phonetically.
67Accepts
68-------
70XX
72Produces
73--------
75An atom.
77Source
78------
80 ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
82Examples
83--------
85 > (scan "doznec" hif:ab)
86 q=256
87 > (scan "pittyp" hif:ab)
88 q=48.626
90------------------------------------------------------------------------
92### `++huf`
94Parse two phonetic pairs
96Parsing `++rule`. Parses and unscrambles an atom of odor @pF, a phrase
97of two two-byte pairs that are encoded (and scrambled) phonetically.
99Accepts
100-------
102XX
104Produces
105--------
107An atom. XX
109Source
110------
112 ++ huf %+ cook
113 |=([a/@ b/@] (wred:un ~(zug mu ~(zag mu [a b]))))
114 ;~(plug hif ;~(pfix hep hif))
116Examples
117--------
119 > (scan "pittyp-pittyp" huf:ab)
120 328.203.557
121 > (scan "tasfyn-partyv" huf:ab)
122 65.792
123 > `@ux`(scan "tasfyn-partyv" huf:ab)
124 0x1.0100
126------------------------------------------------------------------------
128### `++hyf`
130Parse 8 phonetic bytes
132Parsing `++rule`. Parses an atom of odor @pG, a phrase of eight of
133phonetic bytes.
135Accepts
136-------
138An atom of odor `@pG`
140Produces
141--------
143An atom. XX
145Source
146------
148 ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
150Examples
151--------
153 > (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
154 q=365.637.097.828.335.095
155 > `@u`~sondel-forsut-tillyn-nillyt
156 365.637.097.828.335.095
158------------------------------------------------------------------------
160### `++pev`
162Parse \<= 5 base-32
164Parsing `++rule`. Parses up to five base-32 digits without a leading zero.
166Accepts
167-------
169Up to five @uv (base 64) digits.
171Produces
172--------
174An atom.
176Source
177------
179 ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
181Examples
182--------
184 > (scan "a" pev:ab)
185 q=10
186 > (scan "290j" pev:ab)
187 q=74.771
188 > (scan "123456" pev:ab)
189 ! {1 6}
190 ! exit
191 > (scan "090j" pev:ab)
192 ~ <syntax error at [1 11]>
194------------------------------------------------------------------------
196### `++pew`
198Parse \<= 5 base-64
200Parsing `++rule`. Parses up to five base-64 digits without a leading zero.
202Accepts
203-------
205Up to five @uw (base 64) digits.
207Produces
208--------
212Source
213------
215 ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
217Examples
218--------
220 > (scan "Q" pew:ab)
221 q=52
222 > (scan "aQ~9" pew:ab)
223 q=2.838.473
224 > `@`0waQ~9
225 2.838.473
226 > (scan "123456" pew:ab)
227 ! {1 6}
228 ! exit
229 > (scan "012345" pew:ab)
230 ! {1 1}
231 ! exit
233------------------------------------------------------------------------
235### `++piv`
237Parse 5 base-32
239Parsing `++rule`. Parses exactly five base-32 digits.
241Accepts
242-------
244Produces
245--------
247Source
248------
250 ++ piv (bass 32 (stun [5 5] siv))
252Examples
253--------
255 > (scan "10b3l" piv:ab)
256 q=1.059.957
257 > (scan "1" piv:ab)
258 ! {1 2}
259 ! exit
261------------------------------------------------------------------------
263### `++piw`
265Parse 5 base-64
267Parsing `++rule`. Parses exactly five base-64 digits.
269Accepts
270-------
272Produces
273--------
275Source
276------
278 ++ piw (bass 64 (stun [5 5] siw))
280Examples
281--------
283 > (scan "2C-pZ" piw:ab)
284 q=43.771.517
285 > (scan "2" piv:ab)
286 ! {1 2}
287 ! exit
289------------------------------------------------------------------------
291### `++qeb`
293Parse \<= 4 binary
295Parsing `++rule`. Parses a binary number of up to 4 digits in length without
296a leading zero.
298Accepts
299-------
301Produces
302--------
304Source
305------
307 ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
309Examples
310--------
312 > (scan "1" qeb:ab)
313 q=1
314 > (scan "101" qeb:ab)
315 q=5
316 > (scan "1111" qeb:ab)
317 q=15
318 > (scan "11111" qeb:ab)
319 ! {1 5}
320 ! exit
321 > (scan "01" qeb:ab)
322 ! {1 1}
323 ! exit
325------------------------------------------------------------------------
327### `++qex`
329Parse \<= 4 hex
331Parsing `++rule`. Parses a hexadecimal number of up to 4 digits in length
332without a leading zero.
334Accepts
335-------
337Produces
338--------
340Source
341------
343 ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
345Examples
346--------
348 > (scan "ca" qex:ab)
349 q=202
350 > (scan "18ac" qex:ab)
351 q=6.316
352 > (scan "18acc" qex:ab)
353 ! {1 5}
354 ! exit
355 > (scan "08ac" qex:ab)
356 ! {1 1}
357 ! exit
359------------------------------------------------------------------------
361### `++qib`
363Parse 4 binary
365Parsing `++rule`. Parses exactly four binary digits.
367Accepts
368-------
370Produces
371--------
373Source
374------
376 ++ qib (bass 2 (stun [4 4] sib))
378Examples
379--------
381 > (scan "0001" qib:ab)
382 q=1
383 > (scan "0100" qib:ab)
384 q=4
385 > (scan "110" qib:ab)
386 ! {1 4}
387 ! exit
389------------------------------------------------------------------------
391### `++qix`
393Parse 4 hex
395Parsing `++rule`. Parses exactly four hexadecimal digits.
397Accepts
398-------
400Produces
401--------
403Source
404------
406 ++ qix (bass 16 (stun [4 4] six))
408Examples
409--------
411 > (scan "0100" qix:ab)
412 q=256
413 > (scan "10ff" qix:ab)
414 q=4.351
415 > (scan "0" qix:ab)
416 ! {1 2}
417 ! exit
419------------------------------------------------------------------------
421### `++seb`
423Parse 1
425Parsing `++rule`. Parses the number 1.
427Accepts
428-------
430Produces
431--------
433Source
434------
436 ++ seb (cold 1 (just '1'))
438Examples
439--------
441 > (scan "1" seb:ab)
442 1
443 > (scan "0" seb:ab)
444 ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
445 ! {1 1}
446 > (scan "2" seb:ab)
447 ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
448 ! {1 1}
450------------------------------------------------------------------------
452### `++sed`
454Parse decimal
456Parsing `++rule`. Parses a nonzero decimal digit.
458Accepts
459-------
461Produces
462--------
464Source
465------
467 ++ sed (cook |=(a/@ (sub a '0')) (shim '1' '9'))
469Examples
470--------
472 > (scan "5" sed:ab)
473 5
474 > (scan "0" sed:ab)
475 ! {1 1}
476 ! exit
478------------------------------------------------------------------------
480### `++sev`
482Parse base-32
484Parsing `++rule`. Parses a nonzero base-32 digit
486Accepts
487-------
489Produces
490--------
492Source
493------
495 ++ sev ;~(pose sed sov)
497Examples
498--------
500 > (scan "c" sev:ab)
501 12
502 ~zod/socialnet=> (scan "0" sev:ab)
503 ! {1 1}
504 ! exit
506------------------------------------------------------------------------
508### `++sew`
510Parse base-64
512Parsing `++rule`. Parses a nonzero base-64 digit
514Accepts
515-------
517Produces
518--------
520Source
521------
523 ++ sew ;~(pose sed sow)
525Examples
526--------
528 > (scan "M" sew:ab)
529 48
530 > (scan "0" sew:ab)
531 ! {1 1}
532 ! exit
534------------------------------------------------------------------------
536### `++sex`
538Parse hex
540Parsing `++rule`. Parses a nonzero hexadecimal digit.
542Accepts
543-------
545Produces
546--------
548Source
549------
551 ++ sex ;~(pose sed sox)
553Examples
554--------
556 > (scan "e" sex:ab)
557 14
558 > (scan "0" sex:ab)
559 ! {1 1}
560 ! exit
562------------------------------------------------------------------------
564### `++sib`
566Parse binary
568Parsing `++rule`. Parses a binary digit.
570Accepts
571-------
573Produces
574--------
576Source
577------
579 ++ sib (cook |=(a/@ (sub a '0')) (shim '0' '1'))
581Examples
582--------
584 > (scan "1" sib:ab)
585 1
586 ~zod/socialnet=> (scan "0" sib:ab)
587 0
589------------------------------------------------------------------------
591### `++sid`
593Parse decimal
595Parsing `++rule`. Parses a decimal digit.
597Accepts
598-------
600Produces
601--------
603Source
604------
606 ++ sid (cook |=(a/@ (sub a '0')) (shim '0' '9'))
608Examples
609--------
611 > (scan "5" sid:ab)
612 5
614------------------------------------------------------------------------
616### `++siv`
618Parse base-32
620Parsing `++rule`. Parses a base-32 digit.
622Accepts
623-------
625Produces
626--------
628Source
629------
631 ++ siv ;~(pose sid sov)
633Examples
634--------
636 > (scan "c" siv:ab)
637 12
639------------------------------------------------------------------------
641### `++siw`
643Parse base-64
645Parsing `++rule`. Parses a base-64 digit.
647Accepts
648-------
650Produces
651--------
653Source
654------
656 ++ siw ;~(pose sid sow)
658Examples
659--------
661 > (scan "M" siw:ab)
662 48
664------------------------------------------------------------------------
666### `++six`
668Parse hex
670Parsing `++rule`. Parses a hexadecimal digit.
672Accepts
673-------
675Produces
676--------
678Source
679------
681 ++ six ;~(pose sid sox)
683Examples
684--------
686 > (scan "e" six:ab)
687 14
689------------------------------------------------------------------------
691### `++sov`
693Parse base-32
695Parsing `++rule`. Parses a base-32 letter.
697Accepts
698-------
700Produces
701--------
703Source
704------
706 ++ sov (cook |=(a/@ (sub a 87)) (shim 'a' 'v'))
708Examples
709--------
711 > (scan "c" sov:ab)
712 12
714------------------------------------------------------------------------
716### `++sow`
718Parse base-64
720Parsing `++rule`. Parses a base-64 letter/symbol.
722Accepts
723-------
725Produces
726--------
728Source
729------
731 ++ sow ;~ pose
732 (cook |=(a/@ (sub a 87)) (shim 'a' 'z'))
733 (cook |=(a/@ (sub a 29)) (shim 'A' 'Z'))
734 (cold 62 (just '-'))
735 (cold 63 (just '~'))
736 ==
738Examples
739--------
741 > (scan "M" sow:ab)
742 48
744------------------------------------------------------------------------
746### `++sox`
748Parse hex letter
750Parsing `++rule`. Parses a hexadecimal letter.
752Accepts
753-------
755Produces
756--------
758Source
759------
761 ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f'))
763Examples
764--------
766 > (scan "e" sox:ab)
767 14
769------------------------------------------------------------------------
771### `++ted`
773Parse \<= 3 decimal
775Parsing `++rule`. Parses a decimal number of up to 3 digits without a
776leading zero.
778Accepts
779-------
781Produces
782--------
784Source
785------
787 ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
789Examples
790--------
792 > (scan "21" ted:ab)
793 q=21
794 > (scan "214" ted:ab)
795 q=214
796 > (scan "2140" ted:ab)
797 {1 4}
798 > (scan "0" ted:ab)
799 ! {1 1}
800 ! exit
802------------------------------------------------------------------------
804### `++tip`
806Leading phonetic byte
808Parsing `++rule`. Parses the leading phonetic byte, which represents a
809syllable.
811Accepts
812-------
814Produces
815--------
817Source
818------
820 ++ tip (sear |=(a/@ (ins:po a)) til)
822Examples
823--------
825 > (scan "doz" tip:ab)
826 0
827 > (scan "pit" tip:ab)
828 242
830------------------------------------------------------------------------
832### `++tiq`
834Trailing phonetic syllable
836Parsing `++rule`. Parses the trailing phonetic byte, which represents a
837syllable.
839Accepts
840-------
842Produces
843--------
845Source
846------
848 ++ tiq (sear |=(a/@ (ind:po a)) til)
850Examples
851--------
853 > (scan "zod" tiq:ab)
854 0
855 > (scan "nec" tiq:ab)
856 1
858------------------------------------------------------------------------
860### `++tid`
862Parse 3 decimal digits
864Parsing `++rule`. Parses exactly three decimal digits.
866Accepts
867-------
869Produces
870--------
872Source
873------
875 ++ tid (bass 10 (stun [3 3] sid))
877Examples
878--------
880 > (scan "013" tid:ab)
881 q=13
882 > (scan "01" tid:ab)
883 ! {1 3}
884 ! exit
886------------------------------------------------------------------------
888### `++til`
890Parse 3 lowercase
892Parsing `++rule`. Parses exactly three lowercase letters.
894Accepts
895-------
897Produces
898--------
900Source
901------
903 ++ til (boss 256 (stun [3 3] low))
905Examples
906--------
908 > (scan "mer" til:ab)
909 q=7.497.069
910 > `@t`(scan "mer" til:ab)
911 'mer'
912 > (scan "me" til:ab)
913 ! {1 3}
914 ! exit
916------------------------------------------------------------------------
918### `++urs`
920Parse span characters
922Parsing rule. Parses characters from an atom of the span odor `@ta`.
924Accepts
925-------
927Produces
928--------
930Source
931------
933 ++ urs %+ cook
934 |=(a/tape (rap 3 ^-((list @) a)))
935 (star ;~(pose nud low hep dot sig cab))
937Examples
938--------
940 > `@ta`(scan "asa-lom_tak" urs:ab)
941 ~.asa-lom_tak
942 > `@t`(scan "asa-lom_tak" urs:ab)
943 'asa-lom_tak'
945------------------------------------------------------------------------
947### `++urt`
949Parse non-`_` span
951Parsing rule. Parses all characters of the span odor `@ta` except
952for cab, `_`.
954Accepts
955-------
957Produces
958--------
960Source
961------
963 ++ urt %+ cook
964 |=(a/tape (rap 3 ^-((list @) a)))
965 (star ;~(pose nud low hep dot sig))
967Examples
968--------
970 > `@t`(scan "asa-lom.t0k" urt:ab)
971 'asa-lom.t0k'
973------------------------------------------------------------------------
975### `++voy`
977Parse bas, soq, or bix
979Parsing rule. Parses an escaped backslash, single quote, or hex pair
980byte.
982Accepts
983-------
985Produces
986--------
988Source
989------
991 ++ voy ;~(pfix bas ;~(pose bas soq bix))
993Examples
994--------
996 > (scan "\\0a" voy:ab)
997 q=10
998 > (scan "\\'" voy:ab)
999 q=39
1001------------------------------------------------------------------------
1003### `++ag`
1005Top-level atom parser engine
1007A core containing top-level atom parsers.
1009Accepts
1010-------
1012Produces
1013--------
1015Source
1016------
1018 ++ ag
1019 |%
1021Examples
1022--------
1024 > ag
1025 <14.vpu 414.mof 100.xkc 1.ypj %164>
1027------------------------------------------------------------------------
1029### `++ape`
1031Parse 0 or rule
1033Parser modifier. Parses 0 or the sample rule `fel`.
1035Accepts
1036-------
1038Produces
1039--------
1041`fel` is a `rule`.
1043Source
1044------
1046 ++ ape |*(fel/rule ;~(pose (cold 0 (just '0')) fel))
1049Examples
1050--------
1052 > (scan "202" (star (ape:ag (cold 2 (just '2')))))
1053 ~[2 0 2]
1055------------------------------------------------------------------------
1057### `++bay`
1059Parses binary number
1061Parsing rule. Parses a binary number without a leading zero.
1063Accepts
1064-------
1066Produces
1067--------
1069Source
1070------
1072 ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1074Examples
1075--------
1077 > (scan "10.0110" bay:ag)
1078 q=38
1080------------------------------------------------------------------------
1082### `++bip`
1084Parse IPv6
1086Parsing rule. Parses a `@is`, an IPv6 address.
1088Accepts
1089-------
1091Produces
1092--------
1094Source
1095------
1097 ++ bip =+ tod=(ape qex:ab)
1098 (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1100Examples
1101--------
1103 > (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1104 q=283.183.420.760.121.105.516.068.864
1105 > `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1106 .0.0.ea.3e6c.0.0.0.0
1108------------------------------------------------------------------------
1110### `++dem`
1112Parse decimal with dots
1114Parsing rule. Parses a decimal number that includes dot separators.
1116Accepts
1117-------
1119Produces
1120--------
1122Source
1123------
1125 ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1128Examples
1129--------
1131 > (scan "52" dem:ag)
1132 q=52
1133 > (scan "13.507" dem:ag)
1134 q=13.507
1136------------------------------------------------------------------------
1138### `++dim`
1140Parse decimal number
1142Parsing rule. Parses a decimal number without a leading zero.
1144Accepts
1145-------
1147Produces
1148--------
1150Source
1151------
1153 ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1155Examples
1156--------
1158 > (scan "52" dim:ag)
1159 q=52
1160 > (scan "013507" dim:ag)
1161 ! {1 2}
1162 ! exit
1164------------------------------------------------------------------------
1166### `++dum`
1168Parse decimal with leading `0`
1170Parsing rule. Parses a decmial number with leading zeroes.
1172Accepts
1173-------
1175Produces
1176--------
1178Source
1179------
1181 ++ dum (bass 10 (plus sid:ab))
1183Examples
1184--------
1186 > (scan "52" dum:ag)
1187 q=52
1188 > (scan "0000052" dum:ag)
1189 q=52
1190 > (scan "13507" dim:ag)
1191 q=13.507
1193------------------------------------------------------------------------
1195### `++fed`
1197Parse phonetic base
1199Parsing rule. Parses an atom of odor `@p`, the phonetic base.
1201Accepts
1202-------
1204Produces
1205--------
1207Source
1208------
1210 ++ fed ;~ pose
1211 (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1212 huf:ab
1213 hif:ab
1214 tiq:ab
1215 ==
1217Examples
1218--------
1220 > (scan "zod" fed:ag)
1222 > (scan "nec" fed:ag)
1224 > (scan "sondel" fed:ag)
1225 9.636
1226 > ~tillyn-nillyt
1227 ~tillyn-nillyt
1228 > (scan "tillyn-nillyt" fed:ag)
1229 3.569.565.175
1230 > (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1231 15.331.165.687.565.582.592
1232 > (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1233 282.810.089.790.159.633.869.501.053.313.363.681.181
1235------------------------------------------------------------------------
1237### `++hex`
1239Parse hex
1241Parsing rule. Parses a hexadecimal number
1243Accepts
1244-------
1246Produces
1247--------
1249Source
1250------
1252 ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1254Examples
1255--------
1257 > (scan "4" hex:ag)
1258 q=4
1259 > (scan "1a" hex:ag)
1260 q=26
1261 > (scan "3.ac8d" hex:ag)
1262 q=240.781
1263 > `@ux`(scan "3.ac8d" hex:ag)
1264 0x3.ac8d
1266------------------------------------------------------------------------
1268### `++lip`
1270Parse IPv4 address
1272Parsing rule. Parses an IPv4 address.
1274Accepts
1275-------
1277Produces
1278--------
1280Source
1281------
1283 ++ lip =+ tod=(ape ted:ab)
1284 (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1286Examples
1287--------
1289 > (scan "127.0.0.1" lip:ag)
1290 q=2.130.706.433
1291 > `@if`(scan "127.0.0.1" lip:ag)
1292 .127.0.0.1
1293 > `@if`(scan "8.8.8.8" lip:ag)
1294 .8.8.8.8
1296------------------------------------------------------------------------
1298### `++viz`
1300Parse Base-32 with dots
1302Parsing rule. Parses a Base-32 number with dot separators.
1304Accepts
1305-------
1307Produces
1308--------
1310Source
1311------
1313 ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1315Examples
1316--------
1318 > (scan "e2.ol4pm" viz:ag)
1319 q=15.125.353.270
1321------------------------------------------------------------------------
1323### `++vum`
1325Parse base-32 string
1327Parsing rule. Parses a raw base-32 string.
1329Accepts
1330-------
1332Produces
1333--------
1335Source
1336------
1338 ++ vum (bass 32 (plus siv:ab))
1340Examples
1341--------
1343 > (scan "e2ol4pm" vum:ag)
1344 q=15.125.353.270
1346------------------------------------------------------------------------
1348### `++wiz`
1350Parse base-64
1352Parsing rule. Parses a base-64 number.
1354Accepts
1355-------
1357Produces
1358--------
1360Source
1361------
1363 ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1364 --
1365 ::
1367Examples
1368--------
1370 > (scan "e2O.l4Xpm" wiz:ag)
1371 q=61.764.130.813.526
1373***
1374### `++mu`
1376Core used to scramble 16-bit atoms
1378A door that contains arms that are used to scramble two atoms, `top`
1379and `bot`. Used especially in the phonetic base to disguise the
1380relationship between a destroyer and its cruiser.
1382Accepts
1383-------
1385Produces
1386--------
1388`bot` is an atom.
1390`top` is an atom.
1392Source
1393------
1395 ++ mu
1396 |_ [top/@ bot/@]
1398Examples
1399--------
1401 > ~(. mu 0x20e5 0x5901)
1402 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
1404------------------------------------------------------------------------
1406### `++zag`
1408Add bottom into top
1410Produces the cell of `top` and `bot` with `top` scrambled to the result
1411of adding `bot` to `top` modulo 16. Used to scramble the name of a
1412destroyer.
1414Accepts
1415-------
1417Produces
1418--------
1420`bot` is an atom.
1422`top` is an atom.
1424Source
1425------
1427 ++ zag [p=(end 4 1 (add top bot)) q=bot]
1430Examples
1431--------
1433 > `[@ux @ux]`~(zag mu 0x20e0 0x201)
1434 [0x22e1 0x201]
1436------------------------------------------------------------------------
1438### `++zig`
1440Subtract bottom from top
1442The inverse of `++zag`. Produces the cell of `top` and `bot` with
1443`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
1444and the 16-bit complement of `bot`. Used to unscramble the name of the
1445destroyer.
1447Accepts
1448-------
1450Produces
1451--------
1453`bot` is an atom.
1455`top` is an atom.
1457Source
1458------
1460 ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
1462Examples
1463--------
1465 > `[@ux @ux]`~(zig mu 0x2f46 0x1042)
1466 [0x1f04 0x1042]
1468------------------------------------------------------------------------
1470### `++zug`
1472Concatenate into atom
1474Produces the concatenation of `top` and `bot`. Used to assemble a
1475destroyer name.
1477Accepts
1478-------
1480Produces
1481--------
1483`bot` is an atom.
1485`top` is an atom.
1487Source
1488------
1490 ++ zug (mix (lsh 4 1 top) bot)
1492Examples
1493--------
1495 > `@ux`~(zug mu 0x10e1 0xfa)
1496 0x10e1.00fa
1500***
1501### `++ne`
1503Digit rendering engine
1505A door containing arms that render digits at bases 10, 16, 32, and
150664.
1508Accepts
1509-------
1511Produces
1512--------
1514`tig` is an `atom`.
1516Source
1517------
1519 ++ ne
1520 |_ tig/@
1522Examples
1523--------
1525 > ~(. ne 20)
1526 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
1528------------------------------------------------------------------------
1530### `++d`
1532Render decimal
1534Renders a decimal digit as an atom of an ACII byte value.
1536Accepts
1537-------
1539Produces
1540--------
1542`tig` is an `atom`.
1544Source
1545------
1547 ++ d (add tig '0')
1549Examples
1550--------
1552 > `@t`~(d ne 7)
1553 '7'
1555------------------------------------------------------------------------
1557### `++x`
1559Render hex
1561Renders a hexadecimal digit as an atom of an ASCII byte value.
1563Accepts
1564-------
1566Produces
1567--------
1569`tig` is an `atom`.
1571Source
1572------
1574 ++ x ?:((gte tig 10) (add tig 87) d)
1576Examples
1577--------
1579 > `@t`~(x ne 7)
1580 '7'
1581 > `@t`~(x ne 14)
1582 'e'
1584------------------------------------------------------------------------
1586### `++v`
1588Render base-32
1590Renders a base-32 digit as an atom of an ASCII byte value.
1592Accepts
1593-------
1595Produces
1596--------
1598Source
1599------
1601 ++ v ?:((gte tig 10) (add tig 87) d)
1603Examples
1604--------
1606 > `@t`~(v ne 7)
1607 '7'
1608 > `@t`~(v ne 14)
1609 'e'
1610 > `@t`~(v ne 25)
1611 'p'
1613------------------------------------------------------------------------
1615### `++w`
1617Render base-64
1619Renders a base-64 digit as an atom of an ASCII byte value.
1621Accepts
1622-------
1624Produces
1625--------
1627`tig` is an `atom`.
1629Source
1630------
1632 ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
1633 --
1634 ::
1636Examples
1637--------
1639 > `@t`~(w ne 7)
1640 '7'
1641 > `@t`~(w ne 14)
1642 'e'
1643 > `@t`~(w ne 25)
1644 'p'
1645 > `@t`~(w ne 52)
1646 'Q'
1647 > `@t`~(w ne 61)
1648 'Z'
1649 > `@t`~(w ne 63)
1650 '~'
1651 > `@t`~(w ne 62)
1652 '-'
1656***