Not logged in

Artifact 7603b7503a23b9f266582dfa9cdc9aec1dd7ccb5

File master_theorem/prison_life.rx part of check-in [5896fc3ed9] - new example for translating tapcode to ascii (for the master theorem) by crc on 2011-08-19 20:50:15. [annotate]


needs array'

create tapCodes
  'a , 'b , 'c , 'd , 'e ,
  'f , 'g , 'h , 'i , 'j ,
  'l , 'm , 'n , 'o , 'p ,
  'q , 'r , 's , 't , 'u ,

: tapToChar ( rc-c )
  [ 1- ] bi@ swap 5 * tapCodes + + @ ;

: decode ( a- )
  @+ 2 / [ @+ swap @+ swap [ tapToChar putc ] dip ] times drop ;

^array'new{ 4 4   2 3   1 5
            1 2   2 4   4 2   1 4
            3 2   1 1   3 3 } decode