// $Id: misc.hh 370 2007-09-04 14:02:22Z dflater $

#ifndef MISC_HEADER
#define MISC_HEADER

#include <string>
#include <istream>
#include "parser.hh"

// Substitute for boost::lexical_cast<std::string>
std::string stringify (unsigned long x);

// Copy entirety of in into a string.
// std::string stringify (std::istream &in);

// Translate parser enum to string.
std::string stringify (TGParser::Contest::Logic logic);

// Return number in [0..N).
unsigned long randFunc (unsigned long N);

// Return the assignment of item N in an even distribution of
// 1..domain to 1..range.  domain > 0, range > 0, 0 < N <= domain.
unsigned long evenDist (unsigned long N,
			unsigned long domain,
			unsigned long range);

#endif
