#!/usr/bin/perl

$p = 0;

for ($i=0; $i<4; $i+= 1) {
	$data[$p] = rand(1) - 0.5;
	$p = ($p + 1) & 3;
}

for ($i=0; $i<100; $i+= 1) {
	$data[$p] = rand(1) - 0.5;
	$p = ($p + 1) & 3;
	print $i."\t".(($data[0] + $data[1] + $data[2] + $data[3]) / 2.0)."\n";
}
