Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Group Project
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Ahmed Yusuf
Group Project
Compare revisions
2af9004f1bde1ced2c6571c8257064bf71aba87b to 3e7e939d167b95e8db20ad7d5bfce7bb63191ccb
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
c22027697/group-project
Select target project
No results found
3e7e939d167b95e8db20ad7d5bfce7bb63191ccb
Select Git revision
Branches
main
Swap
Target
c22027697/group-project
Select target project
c22027697/group-project
1 result
2af9004f1bde1ced2c6571c8257064bf71aba87b
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
end game statement
· a113316c
Morgan Diment
authored
2 years ago
a113316c
Merge branch 'main' of
https://git.cardiff.ac.uk/c22027697/group-project
· 3e7e939d
Morgan Diment
authored
2 years ago
3e7e939d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Group_game/game.py
+7
-3
7 additions, 3 deletions
Group_game/game.py
Group_game/leaderboard.py
+2
-2
2 additions, 2 deletions
Group_game/leaderboard.py
Group_game/level_2.py
+0
-3
0 additions, 3 deletions
Group_game/level_2.py
with
9 additions
and
8 deletions
Group_game/game.py
View file @
3e7e939d
...
@@ -372,8 +372,8 @@ def main():
...
@@ -372,8 +372,8 @@ def main():
# Main game loop
# Main game loop
while
True
:
while
True
:
current_time
=
datetime
.
now
()
current_time
=
datetime
.
now
()
time_
taken
=
current_time
-
start_time
time_
used
=
current_time
-
start_time
time_left
=
1200
-
time_
taken
.
total_seconds
()
time_left
=
1200
-
time_
used
.
total_seconds
()
if
time_penalty
:
if
time_penalty
:
time_left
=
time_left
-
300
time_left
=
time_left
-
300
if
time_left
<
0
:
if
time_left
<
0
:
...
@@ -397,8 +397,12 @@ def main():
...
@@ -397,8 +397,12 @@ def main():
gas_starttime
=
datetime
.
now
()
gas_starttime
=
datetime
.
now
()
location_entrance
[
"
entered
"
]
=
True
location_entrance
[
"
entered
"
]
=
True
if
trap_door
[
"
open
"
]:
if
trap_door
[
"
open
"
]:
minutes
=
time_taken
()[
0
]
seconds
=
time_taken
()[
1
]
print
()
print
(
"
WELL DONE! You have completed the escape room.
"
)
print
(
'
You took
'
,
minutes
,
'
minutes and
'
,
seconds
,
'
seconds.
'
)
print
()
print
()
print
(
"
(game ending)
"
)
break
break
print_room
(
current_room
)
print_room
(
current_room
)
...
...
This diff is collapsed.
Click to expand it.
Group_game/leaderboard.py
View file @
3e7e939d
...
@@ -37,7 +37,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
...
@@ -37,7 +37,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
time
=
[
round
(
minutes
),
round
(
seconds
)]
time
=
[
round
(
minutes
),
round
(
seconds
)]
print
(
"
Congrats, enter your name on the leaderboard!
"
)
print
(
"
Congrats, enter your name on the leaderboard!
"
)
name
=
input
(
"
What
'
s your name? :
"
)
name
=
input
(
"
What
'
s your name? :
"
)
print
(
'
Well done!
'
+
name
)
print
(
'
Well done!
'
+
name
)
print
(
f
'
You escaped in
{
time
[
0
]
}
minutes and
{
time
[
1
]
}
seconds
'
)
print
(
f
'
You escaped in
{
time
[
0
]
}
minutes and
{
time
[
1
]
}
seconds
'
)
...
@@ -65,7 +65,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
...
@@ -65,7 +65,7 @@ def append_leaderboard(seconds_used,filename): #time_used = 20 minutes - time r
file
.
close
()
file
.
close
()
print
(
"
Input
'
Yes
'
or
'
No
'"
)
print
(
"
Input
'
Yes
'
or
'
No
'"
)
userinput
=
input
(
"
Would you live to view the leaderboard? :
"
)
userinput
=
input
(
"
Would you live to view the leaderboard? :
"
)
userinput
=
userinput
.
lower
()
userinput
=
userinput
.
lower
()
if
userinput
==
'
yes
'
:
if
userinput
==
'
yes
'
:
view_leaderboard
(
filename
)
view_leaderboard
(
filename
)
...
...
This diff is collapsed.
Click to expand it.
Group_game/level_2.py
View file @
3e7e939d
...
@@ -9,7 +9,6 @@ import time
...
@@ -9,7 +9,6 @@ import time
def
drink_wine
():
def
drink_wine
():
# need to add time deduction
counter
=
0
counter
=
0
x
=
""
x
=
""
while
counter
<
3
:
while
counter
<
3
:
...
@@ -56,8 +55,6 @@ def drink_wine():
...
@@ -56,8 +55,6 @@ def drink_wine():
counter
+=
1
counter
+=
1
time
.
sleep
(
4
)
time
.
sleep
(
4
)
x
=
3
x
=
3
# time_taken = time_taken - 360
# remove wine from inventory
return
x
return
x
...
...
This diff is collapsed.
Click to expand it.