/* -*- mode:c; coding: koi8-r -*- */
/* $Id: t2.cpp,v 1.2 2003/04/15 03:38:26 cher Exp $ */

/* Copyright (C) 2003 Alexander Chernov <cher@unicorn.cmc.msu.ru> */

/*
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 See the `COPYING' file for the full terms and conditions.
*/

#include <stdio.h>
#include <assert.h>
#include <string.h>

#include "SeededEnthropy.hpp"
#include "FileByteSource.hpp"
#include "Random.hpp"

int main(void)
{
  int cnt[100];

  Random *rnd = new Random(new SeededEnthropy(new FileByteSource("/dev/urandom")));
  memset(cnt, 0, sizeof(cnt));

  //rnd->exponent(-2.0);

  for (int i = 0; i < 100000; i++) {
    double x = rnd->normal();
    int i = (int)(x * 100);
    //printf("%f\n", x);
    if (i < 0 || i >= 100) continue;
    cnt[i]++;
  }

  for (int i = 0; i < 100; i++) {
    printf("%d ", cnt[i]);
    if (i % 10 == 9) printf("\n");
  }

  return 0;
}

/*
 * Local variables:
 *  compile-command: "make"
 * End:
 */
