- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
# progress bar
width = 60 # width of bar
com = 540 # input data
pr = com * 0.01
i = 0
j = width
v = 1
puts
while pr <= com
print "\r#{v}% [#{"|"*i}#{" "*j}]"
pr += com * 0.01
i += width * 0.01
j -= width * 0.01
v += 1
sleep(0.01)
end
puts
RaZeR 27.03.2011 19:50 # +3
Имитация бурной деятельности?