summaryrefslogtreecommitdiff
path: root/ipl/progs/sample.icn
blob: 16b283ac5f0f8e68cb9582e9509195d5b6538c7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
############################################################################
#
#	File:     sample.icn
#
#	Subject:  Program to "sample" input stream
#
#	Author:   Ralph E. Griswold
#
#	Date:     January 21, 1999
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  This program filters the input stream, producing every ith
#  value, starting at 1.  i is given as a command-line argument; default 0.
#
############################################################################

procedure main(args)
    local line, skip

    skip := integer(args[1]) | 0

    while write(read()) do
       every 1 to skip do read()

end