-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSamuLife.h
83 lines (74 loc) · 2.16 KB
/
SamuLife.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef SamuLife_H
#define SamuLife_H
/**
* @brief Samu has learnt the rules of Conway's Game of Life
*
* @file GameOfLife.h
* @author Norbert Bátfai <nbatfai@gmail.com>
* @version 0.0.1
*
* @section LICENSE
*
* Copyright (C) 2015, 2016 Norbert Bátfai, batfai.norbert@inf.unideb.hu
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* @section DESCRIPTION
*
* SamuBrain, exp. 4, cognitive mental organs: MPU (Mental Processing Unit), Q-- lerning, acquiring higher-order knowledge
*
* This is an example of the paper entitled "Samu in his prenatal development".
*
* Previous experiments
*
* Samu (Nahshon)
* http://arxiv.org/abs/1511.02889
* https://github.com/nbatfai/nahshon
*
* SamuLife
* https://github.com/nbatfai/SamuLife
* https://youtu.be/b60m__3I-UM
*
* SamuMovie
* https://github.com/nbatfai/SamuMovie
* https://youtu.be/XOPORbI1hz4
*
* SamuStroop
* https://github.com/nbatfai/SamuStroop
* https://youtu.be/6elIla_bIrw
* https://youtu.be/VujHHeYuzIk
*/
#include <QKeyEvent>
#include <QMainWindow>
#include <QPainter>
#include <QFont>
#include "GameOfLife.h"
class SamuLife : public QMainWindow
{
Q_OBJECT
int m_cw {12*2}, m_ch {10*2};
GameOfLife *gameOfLife;
int **lattice {nullptr};
int **prediction {nullptr};
int **fp {nullptr};
int **fr {nullptr};
public slots :
void updateCells ( int **, int **, int **, int ** );
public:
SamuLife ( int w = 30, int h = 20, QWidget *parent = 0 );
virtual ~SamuLife();
void paintEvent ( QPaintEvent* );
void keyPressEvent ( QKeyEvent * event );
};
#endif // SamuLife_H