Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RogueReborn
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository 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
Mikhail Andrenkov
RogueReborn
Commits
c8a901e6
Commit
c8a901e6
authored
8 years ago
by
Ori Almog
Browse files
Options
Downloads
Patches
Plain Diff
Basic map working
parent
5fe42010
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
a.out
+0
-0
0 additions, 0 deletions
a.out
auto
+5
-0
5 additions, 0 deletions
auto
main.cpp
+61
-0
61 additions, 0 deletions
main.cpp
with
66 additions
and
0 deletions
a.out
0 → 100755
+
0
−
0
View file @
c8a901e6
File added
This diff is collapsed.
Click to expand it.
auto
0 → 100644
+
5
−
0
View file @
c8a901e6
#!/bin/bash
rm
a.out
clear
g++ main.cpp
-std
=
c++11
./a.out
This diff is collapsed.
Click to expand it.
main.cpp
0 → 100644
+
61
−
0
View file @
c8a901e6
#include
<iostream>
#include
<vector>
using
namespace
std
;
void
printMap
(
vector
<
vector
<
char
>>
map
)
{
cout
<<
"+-"
;
for
(
int
i
=
0
;
i
<
map
.
size
();
i
++
){
cout
<<
"--"
;
}
cout
<<
'+'
<<
endl
;;
for
(
vector
<
char
>
i
:
map
)
{
cout
<<
'|'
;
for
(
char
j
:
i
){
cout
<<
' '
<<
j
;
}
cout
<<
" |"
<<
endl
;
}
cout
<<
"+-"
;
for
(
int
i
=
0
;
i
<
map
.
size
();
i
++
){
cout
<<
"--"
;
}
cout
<<
'+'
<<
endl
;
}
vector
<
vector
<
char
>>
getMap
(
int
playerX
,
int
playerY
,
int
mapSize
){
vector
<
vector
<
char
>>
map
(
mapSize
);
for
(
int
i
=
0
;
i
<
map
.
size
();
i
++
){
map
[
i
]
=
vector
<
char
>
(
mapSize
);
}
int
k
=
0
;
for
(
vector
<
char
>&
i
:
map
)
{
for
(
char
&
j
:
i
){
j
=
' '
;
}
}
map
[
playerY
][
playerX
]
=
'#'
;
return
map
;
}
int
main
()
{
cout
<<
"Welcome to RogueReborn"
<<
endl
;
printMap
(
getMap
(
5
,
5
,
10
));
}
\ No newline at end of file
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