Here you are a (oversimplified) working implementation. Now you should fill the details
#include <iostream>
#include <sstream>
using namespace std;
const int POS = 8;
int getValue() { return rand(); }
string toString()
{
ostringstream oss;
oss << "< ";
for (int i = 0; i < POS; i++)
{
oss << getValue();
oss << " ";
}
return oss.str();
}
int main()
{
cout << toString();
}