<commit_before>#include <cstdio>
#include <string>
#include "pongcolor.h"
#include "sysio.h"

#ifdef LINUX_GPIO_RPI
#include <wiringPi.h>
#endif

using std::string;
using pong::PColor;
using pong::Rect;
using pong::PRect;

namespace pong { namespace sys
{
#ifdef POSIX
	void SOut::GotoXY(int x, int y)
	{
		printf("\033[%d;%df", y, x);
		fflush(stdout);
	}

	void SOut::PrintColorString(string str, PColor colornum)
	{
		printf("\033[%dm%s\033[0m", colornum.GetNum(), str.c_str());
	}

	void SOut::Out(PRect rect)
	{
		GotoXY((rect.GetSpoint()).GetXpos(), (rect.GetSpoint()).GetYpos());

		for(int width=0; width<rect.GetWidth(); width++)
		{
			for(int length=0; length<rect.GetLength(); length++)
				PrintColorString("@", rect.GetColor());
		}
	}

	void SOut::Out(PString str)
	{

	}
#endif

#ifdef LINUX_GPIO_RPI
	void SGpio::Setup(void)
	{
		static int ini = 0;

		if(ini == 0)
		{
			wiringPiSetup();
			ini++;
		}
	}

	int SGpio::Read(int gnum)
	{
		return digitalRead(gnum);
	}

	void SGpio::Write(int gnum, int snum)
	{
		digitalWrite(gnum, snum);
	}
#endif
}}<commit_msg>Add pinMode(int, int) on Setup()<commit_after>#include <cstdio>
#include <string>
#include "pongcolor.h"
#include "sysio.h"

#ifdef LINUX_GPIO_RPI
#include <wiringPi.h>
#endif

using std::string;
using pong::PColor;
using pong::Rect;
using pong::PRect;

namespace pong { namespace sys
{
#ifdef POSIX
	void SOut::GotoXY(int x, int y)
	{
		printf("\033[%d;%df", y, x);
		fflush(stdout);
	}

	void SOut::PrintColorString(string str, PColor colornum)
	{
		printf("\033[%dm%s\033[0m", colornum.GetNum(), str.c_str());
	}

	void SOut::Out(PRect rect)
	{
		GotoXY((rect.GetSpoint()).GetXpos(), (rect.GetSpoint()).GetYpos());

		for(int width=0; width<rect.GetWidth(); width++)
		{
			for(int length=0; length<rect.GetLength(); length++)
				PrintColorString("@", rect.GetColor());
		}
	}

	void SOut::Out(PString str)
	{

	}
#endif

#ifdef LINUX_GPIO_RPI
	void SGpio::Setup(void)
	{
		static int ini = 0;

		if(ini == 0)
		{
			wiringPiSetup();

			pinMode(SGpio::P1SWITCH1, INPUT);
			pinMode(SGpio::P1SWITCH2, INPUT);
			pinMode(SGpio::P1LED1, OUTPUT);
			pinMode(SGpio::P1LED2, OUTPUT);
			pinMode(SGpio::P2SWITCH1, INPUT);
			pinMode(SGpio::P2SWITCH2, INPUT);
			pinMode(SGpio::P2LED1, OUTPUT);
			pinMode(SGpio::P2LED2, OUTPUT);

			ini++;
		}
	}

	int SGpio::Read(int gnum)
	{
		return digitalRead(gnum);
	}

	void SGpio::Write(int gnum, int snum)
	{
		digitalWrite(gnum, snum);
	}
#endif
}}
{'fraction_non_alphanumeric': 0.18089842169162282, 'fraction_numerical': 0.017806556050182113, 'mean_word_length': 4.605442176870748, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '849408', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1064, 'n_words': 196}