<commit_before>#include "paireliminate.h"
#include "ui_paireliminate.h"

PairEliminate::PairEliminate(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PairEliminate)
{
    ui->setupUi(this);

    for (int i = 0; i < TEMPLATE_COUNT; ++i)
    {
        std::string fileName = "Resources/paireliminate/maps/" + QString::number(i).toStdString() + ".txt";
        std::ifstream boardTemplate(fileName);
        for (int j = 0; j < PAIR_HEIGHT_COUNT; ++j)
        {
            std::string boardLine;
            boardTemplate >> boardLine;
            for (int k = 0; k < PAIR_WIDTH_COUNT; ++k)
            {
                char ch = boardLine[k];
                templateInts[i][j][k] = ch - 48;
            }
        }
    }

    for (int i = 0; i < CARD_COUNT; ++i)
    {
        QString fileName = "Resources/paireliminate/cards/" + QString::number(i) + ".gif";
        cardPics[i] = new QPixmap(fileName);
    }

    mp = new QSignalMapper(this);
    for (int i = 0; i < PAIR_HEIGHT_COUNT; ++i)
    {
        for (int j = 0; j < PAIR_WIDTH_COUNT; ++j)
        {
            templateButtons[i][j] = new QPushButton(this);
            templateButtons[i][j]->setEnabled(false);
            templateButtons[i][j]->setGeometry(PAIR_START_X + PAIR_WIDTH * j, PAIR_START_Y + PAIR_HEIGHT * i, PAIR_WIDTH, PAIR_HEIGHT);
            templateButtons[i][j]->setIcon(*cardPics[0]);
            templateButtons[i][j]->setIconSize(QSize(PAIR_WIDTH, PAIR_HEIGHT));

            gameButtons[i][j] = new QPushButton(this);
            gameButtons[i][j]->setEnabled(true);
            gameButtons[i][j]->setGeometry(PAIR_START_X + PAIR_WIDTH * j, PAIR_START_Y + PAIR_HEIGHT * i, PAIR_WIDTH, PAIR_HEIGHT);
            gameButtons[i][j]->setIconSize(QSize(PAIR_WIDTH, PAIR_HEIGHT));
            QObject::connect(gameButtons[i][j], SIGNAL(clicked(bool)), mp, SLOT(map()));
            mp->setMapping(gameButtons[i][j], i * PAIR_WIDTH_COUNT + j);
        }
    }

    helpMsgbox = new QMessageBox(this);
    helpMsgbox->setText("将所有的方块成对消除后即可获得胜利。\n游戏时间限制为50秒，\n消除一对方块奖励3秒，\n使用一次提示扣除6秒，\n使用一次重排扣除剩余时间的1/3，\n最少扣除5秒。");
    helpMsgbox->addButton(QMessageBox::Ok);
    helpMsgbox->setIcon(QMessageBox::Information);

    succMsgbox = new QMessageBox(this);
    succMsgbox->addButton(QMessageBox::Ok);
    succMsgbox->setIcon(QMessageBox::Information);
<commit_msg>修改连连看游戏说明中的难度<commit_after>#include "paireliminate.h"
#include "ui_paireliminate.h"

PairEliminate::PairEliminate(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PairEliminate)
{
    ui->setupUi(this);

    for (int i = 0; i < TEMPLATE_COUNT; ++i)
    {
        std::string fileName = "Resources/paireliminate/maps/" + QString::number(i).toStdString() + ".txt";
        std::ifstream boardTemplate(fileName);
        for (int j = 0; j < PAIR_HEIGHT_COUNT; ++j)
        {
            std::string boardLine;
            boardTemplate >> boardLine;
            for (int k = 0; k < PAIR_WIDTH_COUNT; ++k)
            {
                char ch = boardLine[k];
                templateInts[i][j][k] = ch - 48;
            }
        }
    }

    for (int i = 0; i < CARD_COUNT; ++i)
    {
        QString fileName = "Resources/paireliminate/cards/" + QString::number(i) + ".gif";
        cardPics[i] = new QPixmap(fileName);
    }

    mp = new QSignalMapper(this);
    for (int i = 0; i < PAIR_HEIGHT_COUNT; ++i)
    {
        for (int j = 0; j < PAIR_WIDTH_COUNT; ++j)
        {
            templateButtons[i][j] = new QPushButton(this);
            templateButtons[i][j]->setEnabled(false);
            templateButtons[i][j]->setGeometry(PAIR_START_X + PAIR_WIDTH * j, PAIR_START_Y + PAIR_HEIGHT * i, PAIR_WIDTH, PAIR_HEIGHT);
            templateButtons[i][j]->setIcon(*cardPics[0]);
            templateButtons[i][j]->setIconSize(QSize(PAIR_WIDTH, PAIR_HEIGHT));

            gameButtons[i][j] = new QPushButton(this);
            gameButtons[i][j]->setEnabled(true);
            gameButtons[i][j]->setGeometry(PAIR_START_X + PAIR_WIDTH * j, PAIR_START_Y + PAIR_HEIGHT * i, PAIR_WIDTH, PAIR_HEIGHT);
            gameButtons[i][j]->setIconSize(QSize(PAIR_WIDTH, PAIR_HEIGHT));
            QObject::connect(gameButtons[i][j], SIGNAL(clicked(bool)), mp, SLOT(map()));
            mp->setMapping(gameButtons[i][j], i * PAIR_WIDTH_COUNT + j);
        }
    }

    helpMsgbox = new QMessageBox(this);
    helpMsgbox->setText("将所有的方块成对消除后即可获得胜利。\n游戏时间限制为50秒，\n消除一对方块奖励0.5秒，\n使用一次提示扣除5秒，\n使用一次重排扣除剩余时间的1/3，\n最少扣除5秒。");
    helpMsgbox->addButton(QMessageBox::Ok);
    helpMsgbox->setIcon(QMessageBox::Information);

    succMsgbox = new QMessageBox(this);
    succMsgbox->addButton(QMessageBox::Ok);
    succMsgbox->setIcon(QMessageBox::Information);

{'fraction_non_alphanumeric': 0.14940323955669224, 'fraction_numerical': 0.007033248081841432, 'mean_word_length': 2.8849337748344372, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 35, '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': '1789536', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1794, 'n_words': 256}