Annotation of coherent/c/usr/games/lib/rubik.m4, revision 1.1.1.1

1.1       root        1: divert(-1)
                      2: define(`_')
                      3: define(`reset',`divert(
                      4:        _i(_t(0,1,2),R) _i(_t(0,2,1),W) _i(_t(1,0,2),O)
                      5:        _i(_t(1,2,0),Y) _i(_t(2,0,1),B) _i(_t(2,1,0),G)
                      6: )')
                      7: define(`_i',`
                      8:        define(`_$1',$6)
                      9:        define(`_$1$2',$6) define(`_$1$2$5',$6)
                     10:        define(`_$1$3',$6) define(`_$1$3$2',$6)
                     11:        define(`_$1$4',$6) define(`_$1$4$3',$6)
                     12:        define(`_$1$5',$6) define(`_$1$5$4',$6)
                     13: ')
                     14: define(`_R',`0,1,2,0,1,2')
                     15: define(`p',`_d(_R,`_e')')
                     16: define(`P',`_d(_R,`_f')')
                     17: define(`_d',``
                     18:           '$7(_$6$5$1$2$4$3)`'_$1$2$4$3$6$5`'$7(_$4$3$6$5$1$2)`
                     19:      '$7(_$6$5$1$2)`'_$1$2$6$5`         '_$1$2$4$3`'$7(_$4$3$1$2)`
                     20: '$7(_$6$5$3$4$1$2)`'_$1$2$6$5$3$4`         '_$1$2`         '_$1$2$5$6$4$3`'$7(_$4$3$1$2$5$6)`
                     21: '_$3$4$1$2$6$5`     '_$1$2$3$4`         '_$1$2$5$6`     '_$5$6$4$3$1$2`
                     22:      '_$3$4$1$2`     '_$1$2$3$4$5$6`     '_$5$6$1$2`
                     23: '$7(_$6$5$3$4)`         '_$3$4$5$6$1$2` '_$5$6$1$2$3$4`         '$7(_$4$3$2$1)`
                     24: '_$3$4$6$5`                     '_$5$6$4$3`
                     25:      '_$3$4`           '_$5$6`
                     26: '$7(_$6$5$2$1$3$4)`         '_$3$4$5$6` '_$5$6$3$4`         '$7(_$4$3$2$1$6$5)`
                     27: '_$3$4$6$5$2$1`'$7(_$2$1$3$4$6$5)`                   '$7(_$2$1$4$3$5$6)`'_$5$6$2$1$4$3`
                     28:      '_$3$4$2$1`'$7(_$2$1$3$4)`         '$7(_$2$1$5$6)`'_$5$6$2$1`
                     29:           '_$3$4$2$1$5$6`'$7(_$2$1$5$6$3$4)`'_$5$6$3$4$2$1`
                     30: '')
                     31: define(`_e',` ')
                     32: define(`_f',`translit($1,RBYOWG,rbyowg)')
                     33: define(`_m',`$eval(($1+$2)%4+1)')
                     34: define(`_r',`define(`_R',define(`_',``$$1,$$2,$$3,$$4,$$5,$$6'')_(_R))')
                     35: define(`_s',`divert(_u(_t(define(`_',`$$1,$$2,eval(3-$$1-$$2)')_(_R)),$3))')
                     36: define(`_t',`$1$2,$1$3,$2$3,$3$1,$3$2')
                     37: define(`_u',`
                     38:        _v($1$2,$1$3,$1$4,$1$5,$6)
                     39:        _v($4$1,$5$1,$2$1,$3$1,$6)
                     40:        _v($4$1$5,$5$1$2,$2$1$3,$3$1$4,$6)
                     41:        _v($1$2$5,$1$3$2,$1$4$3,$1$5$4,$6)
                     42:        _v($4$3$1,$5$4$1,$2$5$1,$3$2$1,$6)
                     43: ')
                     44: define(`_v',`
                     45:        define(`_',_m(0,$5)`,'_m(1,$5)`,'_m(2,$5)`,'_m(3,$5))
                     46:        _w(_(_$1,_$2,_$3,_$4),$1,$2,$3,$4)
                     47: ')
                     48: define(`_w',`
                     49:        define(`_$5',$1) define(`_$6',$2) define(`_$7',$3) define(`_$8',$4)
                     50: ')
                     51: define(`clt',`_r(3,4,2,1,5,6)')
                     52: define(`ctl',`_r(4,3,1,2,5,6)')
                     53: define(`crt',`_r(5,6,3,4,2,1)')
                     54: define(`ctr',`_r(6,5,3,4,1,2)')
                     55: define(`cr', `_r(1,2,6,5,3,4)')
                     56: define(`cl', `_r(1,2,5,6,4,3)')
                     57: define(`tr', `_s(1,2,1)')
                     58: define(`tt', `_s(1,2,2)')
                     59: define(`tl', `_s(1,2,3)')
                     60: define(`ld', `_s(3,4,3)')
                     61: define(`lt', `_s(3,4,2)')
                     62: define(`lu', `_s(3,4,1)')
                     63: define(`rd', `_s(5,6,1)')
                     64: define(`rt', `_s(5,6,2)')
                     65: define(`ru', `_s(5,6,3)')
                     66: define(`bl', `_s(2,1,1)')
                     67: define(`bt', `_s(2,1,2)')
                     68: define(`br', `_s(2,1,3)')
                     69: define(`lbu',`_s(6,5,1)')
                     70: define(`lbt',`_s(6,5,2)')
                     71: define(`lbd',`_s(6,5,3)')
                     72: define(`rbu',`_s(4,3,3)')
                     73: define(`rbt',`_s(4,3,2)')
                     74: define(`rbd',`_s(4,3,1)')
                     75: define(`ml', `tr()br()cl()')
                     76: define(`mt', `tt()bt()cl()cl()')
                     77: define(`mr', `tl()bl()cr()')
                     78: define(`lmu',`lbd()rd()clt()')
                     79: define(`lmt',`lbt()rt()clt()clt()')
                     80: define(`lmd',`lbu()ru()ctl()')
                     81: define(`rmu',`rbd()ld()crt()')
                     82: define(`rmt',`rbt()lt()crt()crt()')
                     83: define(`rmd',`rbu()lu()ctr()')
                     84: define(`save',`syscmd(`/bin/cat >> $2 << \#
                     85: define(`$1','dumpdef(`$1')`)
                     86: #
                     87: ')')
                     88: define(`help',``
                     89: To turn the:           Type:
                     90: top, middle, bottom:   tl      ml      bl      (left)
                     91:                        tr      mr      br      (right)
                     92:                        tt      mt      bt      (twice)
                     93: left and right faces:  lu      ru              (up)
                     94:                        ld      rd              (down)
                     95:                        lt      rt              (twice)
                     96: back faces:            lbu     rbu             (up)
                     97:                        lbd     rbd             (down)
                     98:                        lbt     rbt             (twice)
                     99: left and right middles:        lmu     rmu             (up)
                    100:                        lmd     rmd             (down)
                    101:                        lmt     rmt             (twice)
                    102: entire cube:           cr                      (to the right)
                    103:                        cl                      (to the left)
                    104:                        clt                     (left face to top)
                    105:                        crt                     (right face to top)
                    106:                        ctr                     (top face to right)
                    107:                        ctl                     (top face to left)
                    108: To reset the faces:    reset
                    109: To save a macro:       save(`name',`file')     (appends a `define' command)
                    110: To display the cube:   p                       (or P to see around edges)'')
                    111: reset
                    112: divert(0)p
                    113: `Type help for commands.'

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.