repo.or.cz
/
qmc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
removed useless file
[qmc.git]
/
flat.lua
blob
ae0bf471fe1d159e5898daf47a39479d820b9b31
1
#!/
usr
/
bin
/
lua
2
3
-- checks the distribution of numbers in a data file
4
5
local
f
=
io
.
open
(...
or
'test'
)
6
7
local
t
= {}
8
local
l
=
f
:
read
()
9
while
l
do
10
t
[
tonumber
(
l
)] = (
t
[
tonumber
(
l
)]
or
0
) +
1
11
l
=
f
:
read
()
12
end
13
14
f
:
close
()
15
16
for
i
,
n
in
ipairs
(
t
)
do
17
print
(
i
,
n
)
18
end
19