Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
police and thief
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731075
police and thief
Commits
663ee50c
Commit
663ee50c
authored
Apr 19, 2019
by
hosein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playground -> cleaned warnings
parent
cd25f5fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
30 deletions
+6
-30
PlayGround.java
src/pack/PlayGround.java
+6
-30
No files found.
src/pack/PlayGround.java
View file @
663ee50c
...
@@ -74,22 +74,14 @@ public class PlayGround {
...
@@ -74,22 +74,14 @@ public class PlayGround {
return
positions
;
return
positions
;
}
}
public
void
change
(
int
[][]
newPolicesSituation
,
int
xThief
,
int
yThief
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
n
;
i
++)
for
(
j
=
0
;
j
<
m
;
j
++)
ground
[
i
][
j
]
=
0
;
for
(
i
=
0
;
i
<
policeNumbers
;
i
++)
ground
[
newPolicesSituation
[
i
][
0
]][
newPolicesSituation
[
i
][
1
]]
=
1
;
ground
[
xThief
][
yThief
]
=
-
1
;
}
public
void
changeSituation
(
int
xPrevious
,
int
yPrevious
,
int
xNew
,
int
yNew
,
int
k
)
{
public
void
changeSituation
(
int
xPrevious
,
int
yPrevious
,
int
xNew
,
int
yNew
,
int
k
)
{
if
(
xNew
==
thiefSituation
[
0
][
0
]
&&
yNew
==
thiefSituation
[
0
][
1
])
return
;
if
(
xNew
==
thiefSituation
[
0
][
0
]
&&
yNew
==
thiefSituation
[
0
][
1
]
&&
k
==
1
)
return
;
ground
[
xPrevious
][
yPrevious
]
=
0
;
ground
[
xPrevious
][
yPrevious
]
=
0
;
ground
[
xNew
][
yNew
]
=
k
;
ground
[
xNew
][
yNew
]
=
k
;
if
(
k
==
-
1
)
{
thiefSituation
[
0
][
0
]
=
xNew
;
thiefSituation
[
0
][
1
]
=
yNew
;
}
}
}
...
@@ -121,15 +113,6 @@ public class PlayGround {
...
@@ -121,15 +113,6 @@ public class PlayGround {
return
null
;
return
null
;
}
}
public
boolean
catchThief
()
{
int
i
,
j
;
for
(
i
=
0
;
i
<
n
;
i
++)
for
(
j
=
0
;
j
<
m
;
j
++)
if
(
ground
[
i
][
j
]
==
100
)
return
true
;
return
false
;
}
public
boolean
isEmpty
(
int
x
,
int
y
)
{
public
boolean
isEmpty
(
int
x
,
int
y
)
{
if
(
ground
[
x
][
y
]
==
-
1
)
{
if
(
ground
[
x
][
y
]
==
-
1
)
{
catchThief
=
true
;
catchThief
=
true
;
...
@@ -145,15 +128,8 @@ public class PlayGround {
...
@@ -145,15 +128,8 @@ public class PlayGround {
return
ret
;
return
ret
;
}
}
public
int
[][]
getThiefSituation
()
{
int
[][]
ret
=
new
int
[
1
][
2
];
ret
[
0
][
0
]
=
thiefSituation
[
0
][
0
];
ret
[
0
][
1
]
=
thiefSituation
[
0
][
1
];
return
ret
;
}
public
boolean
getCatchThief
()
{
public
boolean
getCatchThief
()
{
return
catchThief
;
return
catchThief
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment