Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lemeilleurjeudumonde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
tacticalrpg
lemeilleurjeudumonde
Commits
6413469d
There was a problem fetching the pipeline summary.
Commit
6413469d
authored
8 years ago
by
Romain Jegat
Browse files
Options
Downloads
Patches
Plain Diff
Ajout de fonctions relatives aux arbres de competence
parent
88b204f4
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/competence.c
+58
-3
58 additions, 3 deletions
src/competence.c
src/competence.h
+5
-5
5 additions, 5 deletions
src/competence.h
with
63 additions
and
8 deletions
src/competence.c
+
58
−
3
View file @
6413469d
...
...
@@ -22,8 +22,65 @@ typedef struct Competence{
*/
int
taille
(
Competence
*
noeud
)
{
Competence
*
enfant
;
int
compteur
=
1
;
for
(
enfant
=
noeud
->
enfant
;
enfant
!=
NULL
;
enfant
=
enfant
->
frere
)
compteur
+=
taille
(
enfant
);
return
compteur
;
}
unsigned
int
hauteur
(
Competence
*
noeud
)
{
if
(
!
estVide
(
noeud
))
{
int
compteur
=
1
;
Competence
*
enfant
;
for
(
enfant
=
noeud
->
enfant
;
enfant
!=
NULL
;
enfant
=
enfant
->
frere
)
{
if
(
hauteur
(
enfant
)
>
compteur
)
compteur
=
1
+
hauteur
(
enfant
);
}
return
compteur
;
}
else
{
return
0
;
}
}
int
estVide
(
Competence
*
c
)
{
if
(
c
->
enfant
==
NULL
)
return
0
;
else
return
1
;
}
boolean
est_connue
(
Competence
*
c
)
{
return
(
c
->
connu
);
}
unsigned
int
NbEnfants
(
Competence
*
noeud
)
{
unsigned
int
nb
;
if
(
estVide
(
noeud
))
{
nb
=
0
;
}
else
{
Competence
*
enfant
;
for
(
noeud
->
enfant
;
enfant
!=
NULL
;
enfant
=
enfant
->
frere
);
nb
++
;
}
return
nb
;
}
/* -------------------------------------------------------------------------------------- */
Competence
*
construire_arbre_competence
(
Competence
*
a
){
return
NULL
;
...
...
@@ -35,9 +92,7 @@ int rafraichir_competences(Competence * a){
}
boolean
est_connue
(
Competence
*
c
){
return
(
c
->
connu
);
}
boolean
est_complet
(
Competence
*
a
){
return
0
;
...
...
This diff is collapsed.
Click to expand it.
src/competence.h
+
5
−
5
View file @
6413469d
...
...
@@ -6,14 +6,14 @@
#ifndef DEPLACEMENTS_H_INCLUDED
#define DEPLACEMENTS_H_INCLUDED
/*
Definition des structure
s */
/*
Fonction
s */
/* A definir dans structure.h */
typedef
struct
Arbre_Competence
{
/* Arbre de compétence */
}
Arbre_Competence
;
int
taille
(
Competence
*
noeud
);
unsigned
int
NbEnfants
(
Competence
*
noeud
);
unsigned
int
hauteur
(
Competence
*
noeud
);
/* Fonctions */
Competence
*
construire_arbre_competence
(
Competence
*
a
);
...
...
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