(CIF TEST FILE. Test all sorts of things); (bounding box approx (-10, -10) (1296, 1080) ); (the picture will look like this: P I C T U R E L E G E N D ------------------------------------------------------------ ! l mirror, rotation stack test l l ! Q quadrant test + ! + DD bug test l l +++ ! o Def #0 test + f f ! F transformation test l l o F f f ! f rotation test ::: ,, . ; ! : polygon test l l ::: ,, . ;; ! , box test Q ! . round flash test ! ; wire test ------------------------------------------------------------ ); (----------------------------------------------------------------); (mirror rotation stack test); (----------------------------------------------------------------); DS 11 100 1; LND; (a L we can rotate); Box 6, 10 3,5; Box 20, 6 10,3; DF; DS 12 100 1; C 11 R 1,0 T 0,0; C 11 R 0,1 T 0,50; C 11 R -1,0 T 0,100; C 11 R 0,-1 T 0,150; C 11 MX T 50,0 ; C 11 MY T 50,50 ; C 11 MX MY T 50,100 ; C 11 MY MX T 50,150 ; DF ; DS 13 100 1; C 12 T 00,00; C 12 R 0,1 T 00,350; C 12 R -1,0 T 00,700; C 12 R 0,-1 T 00,1050; C 12 MX T 300,00; C 12 MY T 300,350; C 12 MX MY T 300,700; C 12 MY MX T 300,1050; DF; DS 14; C 13 T 15000 00; DF; DS 15; C 14; DF; DS 16; C 15; DF; DS 17; C 16; DF; C 17; (to pass this test you have to go 6 levels deep); (----------------------------------------------------------------); (quadrant test); (points are allowed an all four quadrants); (----------------------------------------------------------------); LNP; P 1000,1000 -1000,1000 -1000,-1000 1000,-1000; (----------------------------------------------------------------); (DD bug test.); (Should make a green +. A red minus means you have the now-famous DD bug. Remember -- all symbols resolved in the context they are CALLED, not the context they are written); (----------------------------------------------------------------); DS 22; LNP; B 40000 10000 50000 50000; DF; DS 21; C 22; (this should always refer to the current symbol 22); DF; DD 22; DS22; LND; B 40000 10000 50000 50000; B 40000 10000 50000 50000 0 1; DF; C 21 T 20000, 35000; ( green '+' ); (----------------------------------------------------------------); (Def #0 test and borderline cases of misc stuff); (----------------------------------------------------------------); ( multi-line comment ); DS 0; (this should be OK, according to the CIF DEF #2686); LNP; B 2000 2000 4000 4000; DF; (But not everyone agrees); C 0 T 55000 35000; (will it let me? (it should)); (A comment with a ; Box 200 50 0 0; Should be ignored); L ayer NM ; (different layer syntax is OK); (nested (parentheses)); (LISP treated as comments - how insulting!); (defun fact (n) (cond ((zerop n) 1) (t (* n (fact (1- n)))) )); (----------------------------------------------------------------); (transformation tests); (----------------------------------------------------------------); (an 'F'); DS 4 100 1; L NM; W 20 0 0 0 100 80 100; W 20 0 50 60 50; DF; DS 2 100 1; C 3 MY R 1 1; DF; DS 3 100 1; C 4 T 100 0 R 1 1; DF; (make a whole bunch of complicated transformations that should all fall onto the same spot -- its easy to check that way); DS 7 100 1; C 4; C 4 T 100 0 R 0 1 MY T 0 100 R 0 -1 MX; C 4 T 100 10 R 1 1 MY R 1 1 T -100 10 MY; LND; C 4 T 100 0 R 1,2 MY R 37 146 R 1,2 MX MX MY MX MY R -1 0 R 146 -37 T 0 100 R 0 1; W 10 0 120 80 120; (should be green, not blue); C 2 T -100 0 MY; (work the transforms on the stack); C 4 R 1 2 R -1 2 R -2 -1 R 2 -1; DF; C 7 TR 65000 35000; (NOTE: The R after the T is a legal sep!); (----------------------------------------------------------------); (rotation tests); (----------------------------------------------------------------); DS 6 100 1; (we can do all rotations); C 4 R 50 85 T 100 100; C 4 R -50 85 T 0 100; C 4 R 50 -85 T 100 0; C 4 R -50 -85 T 0 0; DF; C 6 T 90000 45000; (-------test null command-they should be OK----------);; (----------------------------------------------------------------); ( test graphic features); (----------------------------------------------------------------); (POLYGON TEST); (SOME SIMPLE CONVEX POLYS); DS 40 100 1; LND; P 0,0 80,0 40,40; (triangle); P 0,100 80,100 80,180 0,180; (square); P 20,200 60,200 80,240 40,280 00,240; (pentagon); (A CROSS); P 135,35 135,00 140,00 140,35 175,35 175,40 140,40 140,75 135,75 135,40 100,40 100,35; (AN 'E'); P 100,100 100,180 132,180 132,164 116,164 116,148 132,148 132,132 116,132 116,116 132,116 132,100; (A CONCAVE POLY WITH WIERD ANGLES); P 120,200 100,237 140,275 180,237 160,200 140,260; (dont bloat too positive!); P 200,00 200,60 239,60 239,40 220,40 220,20 260,20 260,40 241,40 241,60 280,60 280,00; (FUN TO BLOAT NEGATIVE); P 200,100 200,140 235,140 235,105 245,105 245,140 280,140 280,100; (THIS TOO SHOULD BE FUN TO BLOAT NEGATIVE); P 200,200 280,200 260,280 240,210 220,280; DF; (box test); DS 41 100 1; LND; Box 40 20 10 00; (straight box, ling dimensin horiz); Box 40 20 10 70 1 0; (same); Box 40 20 10 140 1 1; (45 deg); Box 40 20 10 210 0 1; (90 deg); Box 40 20 10 280 -1 1; (135 deg); Box 40 20 100 00 -1 0; (180 deg); Box 40 20 100 70 -1 -1; (225 deg); Box 40 20 100 140 0 -1; (270 deg); Box 40 20 100 210 1 -1; (315 deg); Box 40 20 100 280 157 37; (semi-random angle); Box 40 xdim 20 ydim IN THIS CONTEXT UPPERCASE IS A SEPARATOR AND SHOULD BE IGNORED 180 xcenter position 00 y center position 1 x part of the direction vector 0 y part of the direction vector ; (more legal syntax); BOX.W40H20CX180CY70RX200RY-1; (this is OK syntax); DF; (round test); DS 42 100 1; LND; Round 40 00 00; (vanilla); Round 20 00 50; (strawberry); Round 10 00 100; (chocolate); Round 0 00 150; (the cheshire cat routine); this is a RoUnD flash with the center X=20 and the center Y=0 and the Radius EQUAL TO -50 and not a penny more; (legal syntax = R 20 0 -50); DF; (wire test); DS 43 100 1; LND; Wire 10 50 10 80 10; Wire 10 50 30 70 40; Wire 10 50 50 70 70; Wire 10 50 80 70 110; Wire 10 50 120 70 120 70 119 60 119; (path is non-intersecting, but not wire); W 10 50 140 80 140 60 140; (retraces self); W 10 50 160 80 160 80 180 65 180 65 155; (self intersecting); W 10 50 200 80 200 80 220 50 220 50 200; (returns to start); W 10 50 240 80 240 80 260 50 260 50 245; (edges touch); W 10 50 280 50 280; (co-incident points); W 10 50 300; (single point is OK); (now try some angles); W 10 100 10 120 10 140 10; (flat angle); W 10 100 30 120 30 140 40; (<45 deg); W 10 100 50 120 50 140 70; (45 deg); W 10 100 70 120 70 140 100; (>45 deg); W 10 100 100 120 100 110 110; (acute); W 10 100 130 140 130 100 141; (very acute); W 10 100 150 120 150 100 151; (extremely acute); DF; (do them all); DS 49 100 1; C 40 T 0 0; C 41 T 320 15; C 42 T 600 70; C 43 T 600 0; DF; C 49 T 55000, 000; (E); (try to break the parser); (bounding box approx (-3.5,-6.5) (30, 38) ); (random geometrical figures); (----------------------------------------------------------------); (comment-type stuff); (----------------------------------------------------------------); A COMMAND THAT PROBABLY IS NOT UNDERSTOOD; DU; (do you know what this is?); D (mumble) D 300; (you should flag this); (Well! can we do null commands? #2686 says yes);; (meanwhile, back at NASTY -- no semicolon) (did you see that?); (extra close paren, and one after the semicolon)); ); (----------------------------------------------------------------); (now test the user extention); (----------------------------------------------------------------); (this userExt probably is not supported); 2400000000000000000000000000000000000000000 user extentions are just 1 digit (dont inint!) (you can have unbalanced parens in here, you know, causing disaster )))when you try to comment out a bunch of CIF.; (----------------------------------------------------------------); (data before layer tests -- all cases in sym, out of sym, after sym); (----------------------------------------------------------------); B 10 20 30 40; (a box before a layer); D S 1 100 1; (same thing in a symbol); B 10 20 30 40; (should be no defined layer); Layer mumble; (bad layer); B 10 20 30 40; (now can we do a box?); Layer ND; (good layer should not extend past the DF); D F ; B 10 20 30 40; (this is still bad after setting a layer in a sym); Layer mumble; (bad layer); B 10 20 30 40; (now can we do a box? Your choice.); (----------------------------------------------------------------); (layer tests); (----------------------------------------------------------------); Layer NP 0 0 100 50; (junk after a layer selection); L mumble in lower case ; (no layer after all); Layer NgarbageM; (you should complain about this); Layer VERYLONGLAYERNAME; (and this); Layer N I; (this aint legal either); L N?!#; (not our favorite layer); (it should use N the without error); (----------------------------------------------------------------); (symbol tests); (----------------------------------------------------------------); DD -1; (not legal, twerp! gotta be non-negative); (do you flag an error, or just delete all? #2686 doesnt say); (eat this, turkey!); DS 2 0 0; (0/0 as the scale of the symbol. Your system should flag it); LNM; B 10 20 30 40; DF; DS 2 0 100; (deja-vu. Alerady defined. Just a=0 this time); LNM; B 10 20 30 40; DD 2; (inside a def, delete self); DF; C 2; (did you delete but still keep a def???); DS -3; (negative sym nums are not allowed.); LNM; B 10 20 30 40; DF; (a simple symbol def); DS 3 100 1; LND; B 1 2 3 4; (put something in this one); DS 4 100 1; (plus a little confusion); DF; DF; (a spare finish); DF; (another spare finish); DS 40000 1 1; (do you use hashing?); LNM; B 10 20 30 40; DF; (----------------------------------------------------------------); (test symbol calls); (----------------------------------------------------------------); C -3; (can you call this? We defined it above (or tried to)); DS 11; C 11 T 0,0; (Recursive Call); C 15 T 0,0; (Subtler recursive Call); DF; DS 15; C 11 T 0,0; DF; C 11 T 0,0; (the recursion express); C 13 T 0,0; (Call an undefined symbol); C 3 R 0 0; (bad rotation); C 3 MN; (illegal mirror); C 3 MXY; (another bad mirror); C 3 X 1500; (bad transform type); C 3 T 100; (one-point translates are no good); C 3 T 100 MX R 10 0; (the "MX R " is a legal blank!); C3M()X; (we cant talk here!); C3MZ F; (what do you mean we cant talk here?); C 3; (call...); DD 3; (delete...); C 3; (...then use); DS 29; DF; (----------------------------------------------------------------); (box test); (----------------------------------------------------------------); DS 30; (box tests); LNP; ( i like red); B 100 500 100 200 0 0; (rotten rot. vector); B -100 0 - 150 0; (negative size. cant have space bet. - and number); B 100 300 - -500; (do you see a -0 there?); (do you think you should?); (Very un-cool box. How big and small are your numbers?); B -100 -200 100000000000000000000,-200000000000000000000; B 100 500 100 200 300; (half a direction vector); B 100 500 100 ; (not enough numbers to make this worth our while); B 100 100 0 0 1 1 100 200 300; (extra numbers); B 100 100 0 0 1 1 M; (an extra letter); DF; (----------------------------------------------------------------); (wire test); (----------------------------------------------------------------); DS 31; (world famous wire test); LNM; W 100 ; (points? who needs points?); W 100 400 400; (is this legal for you? ( it should be OK)); (what happens when points overlap?); W 100 400 400 400 400; (dup. points reduces to 1-point wire); W 100 400 400 400 400 400 400 400 400; (dup. points reduces to 1-point wire); (duplicated points mixed with good ones); W 300 100,200 100,200 400,100 800,200 500,500 500,500 200,800 500,700 800,800 800,800; Wire 0 100 100 200 200; (zero width); (is zero width a problem? (semantic objection, maybe)); Wire -300 100 100 200 200; (neg. width); (is neg. width a problem? (parser should object)); Wire 300 100 100 200 200 300 ; (unpaired point!); DF; (----------------------------------------------------------------); (polygon test); (----------------------------------------------------------------); DS 32; (nearly as famous polygons); LNM; P; (trivial case polygon, (nullgon)); P 100 100; (slightly less trivial, and not a syntax error, either (monogon)); P 100 100 100 200 ; (duogon (what do you do with these?)); P 100 100 100 100 ; (doubled points); P 100 100 100 100 100 100 100 100 100 100 ; (quintupled points); P 100 100 400 400 400 100 100 100; (subtler -- first and last points same); (lots of duplicated segs. 3, including first and last); P 100 100 600 100 400 100 400 400 200 400 200 100; (5 duplicated segs); P 00,00 00,600 00,00 600,00 600,00 00,00 00,-600 200,-600 00,-600 00,00 -600,00 -600,200 -500,200 -600,00 00,00; P 0,0 80,0 0,80 80,80; (A SELF INTERSECTING POLYGON); P 100 100 400 400 100 400 500; (missing a number); DF; (----------------------------------------------------------------); (round flash test); (----------------------------------------------------------------); DS 33; (round flash tests); LNP; R -1500 750 750; (negative diameter); R 0 750 1800 ; (zero diameter); R 100 1500; (not enough numbers); Round flash 50 (hi! expecting me?) 200 100 ; (you shouldnt be!!); DF; C 30 T 0 0; C 31 T 2000 0; C 32 T 2000 2000; C 33 T 0 2000; DS 3; E (open sym at end); DO YOU BELIEVE IN REINCARNATION? (junk after the end); (One more thing - Colombo)