Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bevprog2bead3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fodor Ágoston
bevprog2bead3
Commits
7d0108d7
Commit
7d0108d7
authored
1 year ago
by
Fodor Ágoston
Browse files
Options
Downloads
Patches
Plain Diff
ellenőrzés teljes
parent
4de67ed3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application.cpp
+54
-21
54 additions, 21 deletions
application.cpp
with
54 additions
and
21 deletions
application.cpp
+
54
−
21
View file @
7d0108d7
...
...
@@ -19,7 +19,7 @@ void ellenoriz(vector<Widget> v)
void
Application
::
registerWidget
(
Widget
*
w
)
{
// Az új widgetet közvetlenül hozzáadjuk a widgets vektorhoz
widgets
.
push_back
(
w
);
}
...
...
@@ -42,11 +42,22 @@ void Application::event_loop()
}
wrongi
=
-
1
;
for
(
int
k
=
0
;
k
<
81
;
k
+=
9
)
{
for
(
int
i
=
k
;
i
<
9
+
k
;
++
i
)
{
for
(
size_t
j
=
i
+
1
;
j
<
9
+
k
;
++
j
)
{
if
(
widgets
[
i
]
->
getter
()
==
widgets
[
j
]
->
getter
())
{
wrongi
=
j
;
if
(
focus
!=
-
1
)
{
widgets
[
focus
]
->
handle
(
ev
);
for
(
int
k
=
0
;
k
<
81
;
k
+=
9
)
{
for
(
int
i
=
k
;
i
<
9
+
k
;
++
i
)
{
for
(
size_t
j
=
i
+
1
;
j
<
9
+
k
;
++
j
)
{
if
(
widgets
[
i
]
->
getter
()
==
widgets
[
j
]
->
getter
())
{
wrongi
=
j
;
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
...
...
@@ -54,16 +65,17 @@ void Application::event_loop()
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
for
(
int
k
=
0
;
k
<
9
;
++
k
)
{
for
(
int
i
=
k
;
i
<
81
;
i
+=
9
)
{
for
(
size_t
j
=
i
+
9
;
j
<
81
;
j
+=
9
)
{
if
(
widgets
[
i
]
->
getter
()
==
widgets
[
j
]
->
getter
())
{
wrongi
=
j
;
for
(
int
k
=
0
;
k
<
9
;
++
k
)
{
for
(
int
i
=
k
;
i
<
81
;
i
+=
9
)
{
for
(
size_t
j
=
i
+
9
;
j
<
81
;
j
+=
9
)
{
if
(
widgets
[
i
]
->
getter
()
==
widgets
[
j
]
->
getter
())
{
wrongi
=
j
;
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
...
...
@@ -71,14 +83,35 @@ void Application::event_loop()
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
for
(
int
row_offset
=
0
;
row_offset
<
9
;
row_offset
+=
3
)
{
for
(
int
col_offset
=
0
;
col_offset
<
9
;
col_offset
+=
3
)
{
std
::
vector
<
bool
>
seen
(
10
,
false
);
if
(
focus
!=
-
1
)
{
widgets
[
focus
]
->
handle
(
ev
);
for
(
int
i
=
row_offset
;
i
<
row_offset
+
3
;
++
i
)
{
for
(
int
j
=
col_offset
;
j
<
col_offset
+
3
;
++
j
)
{
int
num
=
widgets
[
i
*
9
+
j
]
->
getter
();
if
(
num
!=
0
)
{
if
(
seen
[
num
])
{
wrongi
=
i
*
9
+
j
;
break
;
}
else
{
seen
[
num
]
=
true
;
}
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
if
(
wrongi
!=
-
1
)
{
break
;
}
}
}
for
(
int
i
=
0
;
i
<
widgets
.
size
();
++
i
)
{
...
...
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