Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Tic-Tac-Toe
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
Hanna Johansson
Tic-Tac-Toe
Commits
3ae4edf8
Commit
3ae4edf8
authored
3 years ago
by
Hanna Johansson
Browse files
Options
Downloads
Patches
Plain Diff
Update Form1.cs so that color change for winning row, only occurs once (outside loop)
parent
0874d1b7
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Form1.cs
+5
-5
5 additions, 5 deletions
Form1.cs
with
5 additions
and
5 deletions
Form1.cs
+
5
−
5
View file @
3ae4edf8
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
...
...
@@ -148,12 +148,12 @@ namespace TicTactoe
private
void
WON
(
string
XO
,
Control
A
,
Control
B
,
Control
C
)
{
label1
.
Text
=
XO
+
" Wins"
;
A
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
B
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
C
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
foreach
(
Control
x
in
this
.
Controls
)
{
A
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
B
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
C
.
BackColor
=
System
.
Drawing
.
Color
.
Tomato
;
if
(
x
is
Button
&&
x
.
Tag
==
"play"
)
{
((
Button
)
x
).
Enabled
=
false
;
// disable all buttons - it is no longer possible to play when someone has won
...
...
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