Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.19 KB | None | 0 0
  1. Új fájl: feladat_osszevagas.py
  2.  
  3. import math
  4. import sys
  5. import codecs
  6. import os
  7.  
  8. def mai_munka():
  9.     f = codecs.open("mastermind.cs","w","utf-8")
  10.     for root, dir, files in os.walk("."):
  11.         for ik in files:
  12.             print("Új fájl: "+ ik+"\n",file = f)
  13.             k = codecs.open(ik, "r",encoding='utf-8', errors='ignore').read().splitlines()
  14.             print("\n".join(k),file=f)
  15.     f.close()
  16.  
  17.  
  18. if __name__ == '__main__':
  19.     print("Mai munkám összevágása indul.")
  20.     mai_munka()
  21. Új fájl: main.cpp
  22.  
  23. #include "mainwindow.h"
  24. #include <QApplication>
  25.  
  26. int main(int argc, char *argv[])
  27. {
  28.     QApplication a(argc, argv);
  29.     MainWindow w;
  30.     w.show();
  31.  
  32.     return a.exec();
  33. }
  34. Új fájl: mainwindow.cpp
  35.  
  36. #include "mainwindow.h"
  37. #include "ui_mainwindow.h"
  38. #include <QPainter>
  39. #include <QLineF>
  40. #include <QColor>
  41. #include <QDesktopServices>
  42. #include <QDesktopWidget>
  43. #include <QDebug>
  44. #include <QMouseEvent>
  45. #include <QString>
  46. #include <QRect>
  47. #include <QMessageBox>
  48. #include "mastermind.h"
  49.  
  50. MainWindow::MainWindow(QWidget *parent) :
  51.     QMainWindow(parent),
  52.     ui(new Ui::MainWindow),
  53.     Game(new MasterMind(this))
  54. {
  55.     ui->setupUi(this);
  56.     this->genExampleCircle();
  57. }
  58.  
  59. MainWindow::~MainWindow()
  60. {
  61.     delete ui;
  62. }
  63.  
  64. void MainWindow::mousePressEvent(QMouseEvent *event){
  65.     if(currentStage == 10){
  66.         QMessageBox::information(0,"Mastermind","A játék véget ért, ha szeretnél kezdj egy újat.");
  67.     }
  68.     QPoint po = event->pos();
  69.     //Cella kiszámítása:
  70.     int x = po.x() - 210;
  71.     int y = po.y() - 200;
  72.     if((x > 0 && y > 0) && (x < 501 && y < 201)){
  73.         if(this->valasztott_szin == -1){
  74.             QMessageBox::information(0,"MasterMind","Nem választottál színt, kérlek válassz egyet!");
  75.             return;
  76.         }
  77.         int sor = y/50;
  78.         int oszlop = x/50;
  79.         if (oszlop != currentStage){
  80.             QMessageBox::information(0,"MasterMind","Ide nem tehetsz \"kört\", jelenleg a(z) " +
  81.                                      QString::number(this->currentStage+1) + ". oszlopnál tartasz.");
  82.             return;
  83.         }
  84.         int tmp = Game->Stages[currentStage]->insertColor(valasztott_szin,sor);
  85.         switch(tmp){
  86.         case(2):
  87.             QMessageBox::information(0,"Mastermind","Ide nem tehetsz már semmilyen színt!");
  88.             break;
  89.         case(1):
  90.             Game->checkStage();
  91.             currentStage++;
  92.         case(0):
  93.             this->szinletesz(sor,oszlop);
  94.             break;
  95.         }
  96.  
  97.         if(currentStage == 10){
  98.             QMessageBox::information(0,"Mastermind","A játék véget ért, ha szeretnél kezdj egy újat.");
  99.         }
  100.     }
  101. }
  102.  
  103. void MainWindow::szinletesz(int sor,int oszlop){
  104.     QPoint BalFelsoKord(oszlop*50 + 209,sor*50 + 198);
  105.     QPushButton * p = new QPushButton(" ",this);
  106.     p->setVisible(true);
  107.     p->setGeometry(QRect(BalFelsoKord,QSize(50, 50)));
  108.     p->setStyleSheet(this->cPathImage(this->valasztott_szin));
  109.     p->raise(); //TOP layerként helyezi el.
  110.     letettGombok[letettGombCounter++] = p;
  111.     connect(p,SIGNAL(released()),this,SLOT(gombvalaszt_Click()));
  112. }
  113.  
  114. QString MainWindow::cPathImage(int szin){
  115.     return QString("background-color: transparent;background-image: url(C:/Users/User/Desktop/MasterMind/"+a[szin]+"circle.png"+");");
  116. }
  117.  
  118. void MainWindow::genExampleCircle(){
  119.     for (int i = 1;i <= a.size();i++) {
  120.         QPushButton * currentButton = new QPushButton(QString::number(i),this);
  121.         currentButton->setGeometry(QRect(QPoint(266+((i-1)*55), 130),
  122.                                          QSize(50, 50)));
  123.         currentButton->setStyleSheet("background-color: transparent;background-image: url(C:/Users/User/Desktop/MasterMind/"+a[i-1]+"circle.png);");
  124.         this->valasztani_gombok[i-1] = currentButton;
  125.         connect(currentButton,SIGNAL(released()),this,SLOT(gombvalaszt_Click()));
  126.     }
  127. }
  128.  
  129. void MainWindow::gombvalaszt_Click(){
  130.     QPushButton * senderObj = (QPushButton*)sender();
  131.     if(senderObj->text() == " "){
  132.         QMessageBox::information(this,"Mastermind","Nem tehetsz ide kört.");
  133.         return;
  134.     }
  135.     int senderName = senderObj->text().toInt();
  136.  
  137.     QString valasztott_temp = "<html><head/><body><p>         \
  138.                                Választott szín: { <span style=\" font-weight:600;\"> \
  139.                                <font color=\""+this->a[senderName-1]+"\">"+this->szinhelper[senderName-1]+"</font> </span> }</p></body></html>";
  140.  
  141.     //ui->label_2->setText("\tA választott szín: { "+this->szinhelper[senderName-1]+" }");
  142.     ui->label_2->setText(valasztott_temp);
  143.     ui->label_2->setGeometry(375,162,ui->label_2->width(),ui->label_2->height());
  144.     this->valasztott_szin = senderName-1;
  145.  
  146. }
  147.  
  148. void MainWindow::paintEvent(QPaintEvent *)
  149. {
  150.     QPainter painter(this);
  151.     QPen pen(Qt::black);
  152.     pen.setWidth(2);
  153.     painter.setPen(pen);
  154.     for(int i = 0;i < 5;i++){
  155.         QLineF line(210,200+(i*50),210+(10*50),200+(i*50));
  156.         painter.drawLine(line);
  157.     }
  158.     for(int i = 0;i < 11;i++){
  159.         QLineF linefuggoleges(210+(i*50),200,210+(i*50),200+(50*4));
  160.         painter.drawLine(linefuggoleges);
  161.     }
  162. }
  163.  
  164.  
  165.  
  166. void MainWindow::on_pushButton_2_clicked()
  167. {
  168.     if(this->currentStage < 10){
  169.         QMessageBox::information(0,"Mastermind kiértékelés",
  170.         "Csak akkor kérhetsz kiértékelést, ha a 10. lépésnél se adtál helyes megoldást.");
  171.         return;
  172.     }else{
  173.         //Kiértékelés függvény hívás
  174.     }
  175. }
  176.  
  177. void MainWindow::on_pushButton_clicked()
  178. {
  179.     if(this->currentStage < 5){
  180.         QMessageBox::information(0,"Mastermind segítség","Csak a 6. lépéstől kezdve kérhetsz segítséget.");
  181.     }else{
  182.         //segítség függvény
  183.     }
  184. }
  185.  
  186. void MainWindow::resetGame(){
  187.     currentStage = 0;
  188.     for(int i = 0; i < letettGombCounter;i++){
  189.         letettGombok[i]->hide();
  190.         delete letettGombok[i];
  191.     }
  192.     delete Game;
  193.     Game = new MasterMind(this);
  194. }
  195.  
  196. void MainWindow::on_pushButton_3_clicked()
  197. {
  198.     this->resetGame();
  199. }
  200. Új fájl: mainwindow.h
  201.  
  202. #ifndef MAINWINDOW_H
  203. #define MAINWINDOW_H
  204.  
  205. #include <QMainWindow>
  206. #include <QTableWidget>
  207. #include <QStringList>
  208. #include <QPainter>
  209. #include <QRectF>
  210. #include <QPainter>
  211. #include <QPushButton>
  212. #include <QStringList>
  213. #include <QPushButton>
  214.  
  215. enum szinek{
  216.     blue,
  217.     gray,
  218.     green,
  219.     orange,
  220.     purple,
  221.     red,
  222.     yellow
  223. };
  224.  
  225. class MasterMind;
  226.  
  227. namespace Ui {
  228. class MainWindow;
  229. }
  230.  
  231. class MainWindow : public QMainWindow
  232. {
  233.     Q_OBJECT
  234.  
  235. public:
  236.     explicit MainWindow(QWidget *parent = 0);
  237.     ~MainWindow();
  238.     void paintEvent(QPaintEvent *event);
  239.     void mousePressEvent(QMouseEvent *event);
  240.     void genExampleCircle();
  241.     void szinletesz(int,int);
  242.     void resetGame();
  243.     MasterMind * Game;
  244.     QPushButton * letettGombok[40];
  245.     int letettGombCounter = 0;
  246.  
  247.     QString cPathImage(int szin);
  248.     QStringList szinhelper = {"Kék","Szürke","Zöld","Narancs sárga","Lila","Piros","Citrom sárga"};
  249.     QPushButton* valasztani_gombok[7];
  250.     unsigned short int currentStage = 0;
  251.     QStringList a = {"blue" ,"gray" , "green",
  252.       "orange","purple","red","yellow"};
  253.  
  254.     int valasztott_szin = -1;
  255.  
  256. public slots:
  257.     void gombvalaszt_Click();
  258.  
  259. private slots:
  260.     void on_pushButton_2_clicked();
  261.  
  262.     void on_pushButton_clicked();
  263.  
  264.     void on_pushButton_3_clicked();
  265.  
  266. private:
  267.     Ui::MainWindow *ui;
  268. };
  269.  
  270. #endif // MAINWINDOW_H
  271. Új fájl: mastermind.cpp
  272.  
  273. #include "mastermind.h"
  274. #include "mainwindow.h"
  275. #include <vector>
  276.  
  277. MasterMind::MasterMind(MainWindow * szulo):parent(szulo){
  278.     for(int i = 0;i < 10; i++){
  279.         this->Stages[i] = new Stage(i);
  280.     }
  281.     this->genRandomTask();
  282.  
  283.     this->currentStage = &parent->currentStage;
  284.     qDebug() << parent->currentStage;
  285.  
  286.  
  287.     qDebug() << feladvany.cella[0] << feladvany.cella[1] << feladvany.cella[2] << feladvany.cella[3];
  288. }
  289.  
  290. void MasterMind::genRandomTask(){
  291.     std::vector<int> tmp = {0,1,2,3,4,5,6};
  292.     for(int i = 0;i < 4;i++){
  293.         int randint = rand() % (tmp.size());
  294.         feladvany.insertColor(tmp[randint],i);
  295.         tmp.erase(tmp.begin()+randint);
  296.     }
  297. }
  298.  
  299. void MasterMind::checkStage(){
  300.     if(feladvany == *this->Stages[*currentStage]){
  301.         qDebug() << "helyes megoldás.";
  302.     }
  303. }
  304. Új fájl: mastermind.cs
  305.  
  306. Új fájl: feladat_osszevagas.py
  307.  
  308. import math
  309. import sys
  310. import codecs
  311. import os
  312.  
  313. def mai_munka():
  314.     f = codecs.open("mastermind.cs","w","utf-8")
  315.     for root, dir, files in os.walk("."):
  316.         for ik in files:
  317.             print("Új fájl: "+ ik+"\n",file = f)
  318.             k = codecs.open(ik, "r",encoding='utf-8', errors='ignore').read().splitlines()
  319.             print("\n".join(k),file=f)
  320.     f.close()
  321.  
  322.  
  323. if __name__ == '__main__':
  324.     print("Mai munkám összevágása indul.")
  325.     mai_munka()
  326. Új fájl: main.cpp
  327.  
  328. #include "mainwindow.h"
  329. #include <QApplication>
  330.  
  331. int main(int argc, char *argv[])
  332. {
  333.     QApplication a(argc, argv);
  334.     MainWindow w;
  335.     w.show();
  336.  
  337.     return a.exec();
  338. }
  339. Új fájl: mainwindow.cpp
  340.  
  341. #include "mainwindow.h"
  342. #include "ui_mainwindow.h"
  343. #include <QPainter>
  344. #include <QLineF>
  345. #include <QColor>
  346. #include <QDesktopServices>
  347. #include <QDesktopWidget>
  348. #include <QDebug>
  349. #include <QMouseEvent>
  350. #include <QString>
  351. #include <QRect>
  352. #include <QMessageBox>
  353. #include "mastermind.h"
  354.  
  355. MainWindow::MainWindow(QWidget *parent) :
  356.     QMainWindow(parent),
  357.     ui(new Ui::MainWindow),
  358.     Game(new MasterMind(this))
  359. {
  360.     ui->setupUi(this);
  361.     this->genExampleCircle();
  362. }
  363.  
  364. MainWindow::~MainWindow()
  365. {
  366.     delete ui;
  367. }
  368.  
  369. void MainWindow::mousePressEvent(QMouseEvent *event){
  370.     if(currentStage == 10){
  371.         QMessageBox::information(0,"Mastermind","A játék véget ért, ha szeretnél kezdj egy újat.");
  372.     }
  373.     QPoint po = event->pos();
  374.     //Cella kiszámítása:
  375.     int x = po.x() - 210;
  376.     int y = po.y() - 200;
  377.     if((x > 0 && y > 0) && (x < 501 && y < 201)){
  378.         if(this->valasztott_szin == -1){
  379.             QMessageBox::information(0,"MasterMind","Nem választottál színt, kérlek válassz egyet!");
  380.             return;
  381.         }
  382.         int sor = y/50;
  383.         int oszlop = x/50;
  384.         if (oszlop != currentStage){
  385.             QMessageBox::information(0,"MasterMind","Ide nem tehetsz \"kört\", jelenleg a(z) " +
  386.                                      QString::number(this->currentStage+1) + ". oszlopnál tartasz.");
  387.             return;
  388.         }
  389.         int tmp = Game->Stages[currentStage]->insertColor(valasztott_szin,sor);
  390.         switch(tmp){
  391.         case(2):
  392.             QMessageBox::information(0,"Mastermind","Ide nem tehetsz már semmilyen színt!");
  393.             break;
  394.         case(1):
  395.             Game->checkStage();
  396.             currentStage++;
  397.         case(0):
  398.             this->szinletesz(sor,oszlop);
  399.             break;
  400.         }
  401.  
  402.         if(currentStage == 10){
  403.             QMessageBox::information(0,"Mastermind","A játék véget ért, ha szeretnél kezdj egy újat.");
  404.         }
  405.     }
  406. }
  407.  
  408. void MainWindow::szinletesz(int sor,int oszlop){
  409.     QPoint BalFelsoKord(oszlop*50 + 209,sor*50 + 198);
  410.     QPushButton * p = new QPushButton(" ",this);
  411.     p->setVisible(true);
  412.     p->setGeometry(QRect(BalFelsoKord,QSize(50, 50)));
  413.     p->setStyleSheet(this->cPathImage(this->valasztott_szin));
  414.     p->raise(); //TOP layerként helyezi el.
  415.     letettGombok[letettGombCounter++] = p;
  416.     connect(p,SIGNAL(released()),this,SLOT(gombvalaszt_Click()));
  417. }
  418.  
  419. QString MainWindow::cPathImage(int szin){
  420.     return QString("background-color: transparent;background-image: url(C:/Users/User/Desktop/MasterMind/"+a[szin]+"circle.png"+");");
  421. }
  422.  
  423. void MainWindow::genExampleCircle(){
  424.     for (int i = 1;i <= a.size();i++) {
  425.         QPushButton * currentButton = new QPushButton(QString::number(i),this);
  426.         currentButton->setGeometry(QRect(QPoint(266+((i-1)*55), 130),
  427.                                          QSize(50, 50)));
  428.         currentButton->setStyleSheet("background-color: transparent;background-image: url(C:/Users/User/Desktop/MasterMind/"+a[i-1]+"circle.png);");
  429.         this->valasztani_gombok[i-1] = currentButton;
  430.         connect(currentButton,SIGNAL(released()),this,SLOT(gombvalaszt_Click()));
  431.     }
  432. }
  433.  
  434. void MainWindow::gombvalaszt_Click(){
  435.     QPushButton * senderObj = (QPushButton*)sender();
  436.     if(senderObj->text() == " "){
  437.         QMessageBox::information(this,"Mastermind","Nem tehetsz ide kört.");
  438.         return;
  439.     }
  440.     int senderName = senderObj->text().toInt();
  441.  
  442.     QString valasztott_temp = "<html><head/><body><p>         \
  443.                                Választott szín: { <span style=\" font-weight:600;\"> \
  444.                                <font color=\""+this->a[senderName-1]+"\">"+this->szinhelper[senderName-1]+"</font> </span> }</p></body></html>";
  445.  
  446.     //ui->label_2->setText("\tA választott szín: { "+this->szinhelper[senderName-1]+" }");
  447.     ui->label_2->setText(valasztott_temp);
  448.     ui->label_2->setGeometry(375,162,ui->label_2->width(),ui->label_2->height());
  449.     this->valasztott_szin = senderName-1;
  450.  
  451. }
  452.  
  453. void MainWindow::paintEvent(QPaintEvent *)
  454. {
  455.     QPainter painter(this);
  456.     QPen pen(Qt::black);
  457.     pen.setWidth(2);
  458.     painter.setPen(pen);
  459.     for(int i = 0;i < 5;i++){
  460.         QLineF line(210,200+(i*50),210+(10*50),200+(i*50));
  461.         painter.drawLine(line);
  462.     }
  463.     for(int i = 0;i < 11;i++){
  464.         QLineF linefuggoleges(210+(i*50),200,210+(i*50),200+(50*4));
  465.         painter.drawLine(linefuggoleges);
  466.     }
  467. }
  468.  
  469.  
  470.  
  471. void MainWindow::on_pushButton_2_clicked()
  472. {
  473.     if(this->currentStage < 10){
  474.         QMessageBox::information(0,"Mastermind kiértékelés",
  475.         "Csak akkor kérhetsz kiértékelést, ha a 10. lépésnél se adtál helyes megoldást.");
  476.         return;
  477.     }else{
  478.         //Kiértékelés függvény hívás
  479.     }
  480. }
  481.  
  482. void MainWindow::on_pushButton_clicked()
  483. {
  484.     if(this->currentStage < 5){
  485.         QMessageBox::information(0,"Mastermind segítség","Csak a 6. lépéstől kezdve kérhetsz segítséget.");
  486.     }else{
  487.         //segítség függvény
  488.     }
  489. }
  490.  
  491. void MainWindow::resetGame(){
  492.     currentStage = 0;
  493.     for(int i = 0; i < letettGombCounter;i++){
  494.         letettGombok[i]->hide();
  495.         delete letettGombok[i];
  496.     }
  497.     delete Game;
  498.     Game = new MasterMind(this);
  499. }
  500.  
  501. void MainWindow::on_pushButton_3_clicked()
  502. {
  503.     this->resetGame();
  504. }
  505. Új fájl: mainwindow.h
  506.  
  507. #ifndef MAINWINDOW_H
  508. #define MAINWINDOW_H
  509.  
  510. #include <QMainWindow>
  511. #include <QTableWidget>
  512. #include <QStringList>
  513. #include <QPainter>
  514. #include <QRectF>
  515. #include <QPainter>
  516. #include <QPushButton>
  517. #include <QStringList>
  518. #include <QPushButton>
  519.  
  520. enum szinek{
  521.     blue,
  522.     gray,
  523.     green,
  524.     orange,
  525.     purple,
  526.     red,
  527.     yellow
  528. };
  529.  
  530. class MasterMind;
  531.  
  532. namespace Ui {
  533. class MainWindow;
  534. }
  535.  
  536. class MainWindow : public QMainWindow
  537. {
  538.     Q_OBJECT
  539.  
  540. public:
  541.     explicit MainWindow(QWidget *parent = 0);
  542.     ~MainWindow();
  543.     void paintEvent(QPaintEvent *event);
  544.     void mousePressEvent(QMouseEvent *event);
  545.     void genExampleCircle();
  546.     void szinletesz(int,int);
  547.     void resetGame();
  548.     MasterMind * Game;
  549.     QPushButton * letettGombok[40];
  550.     int letettGombCounter = 0;
  551.  
  552.     QString cPathImage(int szin);
  553.     QStringList szinhelper = {"Kék","Szürke","Zöld","Narancs sárga","Lila","Piros","Citrom sárga"};
  554.     QPushButton* valasztani_gombok[7];
  555.     unsigned short int currentStage = 0;
  556.     QStringList a = {"blue" ,"gray" , "green",
  557.       "orange","purple","red","yellow"};
  558.  
  559.     int valasztott_szin = -1;
  560.  
  561. public slots:
  562.     void gombvalaszt_Click();
  563.  
  564. private slots:
  565.     void on_pushButton_2_clicked();
  566.  
  567.     void on_pushButton_clicked();
  568.  
  569.     void on_pushButton_3_clicked();
  570.  
  571. private:
  572.     Ui::MainWindow *ui;
  573. };
  574.  
  575. #endif // MAINWINDOW_H
  576. Új fájl: mastermind.cpp
  577.  
  578. #include "mastermind.h"
  579. #include "mainwindow.h"
  580. #include <vector>
  581.  
  582. MasterMind::MasterMind(MainWindow * szulo):parent(szulo){
  583.     for(int i = 0;i < 10; i++){
  584.         this->Stages[i] = new Stage(i);
  585.     }
  586.     this->genRandomTask();
  587.  
  588.     this->currentStage = &parent->currentStage;
  589.     qDebug() << parent->currentStage;
  590.  
  591.  
  592.     qDebug() << feladvany.cella[0] << feladvany.cella[1] << feladvany.cella[2] << feladvany.cella[3];
  593. }
  594.  
  595. void MasterMind::genRandomTask(){
  596.     std::vector<int> tmp = {0,1,2,3,4,5,6};
  597.     for(int i = 0;i < 4;i++){
  598.         int randint = rand() % (tmp.size());
  599.         feladvany.insertColor(tmp[randint],i);
  600.         tmp.erase(tmp.begin()+randint);
  601.     }
  602. }
  603.  
  604. void MasterMind::checkStage(){
  605.     if(feladvany == *this->Stages[*currentStage]){
  606.         qDebug() << "helyes megoldás.";
  607.     }
  608. }
  609. Új fájl: mastermind.h
  610.  
  611. #ifndef MASTERMIND_H
  612. #define MASTERMIND_H
  613. #include <QObject>
  614. #include "stage.h"
  615. #include <QDebug>
  616. #include <stdlib.h>
  617.  
  618. class MainWindow;
  619.  
  620. class MasterMind
  621. {
  622. public:
  623.     MasterMind(){;}
  624.     MasterMind(MainWindow * szulo);
  625.     ~MasterMind(){
  626.         qDebug() << "Call mastermind dtor";
  627.         for(int i = 0;i < 10;i++){
  628.             delete Stages[i];
  629.         }
  630.     }
  631.  
  632.     unsigned short int * currentStage;
  633.     MainWindow * parent;
  634.     Stage* Stages[10];
  635.     Stage feladvany;
  636.     int pontszam;
  637.     int elsojo;
  638.  
  639.     void genRandomTask();
  640.     void checkStage();
  641.     void segitseg();
  642.     void kiertekel();
  643.     void tobbszin();
  644.     void utolsotipp();
  645.     void egyszersem();
  646.     void csakszinhelyes();
  647.  
  648. };
  649.  
  650. #endif // MASTERMIND_H
  651. Új fájl: stage.cpp
  652.  
  653. #include "stage.h"
  654. #include <QDebug>
  655.  
  656. int Stage::insertColor(int szin,int sor){
  657.     if(pos != 4 && cella[sor] == -1){
  658.         this->cella[sor] = szin;
  659.         pos++;
  660.         return (pos == 4) ? 1 : 0;
  661.     }else if(cella[sor] != -1){
  662.         return 2;
  663.     }
  664. }
  665. Új fájl: stage.h
  666.  
  667. #ifndef STAGE_H
  668. #define STAGE_H
  669.  
  670. class Stage
  671. {
  672. public:
  673.     Stage(){;}
  674.     Stage(int stageID):ID(stageID),pos(0) {;}
  675.     int ID;
  676.     int cella[4] = {-1,-1,-1,-1};
  677.     int pos;
  678.  
  679.     int insertColor(int szin,int sor);
  680.     friend bool operator==(const Stage& s1, const Stage& s2)
  681.     {
  682.         return (s1.cella[0] == s2.cella[0]) &&
  683.                 (s1.cella[1] == s2.cella[1]) &&
  684.                 (s1.cella[2] == s2.cella[2]) &&
  685.                 (s1.cella[3] == s2.cella[3]);
  686.     }
  687.  
  688. };
  689.  
  690. #endif // STAGE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement