Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
first_git
Project
Project
Details
Activity
Releases
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
areej.mohammad
first_git
Commits
55577373
Commit
55577373
authored
Nov 04, 2025
by
areej.mohammad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
step 4
parent
565e4667
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
DescendingHackerThread.java
src/hackingrace/DescendingHackerThread.java
+1
-0
PoliceThread.java
src/hackingrace/PoliceThread.java
+5
-2
No files found.
src/hackingrace/DescendingHackerThread.java
View file @
55577373
...
@@ -6,6 +6,7 @@ public class DescendingHackerThread extends HackerThread
...
@@ -6,6 +6,7 @@ public class DescendingHackerThread extends HackerThread
super
(
vault
,
"Descending Hacker"
);
super
(
vault
,
"Descending Hacker"
);
}
}
@Override
@Override
//// Attempts to guess the password starting from 9999, decrementing down to 0
public
void
run
(){
public
void
run
(){
for
(
int
guess
=
10000
;
guess
>=
0
;
guess
--)
for
(
int
guess
=
10000
;
guess
>=
0
;
guess
--)
{
{
...
...
src/hackingrace/PoliceThread.java
View file @
55577373
...
@@ -6,22 +6,25 @@ public class PoliceThread extends Thread{
...
@@ -6,22 +6,25 @@ public class PoliceThread extends Thread{
super
(
"Police"
);
super
(
"Police"
);
}
}
@Override
@Override
// Counts down from 10 seconds (time available before police arrive)
public
void
run
(){
public
void
run
(){
for
(
int
i
=
10
;
i
>=
0
;
i
--)
for
(
int
i
=
10
;
i
>=
0
;
i
--)
if
(
i
>
0
)
{
if
(
i
>
0
)
{
System
.
out
.
printf
(
"Police arrive in %d seconds...\n"
,
i
);
System
.
out
.
printf
(
"Police arrive in %d seconds...\n"
,
i
);
}
else
{
}
else
{
// عند الوصول إلى 0، تفوز الشرطة [cite: 23, 31]
System
.
out
.
println
(
"\n**************************************************"
);
System
.
out
.
println
(
"\n**************************************************"
);
System
.
out
.
println
(
"Game over for you hackers! Police have arrived."
);
System
.
out
.
println
(
"Game over for you hackers! Police have arrived."
);
System
.
out
.
println
(
"**************************************************"
);
System
.
out
.
println
(
"**************************************************"
);
// يُنهي البرنامج بالكامل [cite: 23, 57]
// Terminate the entire program
System
.
exit
(
0
);
System
.
exit
(
0
);
}
}
try
{
try
{
// Waits for one second (1000 milliseconds) for each count
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
){
}
catch
(
InterruptedException
e
){
// If this thread is interrupted, it means a hacker won, so we stop the countdown
return
;
return
;
}
}
...
...
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