<commit_before>/*
 * BitboardCA. Cellular Automata using bitboard algorithms.
 * Copyright (C) <NAME> <<EMAIL>> http://wasabi.in/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program 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 General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#include "bbviewer.h"


namespace BitboardCA
{
	BitboardViewer::BitboardViewer(std::ostream * ostream)
	{
		m_pOstream = ostream;
	}

	void BitboardViewer::ViewBitboardLine(Bitboard b, std::size_t y)
	{
		b >>= y * 8;
		for ( std::size_t i = 0 ; i < 8 ; i++ )
		{
			if ( b % 2 == 1 )
				(*m_pOstream) << "* ";
			else
				(*m_pOstream) << "  ";
			b >>= 1;
		}
	}

	void BitboardViewer::ViewBitboard(Bitboard b)
	{
		for ( std::size_t i = 0 ; i < 8 ; i++ )
		{
			ViewBitboardLine(b, i);
			(*m_pOstream) << std::endl;
		}
	}

	void BitboardViewer::ViewBitboardInfo(Bitboard * bitboards, std::size_t size_x, std::size_t size_y)
	{
		std::cout << "---- Bitboard List Info ----" << std::endl;
		std::cout << "Size = (" << size_x << ", " << size_y << ")" << std::endl;

		for ( std::size_t y = 0 ; y < size_y ; y++ )
		{<commit_msg>added TODO tag<commit_after>/*
 * BitboardCA. Cellular Automata using bitboard algorithms.
 * Copyright (C) <NAME> <<EMAIL>> http://wasabi.in/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program 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 General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#include "bbviewer.h"


namespace BitboardCA
{
	BitboardViewer::BitboardViewer(std::ostream * ostream)
	{
		m_pOstream = ostream;
	}

	void BitboardViewer::ViewBitboardLine(Bitboard b, std::size_t y)
	{
		b >>= y * 8;
		for ( std::size_t i = 0 ; i < 8 ; i++ )
		{
			if ( b % 2 == 1 )
				(*m_pOstream) << "* ";
			else
				(*m_pOstream) << "  ";
			b >>= 1;
		}
	}

	void BitboardViewer::ViewBitboard(Bitboard b)
	{
		for ( std::size_t i = 0 ; i < 8 ; i++ )
		{
			ViewBitboardLine(b, i);
			(*m_pOstream) << std::endl;
		}
	}

	// TODO : make testcase
	void BitboardViewer::ViewBitboardInfo(Bitboard * bitboards, std::size_t size_x, std::size_t size_y)
	{
		std::cout << "---- Bitboard List Info ----" << std::endl;
		std::cout << "Size = (" << size_x << ", " << size_y << ")" << std::endl;

		for ( std::size_t y = 0 ; y < size_y ; y++ )
		{
{'fraction_non_alphanumeric': 0.13441176470588234, 'fraction_numerical': 0.01411764705882353, 'mean_word_length': 3.3214739517153746, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '758720', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1138, 'n_words': 395}