Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Momomotus
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pouchet Pierre
Momomotus
Commits
251cc228
Commit
251cc228
authored
1 month ago
by
Massies Alexandre
Browse files
Options
Downloads
Patches
Plain Diff
verif mot et couleurs fonctionnels
parent
1eacbc89
Loading
Loading
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Motus/Main.qml
+9
-9
9 additions, 9 deletions
Motus/Main.qml
Motus/motusgame.cpp
+2
-1
2 additions, 1 deletion
Motus/motusgame.cpp
with
11 additions
and
10 deletions
Motus/Main.qml
+
9
−
9
View file @
251cc228
...
...
@@ -60,12 +60,13 @@ Window {
if
(
indice_case
===
nb_lettres
)
{
var
mot_entre
=
""
;
for
(
var
i
=
0
;
i
<
nb_lettres
;
i
++
){
mot_entre
+=
caseArray
[
current_essai
*
nb_lettres
+
indice_case
].
_textText
;
console
.
log
(
caseArray
[
current_essai
*
nb_lettres
+
i
].
_textText
);
mot_entre
+=
caseArray
[
current_essai
*
nb_lettres
+
i
].
_textText
;
}
console
.
log
(
"
Mot entré :
"
,
mot_entre
.
toUpperCase
());
if
(
motusGame
.
existWord
(
mot_entre
.
toUpperCase
())){
// Vérification de la proposition sur la ligne actuelle
for
(
i
=
0
;
i
<
nb_lettres
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nb_lettres
;
i
++
)
{
var
case_verif
=
caseArray
[
current_essai
*
nb_lettres
+
i
];
var
lettre_verif
=
case_verif
.
_textText
;
if
(
lettre_verif
===
mot_split
[
i
].
toUpperCase
())
{
...
...
@@ -81,7 +82,7 @@ Window {
}
}
}
//
Après vérification, p
assage à la ligne suivante si possible
//
P
assage à la ligne suivante si possible
if
(
current_essai
<
nb_essais
-
1
)
{
current_essai
++
;
indice_case
=
0
;
...
...
@@ -89,16 +90,15 @@ Window {
// Fin de partie : vous pouvez désactiver l'interface ou afficher un message
mot
=
""
;
}
}
else
{
}
else
{
// Le mot n'existe pas dans le dictionnaire : coloration en rouge puis réinitialisation
for
(
i
=
0
;
i
<
nb_lettres
;
i
++
)
{
case_verif
=
caseArray
[
current_essai
*
nb_lettres
+
i
];
case_verif
.
rectangleColor
=
"
#cf1b2a
"
;
case_verif
.
rectangleBordercolor
=
"
#cf1b2a
"
;
revertTimer
.
start
();
}
revertTimer
.
start
();
}
event
.
accepted
=
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Motus/motusgame.cpp
+
2
−
1
View file @
251cc228
...
...
@@ -72,10 +72,11 @@ void MotusGame::loadWords() {
bool
MotusGame
::
existWord
(
const
QString
&
word
)
{
int
n
=
word
.
size
();
bool
exists
=
false
;
qDebug
()
<<
"Recherche du mot :"
<<
word
;
// Supposons que wordsByLength est un QMap<int, QStringList>
const
QStringList
&
list
=
wordsByLength
[
n
];
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
qDebug
()
<<
list
[
i
].
toUpper
();
if
(
list
[
i
].
toUpper
()
==
word
)
{
exists
=
true
;
break
;
// On arrête la recherche dès qu'on trouve le mot
...
...
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