Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
projetcppqt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Durand Ulysse
projetcppqt
Commits
de8c431a
Commit
de8c431a
authored
3 months ago
by
Ulysse Durand
Browse files
Options
Downloads
Patches
Plain Diff
fini ?
parent
677f702c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+3
-0
3 additions, 0 deletions
README.md
motus/jeu.cpp
+2
-3
2 additions, 3 deletions
motus/jeu.cpp
motus/jeu.h
+2
-1
2 additions, 1 deletion
motus/jeu.h
motus/main.cpp
+2
-1
2 additions, 1 deletion
motus/main.cpp
with
9 additions
and
5 deletions
README.md
+
3
−
0
View file @
de8c431a
...
...
@@ -2,5 +2,8 @@
Par Yanis DZIKI et Ulysse DURAND
# Configuration
Il faut changer fichierTexte (fichier de liste des mots), width et height dans main.cpp
Vos fichiers de liste de mots doivent se trouver dans le même dossier que l'executable de l'application (qui est peut être dans le dossier build).
This diff is collapsed.
Click to expand it.
motus/jeu.cpp
+
2
−
3
View file @
de8c431a
...
...
@@ -4,8 +4,9 @@
#include
<QQmlContext>
Jeu
::
Jeu
(
QQmlApplicationEngine
*
engine
,
int
width
,
int
height
,
QObject
*
parent
)
:
QObject
(
parent
),
width
(
width
),
height
(
height
),
engine
(
engine
)
{
Jeu
::
Jeu
(
QQmlApplicationEngine
*
engine
,
int
width
,
int
height
,
string
fichierTexte
,
QObject
*
parent
)
:
QObject
(
parent
),
width
(
width
),
height
(
height
),
engine
(
engine
)
{
brain
=
new
Brain
(
"./"
);
brain
->
setFichierDico
(
fichierTexte
);
}
int
Jeu
::
getWidth
()
{
return
width
;}
...
...
@@ -46,8 +47,6 @@ void Jeu::initGame() {
void
Jeu
::
startGame
()
{
engine
->
rootContext
()
->
setContextProperty
(
"jeu"
,
this
);
brain
->
setFichierDico
(
"words_alpha.txt"
);
brain
->
setNombreEssais
(
height
);
brain
->
setTailleMots
(
width
);
...
...
This diff is collapsed.
Click to expand it.
motus/jeu.h
+
2
−
1
View file @
de8c431a
...
...
@@ -14,7 +14,7 @@ class Jeu : public QObject {
Q_PROPERTY
(
QQuickItem
*
gameWindow
READ
getGameWindow
NOTIFY
gameWindowChanged
)
public:
explicit
Jeu
(
QQmlApplicationEngine
*
engine
,
int
width
,
int
height
,
QObject
*
parent
=
nullptr
);
explicit
Jeu
(
QQmlApplicationEngine
*
engine
,
int
width
,
int
height
,
string
fichierTexte
,
QObject
*
parent
=
nullptr
);
QString
getMotAffiche
();
Q_INVOKABLE
void
onClavierClick
(
QString
lettre
);
Q_INVOKABLE
void
initGame
();
...
...
@@ -38,6 +38,7 @@ private:
int
currentIndex
=
0
;
// Pour suivre où on écrit
int
width
;
int
height
;
string
fichierTexte
;
};
#endif // JEU_H
This diff is collapsed.
Click to expand it.
motus/main.cpp
+
2
−
1
View file @
de8c431a
...
...
@@ -15,6 +15,7 @@ int main(int argc, char *argv[]) {
int
width
=
7
;
int
height
=
6
;
string
fichierTexte
=
"words_alpha.txt"
;
// Charger l'interface utilisateur (QML)
LetterModel
letterModel
(
width
,
height
);
...
...
@@ -26,7 +27,7 @@ int main(int argc, char *argv[]) {
QQuickItem
*
parentItem
=
rootItem
;
Jeu
jeu
(
&
engine
,
width
,
height
);
Jeu
jeu
(
&
engine
,
width
,
height
,
fichierTexte
);
jeu
.
setLetterModel
(
&
letterModel
);
engine
.
rootContext
()
->
setContextProperty
(
"jeu"
,
&
jeu
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment