Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet_sudoku
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
Jolibois Simon
Projet_sudoku
Commits
dccada25
Commit
dccada25
authored
4 years ago
by
Jolibois Simon
Browse files
Options
Downloads
Patches
Plain Diff
Delete main.cpp
parent
2f489c99
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+0
-84
0 additions, 84 deletions
main.cpp
with
0 additions
and
84 deletions
main.cpp
deleted
100644 → 0
+
0
−
84
View file @
2f489c99
#include
<QGuiApplication>
#include
<QQmlApplicationEngine>
#include
<QtQml>
#include
<QFile>
#include
<QStringList>
#include
<QDebug>
#include
<iostream>
#include
<math.h>
#include
"grille.h"
#include
<algorithm>
#include
<string>
int
main
(
int
argc
,
char
*
argv
[]){
// Lecture de la grille .csv de départ
// SI POSSIBLE CHANGER CELA EN FCT, UTILE POUR ENREGISTRER UNE PARTIE EN COURS ET LA REOUVRIR
// Pb avec QFile qui ne veut pas s'initialiser
Grille
G
;
QFile
file
(
"../Sudoku/grilles/grilleFacile.csv"
);
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
))
{
qDebug
()
<<
file
.
errorString
();
return
1
;
}
QStringList
matrice_List
;
file
.
readLine
();
// on ne veut pas la première ligne
int
i
=
0
;
// permet de savoir quelle ligne ou lit
while
(
!
file
.
atEnd
())
{
QByteArray
line
=
file
.
readLine
();
// on lit ligne par ligne le fichier
std
::
replace
(
line
.
begin
(),
line
.
end
(),
'.'
,
'0'
);
// on remplace les . du .csv par des 0
for
(
int
j
=
0
;
j
<
9
;
j
++
){
if
(
int
(
line
[
2
*
j
])
-
48
>
0
)
G
.
Set
(
i
,
j
,
int
(
line
[
2
*
j
])
-
48
);
// on remplit le tableau avec les valeurs de départ
}
i
+=
1
;
}
G
.
Print
();
// test sélection et remplissage de case
G
.
SelectCase
(
2
,
2
);
G
.
SelectChiffre
(
4
);
G
.
EssaiJoueur
();
G
.
SelectCase
(
8
,
1
);
// pas besoin de reselectionner de nouveau le chiffre si on veut le mm
G
.
EssaiJoueur
();
G
.
SelectCase
(
4
,
8
);
G
.
SelectChiffre
(
7
);
G
.
EssaiJoueur
();
G
.
Print
();
// Updated upstream
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Stashed changes
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
#endif
QGuiApplication
app
(
argc
,
argv
);
QQmlApplicationEngine
engine
;
const
QUrl
url
(
QStringLiteral
(
"qrc:/main.qml"
));
QObject
::
connect
(
&
engine
,
&
QQmlApplicationEngine
::
objectCreated
,
&
app
,
[
url
](
QObject
*
obj
,
const
QUrl
&
objUrl
)
{
if
(
!
obj
&&
url
==
objUrl
)
QCoreApplication
::
exit
(
-
1
);
},
Qt
::
QueuedConnection
);
engine
.
load
(
url
);
return
app
.
exec
();
// Updated upstream
return
(
0
);
// Stashed changes
}
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