Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T800
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Vytor Calixto
T800
Commits
e510d1a1
Commit
e510d1a1
authored
9 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Adicinei ; que faltava. Comentei função da menor distancia
parent
ae6ecf21
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
main.c
+7
-6
7 additions, 6 deletions
main.c
with
8 additions
and
7 deletions
Makefile
+
1
−
1
View file @
e510d1a1
CFLAGS
=
-std
=
c99
-Wall
CFLAGS
=
-std
=
c99
-Wall
-lm
all
:
main.c
all
:
main.c
gcc
-o
robot main.c
$(
CFLAGS
)
gcc
-o
robot main.c
$(
CFLAGS
)
...
...
This diff is collapsed.
Click to expand it.
main.c
+
7
−
6
View file @
e510d1a1
...
@@ -21,9 +21,9 @@ int main(int argc, char const *argv[]) {
...
@@ -21,9 +21,9 @@ int main(int argc, char const *argv[]) {
int
t_size
;
int
t_size
;
Tuple
*
tuplas
;
Tuple
*
tuplas
;
puts
(
"Quantos pontos há na lista? Mínimo de 10 elementos."
);
puts
(
"Quantos pontos há na lista? Mínimo de 10 elementos."
);
scanf
(
"%d
\n
"
,
&
t_size
);
scanf
(
"%d"
,
&
t_size
);
if
(
t_size
<
10
)
{
if
(
t_size
<
10
)
{
puts
(
"A lista deve ter no mínimo 10 elementos."
)
puts
(
"A lista deve ter no mínimo 10 elementos."
)
;
exit
(
1
);
exit
(
1
);
}
}
tuplas
=
malloc
(
t_size
*
sizeof
(
Tuple
));
tuplas
=
malloc
(
t_size
*
sizeof
(
Tuple
));
...
@@ -34,13 +34,14 @@ int main(int argc, char const *argv[]) {
...
@@ -34,13 +34,14 @@ int main(int argc, char const *argv[]) {
puts
(
"Por favor insira as coordenadas na qual o robô deverá passar e seu tempo em milissegundos."
);
puts
(
"Por favor insira as coordenadas na qual o robô deverá passar e seu tempo em milissegundos."
);
puts
(
"(Ex: x1 y1 tempo1
\n
x2 y2 tempo2
\n
...
\n
xN yN tempoN)"
);
puts
(
"(Ex: x1 y1 tempo1
\n
x2 y2 tempo2
\n
...
\n
xN yN tempoN)"
);
for
(
int
i
=
0
;
i
<
t_size
;
++
i
)
{
for
(
int
i
=
0
;
i
<
t_size
;
++
i
)
{
scanf
(
"%d %d %d
\n
"
,
&
tuplas
[
i
].
x
,
&
tuplas
[
i
].
y
,
&
tuplas
[
i
].
t
);
scanf
(
"%d %d %d"
,
&
tuplas
[
i
].
x
,
&
tuplas
[
i
].
y
,
&
tuplas
[
i
].
t
);
}
}
// Fiz uma função que calcula a menor distância entre pontos, não sei se é útil
// Fiz uma função que calcula a menor distância entre pontos, não sei se é útil
for
(
int
i
=
0
;
i
<
10
;
++
i
){
//
for (int i=0; i<10; ++i){
dist
=
menorDistancia
(
tuplas
[
i
][
0
],
tuplas
[
i
][
1
],
tuplas
[
i
+
1
][
0
],
tuplas
[
i
+
1
][
1
]);
//
dist = menorDistancia(tuplas[i][0],tuplas[i][1],tuplas[i+1][0],tuplas[i+1][1]);
}
//
}
// calcular velocidade das rodas entre cada coordenada
// calcular velocidade das rodas entre cada coordenada
// gerar tabela e grafico
// gerar tabela e grafico
...
...
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