Help for this page

Select Code to Download


  1. or download this
    prompt> trg_calc 179 0 59 + 0 59 1  
    Reduced Answer: 180 0 0
    
  2. or download this
    #!/usr/bin/env/perl
    
    ...
    ok(  main( '-179    0  59 +  0  59  1' ) eq  '-178 0 0 ',           '6
    +. test mainition with negatives' );                                  
    ok(  main(    '0    0   1 +  0   0 59' ) eq  '0 1 0',               '7
    +. test if single reduce works correctly' );                     
    ok(  main(   '90  180 270 +  0 180 90' ) eq  '96 6 0',              '8
    +. tests if multiple reduce calls work correctly' );