<commit_before>#include <string>
#include <sstream>
#include <stdlib.h>
#include <time.h>
#include <map>
#include <string>
#include <unistd.h>

#include "moves.h"

using namespace lmoves ;
std::ostream& lmoves::operator<<(std::ostream& out, tmove value) {
    static std::map<tmove, std::string> strings;
    if(strings.size() == 0) {
#define INSERT_ELEMENT(p) strings[tmove::p] = #p
        INSERT_ELEMENT(DOWN);
        INSERT_ELEMENT(UP);
        INSERT_ELEMENT(RIGHT);
        INSERT_ELEMENT(LEFT);
#undef INSERT_ELEMENT
    }

    return out << strings[value];
}


std::ostream& operator<<(std::ostream& out, Moves const& seq) {
    for(auto m : seq.getSequence()) {
        out << m << ' ';
    }

    return out;
}

// constructor
Moves::Moves(size_t seqLen) {
    while(seqLen-- != 0) {
        this->addRandomMove();
    }
}

// getter
std::vector<tmove> const& Moves::getSequence() const {
    return this->sequence;
}

void Moves::clearSequence() {
	this->sequence.clear();
}

tmove Moves::M_randomMove() {
    return static_cast<tmove>(rand() % static_cast<int>(tmove::NUM_MOVES));
}
void Moves::addMove(tmove m){
    sequence.push_back(m);
}
void Moves::addRandomMove() {
    tmove new_move = this->M_randomMove();
    sequence.push_back(new_move);
}<commit_msg>add print sequence<commit_after>#include <string>
#include <sstream>
#include <stdlib.h>
#include <time.h>
#include <map>
#include <string>
#include <unistd.h>

#include "moves.h"

using namespace lmoves ;
std::ostream& lmoves::operator<<(std::ostream& out, tmove value) {
    static std::map<tmove, std::string> strings;
    if(strings.size() == 0) {
#define INSERT_ELEMENT(p) strings[tmove::p] = #p
        INSERT_ELEMENT(DOWN);
        INSERT_ELEMENT(UP);
        INSERT_ELEMENT(RIGHT);
        INSERT_ELEMENT(LEFT);
#undef INSERT_ELEMENT
    }

    return out << strings[value];
}


std::ostream& operator<<(std::ostream& out, Moves const& seq) {
    for(auto m : seq.getSequence()) {
        out << m << ' ';
    }

    return out;
}

// constructor
Moves::Moves(size_t seqLen) {
    while(seqLen-- != 0) {
        this->addRandomMove();
    }
}

// getter
std::vector<tmove> const& Moves::getSequence() const {
    return this->sequence;
}


void Moves::clearSequence() {
	this->sequence.clear();
}

tmove Moves::M_randomMove() {
    return static_cast<tmove>(rand() % static_cast<int>(tmove::NUM_MOVES));
}
void Moves::addMove(tmove m){
    sequence.push_back(m);
}
void Moves::addRandomMove() {
    tmove new_move = this->M_randomMove();
    sequence.push_back(new_move);
}
{'fraction_non_alphanumeric': 0.16901408450704225, 'fraction_numerical': 0.001564945226917058, 'mean_word_length': 3.9747081712062258, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1026549', 'n_tokens_mistral': 956, 'n_tokens_neox': 915, 'n_words': 176}