Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
1
142GameCenter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nelson Phillips
142GameCenter
Commits
e8d9c884
Commit
e8d9c884
authored
Mar 12, 2019
by
Kyle Malaguit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
bb95deef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
23 deletions
+10
-23
Testings/SaveLoad/SaveLoad.cpp
Testings/SaveLoad/SaveLoad.cpp
+5
-5
Testings/SaveLoad/main.cpp
Testings/SaveLoad/main.cpp
+1
-17
Testings/SaveLoad/snakedata.txt
Testings/SaveLoad/snakedata.txt
+4
-1
No files found.
Testings/SaveLoad/SaveLoad.cpp
View file @
e8d9c884
...
...
@@ -14,11 +14,11 @@ void SaveLoad::pushBackNewScoreAndSort(Scores Score){
}
void
SaveLoad
::
displayScores
(){
cout
<<
"Rank Name Score"
<<
endl
;
int
i
=
1
;
cout
<<
"Rank"
<<
"
\t\t
"
<<
"Name"
<<
"
\t\t
"
<<
"Score"
<<
endl
;
for
(
auto
score
:
scores
){
cout
<<
i
++
<<
"
\t
"
<<
score
.
getName
()
<<
"
\t
"
<<
score
.
getScore
()
<<
endl
;
for
(
int
i
=
0
;
i
<
10
;
i
++
){
cout
<<
i
+
1
<<
"
\t\t
"
<<
scores
.
at
(
i
).
getName
()
<<
"
\t\t
"
<<
scores
.
at
(
i
).
getScore
()
<<
endl
;
}
}
...
...
@@ -30,7 +30,7 @@ void SaveLoad::userInputNameMakeScore(int intScore){
try
{
cin
>>
userNameInput
;
if
(
strlen
(
userNameInput
)
!=
3
){
throw
runtime_error
(
"Invalid User Name input
!
\n
"
);
throw
runtime_error
(
"Invalid User Name input!
\n
"
);
}
break
;
...
...
Testings/SaveLoad/main.cpp
View file @
e8d9c884
...
...
@@ -13,23 +13,7 @@ int main(){
// char userName[3];
SLSnake
second
;
second
.
LoadContainers
();
// cout << "Enter a username with a length of 3 characters\n";
// cin >> userName;
// //here is a temporary score input system
// //in the final project the score will be taken automatically from the system.
// int score;
// cout << "Enter a score: ";
// cin >> score;
// cout << endl;
// Scores score1(userName, score);
// second.pushBackNewScoreAndSort(score1);
// second.updateFile();
// second.displayScores();
second
.
userInputNameMakeScore
(
9999
);
second
.
userInputNameMakeScore
(
10000
);
second
.
updateFile
();
second
.
displayScores
();
...
...
Testings/SaveLoad/snakedata.txt
View file @
e8d9c884
...
...
@@ -2,10 +2,13 @@ NAME SCORE
nge 654346
vfd 45365
cdn 21474
bbb 9999
ooo 10000
LOP 10000
vfr 9999
ddd 9999
Kyl 9999
PPP 9999
bbb 9999
vfd 4636
vev 4536
DVS 3423
...
...
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