source: liacs/da/opdr2a/inv2human.pl@ 371

Last change on this file since 371 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

  • Property svn:executable set to *
File size: 1.4 KB
RevLine 
[2]1#!/usr/bin/env perl
2# Author : Rick van der Zwet
3# S-number : 0433373
4# Version : $Id: inv2human.pl 322 2007-11-22 14:09:00Z rick $
5# Copyright : FreeBSD Licence
6#
7
8
9# 1. AtLeaf 9. PutInfo
10# 2. GoRoot 10. GetInfo
11# 3. ExistsChild 11. GotoNode
12# 4. GoChild 12. GetNode
13# 5. FirstChild 13. Show
14# 6. NextChild 14. Show (2)
15# 7. AddChild 15. Opnieuw beginnen
16# 8. RemoveChild 16. Stoppen
17
18
19
20@input = <STDIN>;
21@onecommand = (1,2,5,10,11,12,13,14,15,16);
22@number2name = ( 'ERROR: Option Zero',
23 'AtLeaf',
24 'GoRoot',
25 'ExistsChild',
26 'GoChild',
27 'FirstChild',
28 'NextChild',
29 'AddChild',
30 'RemoveChild',
31 'PutInfo',
32 'GetInfo',
33 'GotoNode',
34 'GetNode',
35 'Show',
36 'Show (2)',
37 'Opnieuw beginnen',
38 'Stoppen',
39 );
40
41
42while ( my $line = shift(@input) )
43{
44 printf "%-5d #", $line;
45 chomp $line;
46 if ( grep(/^$line$/, @onecommand) )
47 {
48 print $number2name[$line] . "\n";
49 }
50 else
51 {
52 $value = shift(@input);
53 chomp($value);
54 print $number2name[$line] . " - " . $value . "\n";
55 printf "%-5d #Value\n", $value;
56 }
57}
Note: See TracBrowser for help on using the repository browser.